-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
build: update Rollup to v4 #5510
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5510 +/- ##
=======================================
Coverage 93.69% 93.69%
=======================================
Files 57 57
Lines 4390 4390
Branches 849 849
=======================================
Hits 4113 4113
Misses 277 277 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
285e5d0 to
a9102f0
Compare
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.
Just commenting some first thoughts for now, I'll need to review Rollup in more detail and test this locally to see what's going on. Might be a week-ish, I usually prioritize bugfixes first.
| "test/integration/fixtures/**", | ||
| ".karma/**", | ||
| "mocha.js", | ||
| // TODO: EsLint v8 parser can't parse Import attributes |
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 you clarify what this comment means?
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 you use Import attributes they can't be parsed by the AST builder used in EsLint v8 and it crashes the lint process.
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.
So import packageJson from "./package.json" with { type: "json" }; result is something like
Error: unexpected character `{` in X
| import pickFromPackageJson from "./scripts/pick-from-package-json"; | ||
| import { version } from "./package.json"; | ||
| import pickFromPackageJson from "./scripts/pick-from-package-json.mjs"; | ||
| import packageJson from "./package.json" with { type: "json" }; |
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.
why change this one? does the old import { version } from "./package.json"; no longer work? would it work if we used import { version } from "./package.json" with { type: "json" }; ?
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.
I have to double check the first part, that was something but for the Import Attributes only Default exports are possible
Note: JSON modules only have one default export. You cannot do named imports from them (like import { name } from "data.json").
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.
And to answer the first question, no you get a Error (Tested Node v20,v22,v24)
TypeError [ERR_IMPORT_ATTRIBUTE_MISSING]: Module "./package.json" needs an import attribute of "type: json"
PR Checklist
status: accepting prs(edited by @mark-wiemer)Overview
Updates rollup to v4.
This change is needed for the EsLint v9 bump - #5483.
Notable changes drops
rollup-plugin-node-globaland usesrollup-plugin-polyfill-nodeunconditionally.