Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add bundleStrategy option #13173

Merged
merged 20 commits into from
Dec 19, 2024

Conversation

paoloricciuti
Copy link
Member

@paoloricciuti paoloricciuti commented Dec 16, 2024

This adapts the code from @benmccann branch https://github.com/sveltejs/kit/tree/iife to the new shape of the repo. I also had to make some other changes namely:

  1. instead of using the iife output (which doesn't export anything and put everything in a global variable) i used manualChunks with a single chunk
  2. since we have everything in a single file i "namespaced" app by export * as app
  3. on the client when resolving the bundle i've assigned kit.app as a fallback for app

I'm not super-familiar with the test suite so if you can suggest how and were i can test this (i guess it should be a new app?) i would appreciate (also not really sure if this has any repercussions).


Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

Copy link

changeset-bot bot commented Dec 16, 2024

🦋 Changeset detected

Latest commit: c067207

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Rich-Harris
Copy link
Member

preview: https://svelte-dev-git-preview-kit-13173-svelte.vercel.app/

this is an automated message

@paoloricciuti paoloricciuti changed the title feat: add codeSplitJs option feat: add codeSplit option Dec 17, 2024
@eltigerchino eltigerchino added the feature / enhancement New feature or request label Dec 17, 2024
@Rich-Harris
Copy link
Member

Going to change this to bundleStrategy: 'split' | 'single' rather than codeSplit: boolean, so that we can accommodate more options in future

@paoloricciuti
Copy link
Member Author

Going to change this to bundleStrategy: 'split' | 'single' rather than codeSplit: boolean, so that we can accommodate more options in future

If you want I can do it myself

@Rich-Harris
Copy link
Member

it's all good, I'm in the branch — I'm laying the groundwork for a separate feature that will be built on top of this, so there might be additional tweaks required

@Rich-Harris Rich-Harris changed the title feat: add codeSplit option feat: add bundleStrategy option Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature / enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants