-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
chore: unbundled esm #8613
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
|
rollup.config.js
Outdated
fs.writeFileSync( | ||
'./src/shared/version.js', | ||
`/** @type {string} */\nexport const VERSION = '${pkg.version}';` | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 | ||
/test/**/*.svelte | ||
/test/**/_expected* | ||
/test/**/_actual* | ||
/test/**/expected* | ||
/test/**/_output | ||
/types | ||
!rollup.config.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add a comment explaining why this needs to be ignored
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The !
means it's not ignored, which it was previously 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we still have sourcemaps for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
@@ -6,75 +6,67 @@ | |||
"module": "index.mjs", | |||
"main": "index", | |||
"files": [ | |||
"src", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these needed in addition to the exports map because of the moduleResolution thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct
/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 test
and lint the project withnpm run lint