chore: unbundled esm#8613
Conversation
- removes esm bundle step - introduces generated version.js because we can no longer use replace because we don't bundle esm
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
📝 Ran ecosystem CI: Open
|
| fs.writeFileSync( | ||
| './src/shared/version.js', | ||
| `/** @type {string} */\nexport const VERSION = '${pkg.version}';` | ||
| ); | ||
|
|
There was a problem hiding this comment.
This would mean one has to run build before doing anything else, eg. running tests. How about keeping it tracked in git and regenerating it in the release action instead?
There was a problem hiding this comment.
Since the build is run as part of the prepare script, this will be missing only those who already have the repository checked out - doing pnpm build once is fine for me in that case. It's the same for the internal_exports.js btw which exists for a long time already. I wouldn't want those things to be checked in personally.
There was a problem hiding this comment.
we discussed about the difficulties of adding a version file with changeset workflow here sveltejs/kit#9969 as long as it is part of the revision that gets tagged as that version and we are 300% sure the two versions in package.json and version.js can never get out of sync i'd be fine with it, but not without.
A unit test could do this.
There was a problem hiding this comment.
preblishOnly triggers the build which contains the version.js generation as part of it, at which point the pkg.version has already been updated, so it's safe to do it that way.
There was a problem hiding this comment.
personally I don't think the stuff the version is used for is that important and I'd be fine to just drop it as it doesn't really seem necessary and people can read or import the package.json to get the version themselves if they really care about it
| /test/**/expected* | ||
| /test/**/_output | ||
| /types | ||
| !rollup.config.js |
There was a problem hiding this comment.
can we add a comment explaining why this needs to be ignored
There was a problem hiding this comment.
The ! means it's not ignored, which it was previously 😄
There was a problem hiding this comment.
ah, duh. the format of this file is rather peculiar where it ignores everything in the root directory by default and then only opts files in. I wonder if we could swap that once the CJS version is removed
| file: 'compiler.cjs', | ||
| format: is_publish ? 'umd' : 'cjs', | ||
| name: 'svelte', | ||
| sourcemap: false |
There was a problem hiding this comment.
Shouldn't we still have sourcemaps for this?
There was a problem hiding this comment.
We decided to remove it because rarely any tool depends on it, and those who do can still backtrack manually
|
Talked to Rich about this - decision:
|
|
/ecosystem-ci run |
|
📝 Ran ecosystem CI: Open
|
|
/ecosystem-ci run |
|
📝 Ran ecosystem CI: Open
|
|
/ecosystem-ci run |
|
📝 Ran ecosystem CI: Open
|
|
@dominikg do you know what's up with the vite ecosystem test failing? Sounds like ESlint has problems resolving the symlinks or sth? |
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
| "module": "index.mjs", | ||
| "main": "index", | ||
| "files": [ | ||
| "src", |
There was a problem hiding this comment.
we should separate the dependencies and devDependencies in this file as was being done in #8523. i'm not sure if you want to try to merge that PR first or copy those changes into this PR
There was a problem hiding this comment.
If copying over the changes, source-map needs to be kept and so does the util polyfill for the UMD bundle.
There was a problem hiding this comment.
Thanks for catching that. I updated #8523 to address that
|
Publint: |
that should go away after v-p-s jsdoc conversion has merged sveltejs/vite-plugin-svelte#655 sveltejs/vite-plugin-svelte#657 , part of that is switching from eslint-plugin-node to its successor eslint-plugin-n. |
| "index.d.ts", | ||
| "internal.d.ts", | ||
| "store.d.ts", | ||
| "animate.d.ts", | ||
| "transition.d.ts", | ||
| "easing.d.ts", | ||
| "motion.d.ts", | ||
| "action.d.ts", | ||
| "elements.d.ts", |
There was a problem hiding this comment.
Are these needed in addition to the exports map because of the moduleResolution thing?
|
/ecosystem-ci run |
|
📝 Ran ecosystem CI: Open
|
…to unbundled-esm
BREAKING CHANGE cjs support removed
Svelte no longer supports CJS as a compiler output and its runtime version of CJS and the register hook is removed, too. Use a bundler like Vite or our full-stack framework SvelteKit instead.
Changes
Before submitting the PR, please make sure you do the following
feat:,fix:,chore:, ordocs:.Tests
npm testand lint the project withnpm run lint