diff --git a/.changeset/funny-ravens-run.md b/.changeset/funny-ravens-run.md
deleted file mode 100644
index b0600bc5d..000000000
--- a/.changeset/funny-ravens-run.md
+++ /dev/null
@@ -1,47 +0,0 @@
----
-'@faustwp/core': minor
----
-
-Feat: Added support `next/dynamic` imports for templates to reduce initial bundle size in a way that's backwards compatible with static imports.
-
-This solves a known issue in Faust where all defined templates are bundled together and loaded on every WordPress page. By enabling the use of dynamic importing of templates this issue is resolved. Now templates are only loaded as needed per route.
-
-It's recommended you migrate to dynamic imports by updating your template file. Here's an example:
-
-```js title=src/wp-templates/index.js
-// Old Static Templates
-import category from './category';
-import tag from './tag';
-import frontPage from './front-page';
-import page from './page';
-import single from './single';
-
-export default {
- category,
- tag,
- 'front-page': frontPage,
- page,
- single,
-};
-
-// New Dynamic Templates
-import dynamic from 'next/dynamic';
-
-const category = dynamic(() => import('./category.js'));
-const tag = dynamic(() => import('./tag.js'));
-const frontPage = dynamic(() => import('./front-page.js'));
-const page = dynamic(() => import('./page.js'));
-
-// The above examples assume use of default exports. If you are using named exports you'll need to handle that:
-const single = dynamic(() => import('./single.js').then(mod => mod.Single));
-
-export default {
- category,
- tag,
- 'front-page': frontPage,
- page,
- single,
-};
-```
-
-For further info see the Next.js docs on the use of [`next/dynamic`](https://nextjs.org/docs/pages/guides/lazy-loading#nextdynamic-1).
diff --git a/examples/next/faustwp-getting-started/package.json b/examples/next/faustwp-getting-started/package.json
index 0314ba25b..8aedd3388 100644
--- a/examples/next/faustwp-getting-started/package.json
+++ b/examples/next/faustwp-getting-started/package.json
@@ -12,7 +12,7 @@
"dependencies": {
"@apollo/client": "^3.10.4",
"@faustwp/cli": "^3.3.4",
- "@faustwp/core": "^3.3.4",
+ "@faustwp/core": "^3.4.0",
"@wordpress/base-styles": "^6.15.0",
"@wordpress/block-library": "^9.10.0",
"classnames": "^2.5.1",
diff --git a/packages/faustwp-core/CHANGELOG.md b/packages/faustwp-core/CHANGELOG.md
index 6cda0807f..137f19892 100644
--- a/packages/faustwp-core/CHANGELOG.md
+++ b/packages/faustwp-core/CHANGELOG.md
@@ -1,5 +1,53 @@
# @faustwp/core
+## 3.4.0
+
+### Minor Changes
+
+- ec26ac4: Feat: Added support `next/dynamic` imports for templates to reduce initial bundle size in a way that's backwards compatible with static imports.
+
+ This solves a known issue in Faust where all defined templates are bundled together and loaded on every WordPress page. By enabling the use of dynamic importing of templates this issue is resolved. Now templates are only loaded as needed per route.
+
+ It's recommended you migrate to dynamic imports by updating your template file. Here's an example:
+
+ ```js title=src/wp-templates/index.js
+ // Old Static Templates
+ import category from './category';
+ import tag from './tag';
+ import frontPage from './front-page';
+ import page from './page';
+ import single from './single';
+
+ export default {
+ category,
+ tag,
+ 'front-page': frontPage,
+ page,
+ single,
+ };
+
+ // New Dynamic Templates
+ import dynamic from 'next/dynamic';
+
+ const category = dynamic(() => import('./category.js'));
+ const tag = dynamic(() => import('./tag.js'));
+ const frontPage = dynamic(() => import('./front-page.js'));
+ const page = dynamic(() => import('./page.js'));
+
+ // The above examples assume use of default exports. If you are using named exports you'll need to handle that:
+ const single = dynamic(() => import('./single.js').then(mod => mod.Single));
+
+ export default {
+ category,
+ tag,
+ 'front-page': frontPage,
+ page,
+ single,
+ };
+ ```
+
+ For further info see the Next.js docs on the use of [`next/dynamic`](https://nextjs.org/docs/pages/guides/lazy-loading#nextdynamic-1).
+
## 3.3.6
### Patch Changes
@@ -94,11 +142,11 @@
export default function Sitemap() {}
export function getServerSideProps(ctx) {
- return getSitemapProps(ctx, {
- sitemapIndexPath: '/sitemap_index.xml', // RankMath changes the default sitemap path to this
- frontendUrl: process.env.NEXT_PUBLIC_SITE_URL,
- sitemapPathsToIgnore: ['/wp-sitemap-users-*'],
- });
+ return getSitemapProps(ctx, {
+ sitemapIndexPath: '/sitemap_index.xml', // RankMath changes the default sitemap path to this
+ frontendUrl: process.env.NEXT_PUBLIC_SITE_URL,
+ sitemapPathsToIgnore: ['/wp-sitemap-users-*'],
+ });
}
```
@@ -202,7 +250,7 @@
```jsx
- Log Out
+ Log Out
```
@@ -308,18 +356,18 @@
import { FaustPage } from '@faustwp/core';
type GetPageData = {
- generalSettings: {
- title: string;
- };
+ generalSettings: {
+ title: string;
+ };
};
type PageProps = {
- myProp: string;
+ myProp: string;
};
const Page: FaustPage = (props) => {
- const { myProp, data } = props;
- return <>>;
+ const { myProp, data } = props;
+ return <>>;
};
```
@@ -388,9 +436,9 @@
export default function Sitemap() {}
export function getServerSideProps(context) {
- return getSitemapProps(context, {
- frontendUrl: process.env.FRONTEND_URL, // Set the FRONTEND_URL as an env var
- });
+ return getSitemapProps(context, {
+ frontendUrl: process.env.FRONTEND_URL, // Set the FRONTEND_URL as an env var
+ });
}
```
@@ -420,7 +468,7 @@
import { FaustHooks, FaustPlugin } from '@faustwp/core';
export class MyPlugin implements FaustPlugin {
- apply(hooks: FaustHooks) {}
+ apply(hooks: FaustHooks) {}
}
```
diff --git a/packages/faustwp-core/package.json b/packages/faustwp-core/package.json
index a8a417eb8..4ec0d42e2 100644
--- a/packages/faustwp-core/package.json
+++ b/packages/faustwp-core/package.json
@@ -1,6 +1,6 @@
{
"name": "@faustwp/core",
- "version": "3.3.6",
+ "version": "3.4.0",
"description": "Faust is a framework that aims to make headless WordPress as streamlined as classic WordPress for both developers and publishers",
"main": "dist/cjs/index.js",
"module": "dist/mjs/index.js",