Skip to content

Version Packages#2267

Open
github-actions[bot] wants to merge 1 commit intocanaryfrom
changeset-release/canary
Open

Version Packages#2267
github-actions[bot] wants to merge 1 commit intocanaryfrom
changeset-release/canary

Conversation

@github-actions
Copy link
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or setup this action to publish automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to canary, this PR will be updated.

Releases

@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:

    // 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.

@github-actions github-actions bot requested a review from a team as a code owner February 18, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants

Comments