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

[v4.0] Switch parser to SWC and introduce native/WASM code #5073

Merged
merged 208 commits into from Sep 17, 2023

Conversation

lukastaegert
Copy link
Member

@lukastaegert lukastaegert commented Jul 25, 2023

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

This is a massive undertaking and there is still a lot to do. The goal is to switch the parser from acorn to swc while actually improving performance. Unfortunately, this does not mean using the JavaScript bindings of swc. At least in my experience, the cost of serializing an deserializing the complex AST nearly eats up the performance benefits of switching the parser. Moreover, swc has a very different AST (and even if you use the ESTree compat module, it is still a Babel AST and not an ESTree AST). Also, and this is critical, it uses utf-8 file positions while Rollup relies on the standard JavaScript utf-16 positions.
Instead, the approach is to directly use the Rust bindings of swc and convert the AST to a binary format before passing it as an (Array)Buffer to JavaScript. While doing this, we account for the AST differences and correct the file positions. Passing an ArrayBuffer is basically a free operation, so we just need to teach the JavaScript side to work on the ArrayBuffer. Also, the buffer is only about a third the size of stringified JSON. And last, this will enable us to easily pass ASTs to different threads or rather, do the parsing in a WebWorker and pass the buffer to the main thread for free.
To interact with the Rust code, I use napi-rs in NodeJS and will probably use wasm-pack for the browser build.
For now, the actual conversion is done. As a by-product of the process, the custom swc AST is converted to an ESTree-compliant AST, which has been verified by deep comparison with the acorn AST for all Rollup test cases.

The goal is to make this the core change in Rollup 4.

There is a lot that needs to be done, though, before this can even be tested.

Most critical changes to enable external testing

  • Add WASM browser build
  • Fix Node release process to allow the release of beta versions to enable others to test things

Critical for release

  • Publish @rollup/browser with included WASM file
  • Handle Syntax errors
  • Handle other errors that used to be handled by acorn, e.g. duplicate bindings
  • Handle PURE and other comments
  • Make CI tests work
  • Remove acorn options
  • Add a Node WASM release for StackBlitz and similar use cases
  • Make PRs available in REPL again (currently commented out on master)
  • Make build process work across environments. Add instructions at least for Mac and Windows somewhere in CONTRIBUTING.md how to set up Rust nightly.
  • Ensure npm install github/branch works again across environments. If necessary, add instructions how to install rustup nightly to PR comment. Remove browser build from prepare script to make this process faster.

Not critical but should be part of Rollup 4.0 to avoid a breaking change

  • Switch to final AST structure of import attributes

Nice to have but not critical

  • Store binary buffers in Rollup cache instead of AST if available (this is not the case if a custom AST is returned by a plugin, in which case we probably stick with storing the AST itself).
  • @lukastaegert Make release comments work from CI in some way
  • Enable aarch64-unknown-linux-musl target (currently commented out)
  • See if using the browser readString version provides similar performance as using the Buffer method to simplify code
  • Deduplicate strings in the binary AST
  • Use faster utf-8 to utf-16 conversion by querying positions only in ascending order and iterating code points lazily
  • Use one list of numeric ids for fixed strings
  • Use one 32bit block for all booleans and fixed strings in any AST node to further reduce size
  • Refine estimate for initial buffer size when converting the AST
  • Add an easy way to compare the AST against the acorn AST in tests
  • Use WebWorkers for parsing
  • JSX support that keeps JSX syntax but tracks usages and renamed variables
  • JSX support that transpiles JSX
  • TypeScript support that removes types
  • TypeScript support that keeps types but performs tree-shaking and tracks renames (if possible)
  • Improve this.parse API with an asynchronous alternative that does not create the actual AST and supports very fast tree-walking via special APIs.
  • Do not create intermediate AST nodes but directly convert AST to Rollup nodes. This means we need a solution if a plugin DOES return an AST. Ideally, we also turn that into binary, and we need to handle unknown nodes.
  • Add instructions for copying wasm files when using @rollup/browser.

BREAKING CHANGES

  • Acorn plugins are no longer supported, the acornInjectPlugins option has been removed
  • The acorn option has been removed
  • You can no longer pass additional options to this.parse
  • Import assertions now use the new import attribute AST structure
  • The "with" syntax for import attributes is not yet supported, awaiting support in SWC
  • "assertions" have been replaced with "attributes" in various places of the plugin interface
  • output.externalImportAssertions has been deprecated in favor of output.externalImportAttributes
  • The INVALID_IMPORT_ASSERTION error code has been replaced with INVALID_IMPORT_ATTRIBUTE

…PatternProperty, ArrayLiteral, ImportExpression
lukastaegert added a commit that referenced this pull request Sep 18, 2023
* Set minimum Node version to 18

* Set the default of skipSelf to true

* [v4.0] Switch parser to SWC and introduce native/WASM code (#5073)

* Add native compilation for local NodeJS

* Link instead of copying for faster dev cycles for now

* Parse AST

* Convert first trivial AST to a buffer

* Use SWC for parsing

* Extend AST conversion

* Make AST more similar

* Fix line number issue by creating a new sourcemap (and thus compiler) for each run

* Collect timings

* Add code_length to struct

* Refine parsing

* Extend parsing

* Extend AST: ImportDefaultSpecifier, LiteralBoolean, LiteralNull, ExportDefaultExpression

* Extend AST: ImportNamespaceSpecifier, ExportAll

* Extend AST: BinaryExpression, ArrayPattern, ObjectPattern, AssignmentPatternProperty, ArrayLiteral, ImportExpression

* Extend AST: ConditionalExpression

* Extend AST: FunctionDeclaration, ClassDeclaration, ClassBody, ReturnStatement

* Extend AST: ObjectLiteral, KeyValueProperty

* Extend AST: ShorthandProperty

* Extend AST: GetterProperty, AssignmentExpression, NewExpression, FunctionExpression

* Extend AST: ThrowStatement

* Extend AST: ExportDefaultDeclaration

* Extend AST: AssignmentPattern, AwaitExpression, BreakStatement
Start sorting AST nodes

* Extend AST: TryStatement, CatchClause, ChainExpression

* Extend AST: ClassExpression, ContinueStatement, DebuggerStatement, DoWhileStatement, EmptyStatement

* Extend AST: ExportNamedDeclaration, ForInStatement, ForOfStatement, ForStatement

* Extend AST: IfStatement

* Extend AST: Import attributes

* Extend AST: Literal<RegExp>, Literal<BigInt>

* Extend AST: LogicalExpression

* Extend AST: MetaProperty

* Extend AST: Various Property types

* Extend AST: Progress on classes

* Extend AST: MethodDefinition, PropertyDefinition, PrivateName, ThisExpression

* Extend AST: StaticBlock, Super

* Extend AST: RestElement, SequenceExpression, SwitchCase, SwitchStatement

* Extend AST: TaggedTemplateExpression, TemplateElement, TemplateLiteral, UnaryExpression, UpdateExpression, YieldExpression

* Extend AST: Properties in object patterns

* Finishing Fixes

* More fixes

* Run cargo fmt

* Handle directives

* Minor fixes

* Unicode support

* Fix optional chain expressions

* Adapt tests

* Do not run acorn anymore

* Update lockfile

* Minor fixes

* Move to rust folder

* Separate Rust Node bindings to allow adding WASM bindings in another workspace

* Make Napi build closer to how rs.napi works

* Fix path issues

* Disable browser build for now

* Add native package directories

* Refine runWithEcho

* Try initial steps with Github flow

* Trigger change

* Temporarily add yarn lockfile until we figured out if we get it to work with npm

* Use nightly toolchain

* Use default locations for Napi files to make things easier

* Adapt workflow

* Skip regular tests for now

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Test MacOS/WIndows

* Fix bootstrap build

* Skip tests

* Rename workflow

* Add additional tests

* Use zig differently

* Try to fix musl build

* Skip musl again for now

* Add publish to workflow

* 4.0.0-0

* Remove yarn lock again

* Fix coverage job

* Fix artefact handling

* Revert "4.0.0-0"

This reverts commit 734806f.

* 4.0.0-0

* Do not include default triples twice

* Fix native npm packages

* 4.0.0-1

* Add missing additional tests except browser tests

* Try to fix publish and tests

* 4.0.0-2

* Switch to faster utf-16 conversion

* 4.0.0-3

* Fix positioning algorithm when manually searching the code

* 4.0.0-4

* feat: Add WASM browser build (#5077)

* feat: add wasm browser build

* move wasm binding into a separate cargo workspace

* use imports replacing

* set the targetEnv option of wasm to browser in browser build

* add the wasm build to build command

* fix lint error and ci error

* add more comments to silence the linter

* big change

* trigger change

* run browser tests

* trigger change

* tweak wasm build on CI

* Increase build timeout

* Use shared string constants

* Extract fixed strings into constants

* Remove comment

* Get rid of dbg! calls

* Add lockfile hash to cargo cache

* Use if let over match in some cases

* Return the buffer of the syntax error in parse_ast

* Initial annotation support

* Put annotation types into string table

* Remove invalid annotations

* Support nested calls and new expressions

* Improve tree-shaking for annotations

* Adapt test

* Properly handle line-breaks, commas etc.

* Mark nested pure annotations as pure

* Remove sourcemap comments

* Handle function side effect annotatinos

* Remove old comment-handling code

* Increase timeout for browser tests

* Only skip the tests that still fail

* Run coverage again on CI

* Get the buffer of pos and message from the Syntax error

* Handle the lint errors from SWC

* Reenable tests about parse errors and adjust some relevant code

* Emit native.js to native.cjs

* Add cjs extension for native importee when bundling for ESM

* Change native importee with replace plugin and emit native.cjs in napi build

* Silence the linter for importing native

* Use node:path to resolve native binding files

* Add Node WASM files to Native packages for StackBlitz and similar use cases

* Unignore *.d.ts in the wasm dir

* 4.0.0-5

* Fix copy-wasm-node.js

* 4.0.0-6

* Remove .gitignore in wasm-node directory

* 4.0.0-7

* Include .cjs files when publishing rollup to npm

* 4.0.0-8

* Get readString function at runtime

* eslint: ignore wasm-node and set node extensions of import/resolver

* 4.0.0-9

* Change the required node to >=14.18.0 as before

* 4.0.0-10

* Prepare to fix ESM build

Still requires bug-fix on Rollup side for relative external dependencies
outside the ouput directory

* Update Rollup

* Enable ESM tests

* Re-enable another test

* Remove CJS eslint configuration

* Fix extension

* Fix test

* Fix entension for native import

* Support for publishing a completely separate package @rollup/wasm-node

* 4.0.0-11

* Fix publish for wasm node package

* Add AST verification to function tests

* Only use plugin arrays in form and function tests

* Fix spans in function tests

* Verify AST in form tests as well

* Try to publish @rollup/browser and fix publish-wasm-node-package.js

* 4.0.0-12

* Tweak publish scripts

* Fix importing wasm file in browser

* Parse code as unknown module type for greater compatibility

* Remove acorn options

* Tweak getReadStringFunction

* Fix browser tests

* 4.0.0-13

* Remove polyfills that are no longer needed in browser tests

* Convert to new import attributes AST format

* Rename assertions to attributes

* Deprecate externalImportAssertions in favor of externalImportAttributes

* Update SWC version

* Remove max-call-stack test

SWC is not capable of handling it and we cannot fix it

* Improve coverage

* re-enable repl-artefacts workflow

* Fix test

* Preload wasm file in docs

* docs: add functions to get full path of url

* Delete the build plugin handleImportMetaUrl

* Make 'npm install github/branch' work

* Verify there is a valid changelog entry before releasing

* Create release notes and comments from CI

Minor change to maybe trigger a CI run

* Fix RegExp

* 4.0.0-14

* Minor changes for a test PR (#5139)

* Fix RegExp use

* 4.0.0-15

* Do not rely on current branch to find the PR

* 4.0.0-16

* Fix how to determine git commit range

* 4.0.0-17

* Make sure we fetch all history on publish

* 4.0.0-18

* Add proper permissions

* 4.0.0-19

* Use Double quotation marks instead of Single quotation marks if concurrently scripts with flags

* Remove "engines" from native packages

* Update CONTRIBUTING.md

---------

Co-authored-by: XiaoPi <530257315@qq.com>

* Update tests

* Retrieve the code that was omitted during the merge

* Restore test coverage

* Update docs/plugin-development/index.md

Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>

---------

Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com>
Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
lukastaegert added a commit that referenced this pull request Sep 21, 2023
* Add native compilation for local NodeJS

* Link instead of copying for faster dev cycles for now

* Parse AST

* Convert first trivial AST to a buffer

* Use SWC for parsing

* Extend AST conversion

* Make AST more similar

* Fix line number issue by creating a new sourcemap (and thus compiler) for each run

* Collect timings

* Add code_length to struct

* Refine parsing

* Extend parsing

* Extend AST: ImportDefaultSpecifier, LiteralBoolean, LiteralNull, ExportDefaultExpression

* Extend AST: ImportNamespaceSpecifier, ExportAll

* Extend AST: BinaryExpression, ArrayPattern, ObjectPattern, AssignmentPatternProperty, ArrayLiteral, ImportExpression

* Extend AST: ConditionalExpression

* Extend AST: FunctionDeclaration, ClassDeclaration, ClassBody, ReturnStatement

* Extend AST: ObjectLiteral, KeyValueProperty

* Extend AST: ShorthandProperty

* Extend AST: GetterProperty, AssignmentExpression, NewExpression, FunctionExpression

* Extend AST: ThrowStatement

* Extend AST: ExportDefaultDeclaration

* Extend AST: AssignmentPattern, AwaitExpression, BreakStatement
Start sorting AST nodes

* Extend AST: TryStatement, CatchClause, ChainExpression

* Extend AST: ClassExpression, ContinueStatement, DebuggerStatement, DoWhileStatement, EmptyStatement

* Extend AST: ExportNamedDeclaration, ForInStatement, ForOfStatement, ForStatement

* Extend AST: IfStatement

* Extend AST: Import attributes

* Extend AST: Literal<RegExp>, Literal<BigInt>

* Extend AST: LogicalExpression

* Extend AST: MetaProperty

* Extend AST: Various Property types

* Extend AST: Progress on classes

* Extend AST: MethodDefinition, PropertyDefinition, PrivateName, ThisExpression

* Extend AST: StaticBlock, Super

* Extend AST: RestElement, SequenceExpression, SwitchCase, SwitchStatement

* Extend AST: TaggedTemplateExpression, TemplateElement, TemplateLiteral, UnaryExpression, UpdateExpression, YieldExpression

* Extend AST: Properties in object patterns

* Finishing Fixes

* More fixes

* Run cargo fmt

* Handle directives

* Minor fixes

* Unicode support

* Fix optional chain expressions

* Adapt tests

* Do not run acorn anymore

* Update lockfile

* Minor fixes

* Move to rust folder

* Separate Rust Node bindings to allow adding WASM bindings in another workspace

* Make Napi build closer to how rs.napi works

* Fix path issues

* Disable browser build for now

* Add native package directories

* Refine runWithEcho

* Try initial steps with Github flow

* Trigger change

* Temporarily add yarn lockfile until we figured out if we get it to work with npm

* Use nightly toolchain

* Use default locations for Napi files to make things easier

* Adapt workflow

* Skip regular tests for now

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Test MacOS/WIndows

* Fix bootstrap build

* Skip tests

* Rename workflow

* Add additional tests

* Use zig differently

* Try to fix musl build

* Skip musl again for now

* Add publish to workflow

* 4.0.0-0

* Remove yarn lock again

* Fix coverage job

* Fix artefact handling

* Revert "4.0.0-0"

This reverts commit 734806f.

* 4.0.0-0

* Do not include default triples twice

* Fix native npm packages

* 4.0.0-1

* Add missing additional tests except browser tests

* Try to fix publish and tests

* 4.0.0-2

* Switch to faster utf-16 conversion

* 4.0.0-3

* Fix positioning algorithm when manually searching the code

* 4.0.0-4

* feat: Add WASM browser build (#5077)

* feat: add wasm browser build

* move wasm binding into a separate cargo workspace

* use imports replacing

* set the targetEnv option of wasm to browser in browser build

* add the wasm build to build command

* fix lint error and ci error

* add more comments to silence the linter

* big change

* trigger change

* run browser tests

* trigger change

* tweak wasm build on CI

* Increase build timeout

* Use shared string constants

* Extract fixed strings into constants

* Remove comment

* Get rid of dbg! calls

* Add lockfile hash to cargo cache

* Use if let over match in some cases

* Return the buffer of the syntax error in parse_ast

* Initial annotation support

* Put annotation types into string table

* Remove invalid annotations

* Support nested calls and new expressions

* Improve tree-shaking for annotations

* Adapt test

* Properly handle line-breaks, commas etc.

* Mark nested pure annotations as pure

* Remove sourcemap comments

* Handle function side effect annotatinos

* Remove old comment-handling code

* Increase timeout for browser tests

* Only skip the tests that still fail

* Run coverage again on CI

* Get the buffer of pos and message from the Syntax error

* Handle the lint errors from SWC

* Reenable tests about parse errors and adjust some relevant code

* Emit native.js to native.cjs

* Add cjs extension for native importee when bundling for ESM

* Change native importee with replace plugin and emit native.cjs in napi build

* Silence the linter for importing native

* Use node:path to resolve native binding files

* Add Node WASM files to Native packages for StackBlitz and similar use cases

* Unignore *.d.ts in the wasm dir

* 4.0.0-5

* Fix copy-wasm-node.js

* 4.0.0-6

* Remove .gitignore in wasm-node directory

* 4.0.0-7

* Include .cjs files when publishing rollup to npm

* 4.0.0-8

* Get readString function at runtime

* eslint: ignore wasm-node and set node extensions of import/resolver

* 4.0.0-9

* Change the required node to >=14.18.0 as before

* 4.0.0-10

* Prepare to fix ESM build

Still requires bug-fix on Rollup side for relative external dependencies
outside the ouput directory

* Update Rollup

* Enable ESM tests

* Re-enable another test

* Remove CJS eslint configuration

* Fix extension

* Fix test

* Fix entension for native import

* Support for publishing a completely separate package @rollup/wasm-node

* 4.0.0-11

* Fix publish for wasm node package

* Add AST verification to function tests

* Only use plugin arrays in form and function tests

* Fix spans in function tests

* Verify AST in form tests as well

* Try to publish @rollup/browser and fix publish-wasm-node-package.js

* 4.0.0-12

* Tweak publish scripts

* Fix importing wasm file in browser

* Parse code as unknown module type for greater compatibility

* Remove acorn options

* Tweak getReadStringFunction

* Fix browser tests

* 4.0.0-13

* Remove polyfills that are no longer needed in browser tests

* Convert to new import attributes AST format

* Rename assertions to attributes

* Deprecate externalImportAssertions in favor of externalImportAttributes

* Update SWC version

* Remove max-call-stack test

SWC is not capable of handling it and we cannot fix it

* Improve coverage

* re-enable repl-artefacts workflow

* Fix test

* Preload wasm file in docs

* docs: add functions to get full path of url

* Delete the build plugin handleImportMetaUrl

* Make 'npm install github/branch' work

* Verify there is a valid changelog entry before releasing

* Create release notes and comments from CI

Minor change to maybe trigger a CI run

* Fix RegExp

* 4.0.0-14

* Minor changes for a test PR (#5139)

* Fix RegExp use

* 4.0.0-15

* Do not rely on current branch to find the PR

* 4.0.0-16

* Fix how to determine git commit range

* 4.0.0-17

* Make sure we fetch all history on publish

* 4.0.0-18

* Add proper permissions

* 4.0.0-19

* Use Double quotation marks instead of Single quotation marks if concurrently scripts with flags

* Remove "engines" from native packages

* Update CONTRIBUTING.md

---------

Co-authored-by: XiaoPi <530257315@qq.com>
lukastaegert added a commit that referenced this pull request Sep 21, 2023
* Set minimum Node version to 18

* Set the default of skipSelf to true

* [v4.0] Switch parser to SWC and introduce native/WASM code (#5073)

* Add native compilation for local NodeJS

* Link instead of copying for faster dev cycles for now

* Parse AST

* Convert first trivial AST to a buffer

* Use SWC for parsing

* Extend AST conversion

* Make AST more similar

* Fix line number issue by creating a new sourcemap (and thus compiler) for each run

* Collect timings

* Add code_length to struct

* Refine parsing

* Extend parsing

* Extend AST: ImportDefaultSpecifier, LiteralBoolean, LiteralNull, ExportDefaultExpression

* Extend AST: ImportNamespaceSpecifier, ExportAll

* Extend AST: BinaryExpression, ArrayPattern, ObjectPattern, AssignmentPatternProperty, ArrayLiteral, ImportExpression

* Extend AST: ConditionalExpression

* Extend AST: FunctionDeclaration, ClassDeclaration, ClassBody, ReturnStatement

* Extend AST: ObjectLiteral, KeyValueProperty

* Extend AST: ShorthandProperty

* Extend AST: GetterProperty, AssignmentExpression, NewExpression, FunctionExpression

* Extend AST: ThrowStatement

* Extend AST: ExportDefaultDeclaration

* Extend AST: AssignmentPattern, AwaitExpression, BreakStatement
Start sorting AST nodes

* Extend AST: TryStatement, CatchClause, ChainExpression

* Extend AST: ClassExpression, ContinueStatement, DebuggerStatement, DoWhileStatement, EmptyStatement

* Extend AST: ExportNamedDeclaration, ForInStatement, ForOfStatement, ForStatement

* Extend AST: IfStatement

* Extend AST: Import attributes

* Extend AST: Literal<RegExp>, Literal<BigInt>

* Extend AST: LogicalExpression

* Extend AST: MetaProperty

* Extend AST: Various Property types

* Extend AST: Progress on classes

* Extend AST: MethodDefinition, PropertyDefinition, PrivateName, ThisExpression

* Extend AST: StaticBlock, Super

* Extend AST: RestElement, SequenceExpression, SwitchCase, SwitchStatement

* Extend AST: TaggedTemplateExpression, TemplateElement, TemplateLiteral, UnaryExpression, UpdateExpression, YieldExpression

* Extend AST: Properties in object patterns

* Finishing Fixes

* More fixes

* Run cargo fmt

* Handle directives

* Minor fixes

* Unicode support

* Fix optional chain expressions

* Adapt tests

* Do not run acorn anymore

* Update lockfile

* Minor fixes

* Move to rust folder

* Separate Rust Node bindings to allow adding WASM bindings in another workspace

* Make Napi build closer to how rs.napi works

* Fix path issues

* Disable browser build for now

* Add native package directories

* Refine runWithEcho

* Try initial steps with Github flow

* Trigger change

* Temporarily add yarn lockfile until we figured out if we get it to work with npm

* Use nightly toolchain

* Use default locations for Napi files to make things easier

* Adapt workflow

* Skip regular tests for now

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Test MacOS/WIndows

* Fix bootstrap build

* Skip tests

* Rename workflow

* Add additional tests

* Use zig differently

* Try to fix musl build

* Skip musl again for now

* Add publish to workflow

* 4.0.0-0

* Remove yarn lock again

* Fix coverage job

* Fix artefact handling

* Revert "4.0.0-0"

This reverts commit 734806f.

* 4.0.0-0

* Do not include default triples twice

* Fix native npm packages

* 4.0.0-1

* Add missing additional tests except browser tests

* Try to fix publish and tests

* 4.0.0-2

* Switch to faster utf-16 conversion

* 4.0.0-3

* Fix positioning algorithm when manually searching the code

* 4.0.0-4

* feat: Add WASM browser build (#5077)

* feat: add wasm browser build

* move wasm binding into a separate cargo workspace

* use imports replacing

* set the targetEnv option of wasm to browser in browser build

* add the wasm build to build command

* fix lint error and ci error

* add more comments to silence the linter

* big change

* trigger change

* run browser tests

* trigger change

* tweak wasm build on CI

* Increase build timeout

* Use shared string constants

* Extract fixed strings into constants

* Remove comment

* Get rid of dbg! calls

* Add lockfile hash to cargo cache

* Use if let over match in some cases

* Return the buffer of the syntax error in parse_ast

* Initial annotation support

* Put annotation types into string table

* Remove invalid annotations

* Support nested calls and new expressions

* Improve tree-shaking for annotations

* Adapt test

* Properly handle line-breaks, commas etc.

* Mark nested pure annotations as pure

* Remove sourcemap comments

* Handle function side effect annotatinos

* Remove old comment-handling code

* Increase timeout for browser tests

* Only skip the tests that still fail

* Run coverage again on CI

* Get the buffer of pos and message from the Syntax error

* Handle the lint errors from SWC

* Reenable tests about parse errors and adjust some relevant code

* Emit native.js to native.cjs

* Add cjs extension for native importee when bundling for ESM

* Change native importee with replace plugin and emit native.cjs in napi build

* Silence the linter for importing native

* Use node:path to resolve native binding files

* Add Node WASM files to Native packages for StackBlitz and similar use cases

* Unignore *.d.ts in the wasm dir

* 4.0.0-5

* Fix copy-wasm-node.js

* 4.0.0-6

* Remove .gitignore in wasm-node directory

* 4.0.0-7

* Include .cjs files when publishing rollup to npm

* 4.0.0-8

* Get readString function at runtime

* eslint: ignore wasm-node and set node extensions of import/resolver

* 4.0.0-9

* Change the required node to >=14.18.0 as before

* 4.0.0-10

* Prepare to fix ESM build

Still requires bug-fix on Rollup side for relative external dependencies
outside the ouput directory

* Update Rollup

* Enable ESM tests

* Re-enable another test

* Remove CJS eslint configuration

* Fix extension

* Fix test

* Fix entension for native import

* Support for publishing a completely separate package @rollup/wasm-node

* 4.0.0-11

* Fix publish for wasm node package

* Add AST verification to function tests

* Only use plugin arrays in form and function tests

* Fix spans in function tests

* Verify AST in form tests as well

* Try to publish @rollup/browser and fix publish-wasm-node-package.js

* 4.0.0-12

* Tweak publish scripts

* Fix importing wasm file in browser

* Parse code as unknown module type for greater compatibility

* Remove acorn options

* Tweak getReadStringFunction

* Fix browser tests

* 4.0.0-13

* Remove polyfills that are no longer needed in browser tests

* Convert to new import attributes AST format

* Rename assertions to attributes

* Deprecate externalImportAssertions in favor of externalImportAttributes

* Update SWC version

* Remove max-call-stack test

SWC is not capable of handling it and we cannot fix it

* Improve coverage

* re-enable repl-artefacts workflow

* Fix test

* Preload wasm file in docs

* docs: add functions to get full path of url

* Delete the build plugin handleImportMetaUrl

* Make 'npm install github/branch' work

* Verify there is a valid changelog entry before releasing

* Create release notes and comments from CI

Minor change to maybe trigger a CI run

* Fix RegExp

* 4.0.0-14

* Minor changes for a test PR (#5139)

* Fix RegExp use

* 4.0.0-15

* Do not rely on current branch to find the PR

* 4.0.0-16

* Fix how to determine git commit range

* 4.0.0-17

* Make sure we fetch all history on publish

* 4.0.0-18

* Add proper permissions

* 4.0.0-19

* Use Double quotation marks instead of Single quotation marks if concurrently scripts with flags

* Remove "engines" from native packages

* Update CONTRIBUTING.md

---------

Co-authored-by: XiaoPi <530257315@qq.com>

* Update tests

* Retrieve the code that was omitted during the merge

* Restore test coverage

* Update docs/plugin-development/index.md

Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>

---------

Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com>
Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
lukastaegert added a commit that referenced this pull request Sep 24, 2023
* Add native compilation for local NodeJS

* Link instead of copying for faster dev cycles for now

* Parse AST

* Convert first trivial AST to a buffer

* Use SWC for parsing

* Extend AST conversion

* Make AST more similar

* Fix line number issue by creating a new sourcemap (and thus compiler) for each run

* Collect timings

* Add code_length to struct

* Refine parsing

* Extend parsing

* Extend AST: ImportDefaultSpecifier, LiteralBoolean, LiteralNull, ExportDefaultExpression

* Extend AST: ImportNamespaceSpecifier, ExportAll

* Extend AST: BinaryExpression, ArrayPattern, ObjectPattern, AssignmentPatternProperty, ArrayLiteral, ImportExpression

* Extend AST: ConditionalExpression

* Extend AST: FunctionDeclaration, ClassDeclaration, ClassBody, ReturnStatement

* Extend AST: ObjectLiteral, KeyValueProperty

* Extend AST: ShorthandProperty

* Extend AST: GetterProperty, AssignmentExpression, NewExpression, FunctionExpression

* Extend AST: ThrowStatement

* Extend AST: ExportDefaultDeclaration

* Extend AST: AssignmentPattern, AwaitExpression, BreakStatement
Start sorting AST nodes

* Extend AST: TryStatement, CatchClause, ChainExpression

* Extend AST: ClassExpression, ContinueStatement, DebuggerStatement, DoWhileStatement, EmptyStatement

* Extend AST: ExportNamedDeclaration, ForInStatement, ForOfStatement, ForStatement

* Extend AST: IfStatement

* Extend AST: Import attributes

* Extend AST: Literal<RegExp>, Literal<BigInt>

* Extend AST: LogicalExpression

* Extend AST: MetaProperty

* Extend AST: Various Property types

* Extend AST: Progress on classes

* Extend AST: MethodDefinition, PropertyDefinition, PrivateName, ThisExpression

* Extend AST: StaticBlock, Super

* Extend AST: RestElement, SequenceExpression, SwitchCase, SwitchStatement

* Extend AST: TaggedTemplateExpression, TemplateElement, TemplateLiteral, UnaryExpression, UpdateExpression, YieldExpression

* Extend AST: Properties in object patterns

* Finishing Fixes

* More fixes

* Run cargo fmt

* Handle directives

* Minor fixes

* Unicode support

* Fix optional chain expressions

* Adapt tests

* Do not run acorn anymore

* Update lockfile

* Minor fixes

* Move to rust folder

* Separate Rust Node bindings to allow adding WASM bindings in another workspace

* Make Napi build closer to how rs.napi works

* Fix path issues

* Disable browser build for now

* Add native package directories

* Refine runWithEcho

* Try initial steps with Github flow

* Trigger change

* Temporarily add yarn lockfile until we figured out if we get it to work with npm

* Use nightly toolchain

* Use default locations for Napi files to make things easier

* Adapt workflow

* Skip regular tests for now

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Test MacOS/WIndows

* Fix bootstrap build

* Skip tests

* Rename workflow

* Add additional tests

* Use zig differently

* Try to fix musl build

* Skip musl again for now

* Add publish to workflow

* 4.0.0-0

* Remove yarn lock again

* Fix coverage job

* Fix artefact handling

* Revert "4.0.0-0"

This reverts commit 734806f.

* 4.0.0-0

* Do not include default triples twice

* Fix native npm packages

* 4.0.0-1

* Add missing additional tests except browser tests

* Try to fix publish and tests

* 4.0.0-2

* Switch to faster utf-16 conversion

* 4.0.0-3

* Fix positioning algorithm when manually searching the code

* 4.0.0-4

* feat: Add WASM browser build (#5077)

* feat: add wasm browser build

* move wasm binding into a separate cargo workspace

* use imports replacing

* set the targetEnv option of wasm to browser in browser build

* add the wasm build to build command

* fix lint error and ci error

* add more comments to silence the linter

* big change

* trigger change

* run browser tests

* trigger change

* tweak wasm build on CI

* Increase build timeout

* Use shared string constants

* Extract fixed strings into constants

* Remove comment

* Get rid of dbg! calls

* Add lockfile hash to cargo cache

* Use if let over match in some cases

* Return the buffer of the syntax error in parse_ast

* Initial annotation support

* Put annotation types into string table

* Remove invalid annotations

* Support nested calls and new expressions

* Improve tree-shaking for annotations

* Adapt test

* Properly handle line-breaks, commas etc.

* Mark nested pure annotations as pure

* Remove sourcemap comments

* Handle function side effect annotatinos

* Remove old comment-handling code

* Increase timeout for browser tests

* Only skip the tests that still fail

* Run coverage again on CI

* Get the buffer of pos and message from the Syntax error

* Handle the lint errors from SWC

* Reenable tests about parse errors and adjust some relevant code

* Emit native.js to native.cjs

* Add cjs extension for native importee when bundling for ESM

* Change native importee with replace plugin and emit native.cjs in napi build

* Silence the linter for importing native

* Use node:path to resolve native binding files

* Add Node WASM files to Native packages for StackBlitz and similar use cases

* Unignore *.d.ts in the wasm dir

* 4.0.0-5

* Fix copy-wasm-node.js

* 4.0.0-6

* Remove .gitignore in wasm-node directory

* 4.0.0-7

* Include .cjs files when publishing rollup to npm

* 4.0.0-8

* Get readString function at runtime

* eslint: ignore wasm-node and set node extensions of import/resolver

* 4.0.0-9

* Change the required node to >=14.18.0 as before

* 4.0.0-10

* Prepare to fix ESM build

Still requires bug-fix on Rollup side for relative external dependencies
outside the ouput directory

* Update Rollup

* Enable ESM tests

* Re-enable another test

* Remove CJS eslint configuration

* Fix extension

* Fix test

* Fix entension for native import

* Support for publishing a completely separate package @rollup/wasm-node

* 4.0.0-11

* Fix publish for wasm node package

* Add AST verification to function tests

* Only use plugin arrays in form and function tests

* Fix spans in function tests

* Verify AST in form tests as well

* Try to publish @rollup/browser and fix publish-wasm-node-package.js

* 4.0.0-12

* Tweak publish scripts

* Fix importing wasm file in browser

* Parse code as unknown module type for greater compatibility

* Remove acorn options

* Tweak getReadStringFunction

* Fix browser tests

* 4.0.0-13

* Remove polyfills that are no longer needed in browser tests

* Convert to new import attributes AST format

* Rename assertions to attributes

* Deprecate externalImportAssertions in favor of externalImportAttributes

* Update SWC version

* Remove max-call-stack test

SWC is not capable of handling it and we cannot fix it

* Improve coverage

* re-enable repl-artefacts workflow

* Fix test

* Preload wasm file in docs

* docs: add functions to get full path of url

* Delete the build plugin handleImportMetaUrl

* Make 'npm install github/branch' work

* Verify there is a valid changelog entry before releasing

* Create release notes and comments from CI

Minor change to maybe trigger a CI run

* Fix RegExp

* 4.0.0-14

* Minor changes for a test PR (#5139)

* Fix RegExp use

* 4.0.0-15

* Do not rely on current branch to find the PR

* 4.0.0-16

* Fix how to determine git commit range

* 4.0.0-17

* Make sure we fetch all history on publish

* 4.0.0-18

* Add proper permissions

* 4.0.0-19

* Use Double quotation marks instead of Single quotation marks if concurrently scripts with flags

* Remove "engines" from native packages

* Update CONTRIBUTING.md

---------

Co-authored-by: XiaoPi <530257315@qq.com>
lukastaegert added a commit that referenced this pull request Sep 24, 2023
* Set minimum Node version to 18

* Set the default of skipSelf to true

* [v4.0] Switch parser to SWC and introduce native/WASM code (#5073)

* Add native compilation for local NodeJS

* Link instead of copying for faster dev cycles for now

* Parse AST

* Convert first trivial AST to a buffer

* Use SWC for parsing

* Extend AST conversion

* Make AST more similar

* Fix line number issue by creating a new sourcemap (and thus compiler) for each run

* Collect timings

* Add code_length to struct

* Refine parsing

* Extend parsing

* Extend AST: ImportDefaultSpecifier, LiteralBoolean, LiteralNull, ExportDefaultExpression

* Extend AST: ImportNamespaceSpecifier, ExportAll

* Extend AST: BinaryExpression, ArrayPattern, ObjectPattern, AssignmentPatternProperty, ArrayLiteral, ImportExpression

* Extend AST: ConditionalExpression

* Extend AST: FunctionDeclaration, ClassDeclaration, ClassBody, ReturnStatement

* Extend AST: ObjectLiteral, KeyValueProperty

* Extend AST: ShorthandProperty

* Extend AST: GetterProperty, AssignmentExpression, NewExpression, FunctionExpression

* Extend AST: ThrowStatement

* Extend AST: ExportDefaultDeclaration

* Extend AST: AssignmentPattern, AwaitExpression, BreakStatement
Start sorting AST nodes

* Extend AST: TryStatement, CatchClause, ChainExpression

* Extend AST: ClassExpression, ContinueStatement, DebuggerStatement, DoWhileStatement, EmptyStatement

* Extend AST: ExportNamedDeclaration, ForInStatement, ForOfStatement, ForStatement

* Extend AST: IfStatement

* Extend AST: Import attributes

* Extend AST: Literal<RegExp>, Literal<BigInt>

* Extend AST: LogicalExpression

* Extend AST: MetaProperty

* Extend AST: Various Property types

* Extend AST: Progress on classes

* Extend AST: MethodDefinition, PropertyDefinition, PrivateName, ThisExpression

* Extend AST: StaticBlock, Super

* Extend AST: RestElement, SequenceExpression, SwitchCase, SwitchStatement

* Extend AST: TaggedTemplateExpression, TemplateElement, TemplateLiteral, UnaryExpression, UpdateExpression, YieldExpression

* Extend AST: Properties in object patterns

* Finishing Fixes

* More fixes

* Run cargo fmt

* Handle directives

* Minor fixes

* Unicode support

* Fix optional chain expressions

* Adapt tests

* Do not run acorn anymore

* Update lockfile

* Minor fixes

* Move to rust folder

* Separate Rust Node bindings to allow adding WASM bindings in another workspace

* Make Napi build closer to how rs.napi works

* Fix path issues

* Disable browser build for now

* Add native package directories

* Refine runWithEcho

* Try initial steps with Github flow

* Trigger change

* Temporarily add yarn lockfile until we figured out if we get it to work with npm

* Use nightly toolchain

* Use default locations for Napi files to make things easier

* Adapt workflow

* Skip regular tests for now

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Test MacOS/WIndows

* Fix bootstrap build

* Skip tests

* Rename workflow

* Add additional tests

* Use zig differently

* Try to fix musl build

* Skip musl again for now

* Add publish to workflow

* 4.0.0-0

* Remove yarn lock again

* Fix coverage job

* Fix artefact handling

* Revert "4.0.0-0"

This reverts commit 734806f.

* 4.0.0-0

* Do not include default triples twice

* Fix native npm packages

* 4.0.0-1

* Add missing additional tests except browser tests

* Try to fix publish and tests

* 4.0.0-2

* Switch to faster utf-16 conversion

* 4.0.0-3

* Fix positioning algorithm when manually searching the code

* 4.0.0-4

* feat: Add WASM browser build (#5077)

* feat: add wasm browser build

* move wasm binding into a separate cargo workspace

* use imports replacing

* set the targetEnv option of wasm to browser in browser build

* add the wasm build to build command

* fix lint error and ci error

* add more comments to silence the linter

* big change

* trigger change

* run browser tests

* trigger change

* tweak wasm build on CI

* Increase build timeout

* Use shared string constants

* Extract fixed strings into constants

* Remove comment

* Get rid of dbg! calls

* Add lockfile hash to cargo cache

* Use if let over match in some cases

* Return the buffer of the syntax error in parse_ast

* Initial annotation support

* Put annotation types into string table

* Remove invalid annotations

* Support nested calls and new expressions

* Improve tree-shaking for annotations

* Adapt test

* Properly handle line-breaks, commas etc.

* Mark nested pure annotations as pure

* Remove sourcemap comments

* Handle function side effect annotatinos

* Remove old comment-handling code

* Increase timeout for browser tests

* Only skip the tests that still fail

* Run coverage again on CI

* Get the buffer of pos and message from the Syntax error

* Handle the lint errors from SWC

* Reenable tests about parse errors and adjust some relevant code

* Emit native.js to native.cjs

* Add cjs extension for native importee when bundling for ESM

* Change native importee with replace plugin and emit native.cjs in napi build

* Silence the linter for importing native

* Use node:path to resolve native binding files

* Add Node WASM files to Native packages for StackBlitz and similar use cases

* Unignore *.d.ts in the wasm dir

* 4.0.0-5

* Fix copy-wasm-node.js

* 4.0.0-6

* Remove .gitignore in wasm-node directory

* 4.0.0-7

* Include .cjs files when publishing rollup to npm

* 4.0.0-8

* Get readString function at runtime

* eslint: ignore wasm-node and set node extensions of import/resolver

* 4.0.0-9

* Change the required node to >=14.18.0 as before

* 4.0.0-10

* Prepare to fix ESM build

Still requires bug-fix on Rollup side for relative external dependencies
outside the ouput directory

* Update Rollup

* Enable ESM tests

* Re-enable another test

* Remove CJS eslint configuration

* Fix extension

* Fix test

* Fix entension for native import

* Support for publishing a completely separate package @rollup/wasm-node

* 4.0.0-11

* Fix publish for wasm node package

* Add AST verification to function tests

* Only use plugin arrays in form and function tests

* Fix spans in function tests

* Verify AST in form tests as well

* Try to publish @rollup/browser and fix publish-wasm-node-package.js

* 4.0.0-12

* Tweak publish scripts

* Fix importing wasm file in browser

* Parse code as unknown module type for greater compatibility

* Remove acorn options

* Tweak getReadStringFunction

* Fix browser tests

* 4.0.0-13

* Remove polyfills that are no longer needed in browser tests

* Convert to new import attributes AST format

* Rename assertions to attributes

* Deprecate externalImportAssertions in favor of externalImportAttributes

* Update SWC version

* Remove max-call-stack test

SWC is not capable of handling it and we cannot fix it

* Improve coverage

* re-enable repl-artefacts workflow

* Fix test

* Preload wasm file in docs

* docs: add functions to get full path of url

* Delete the build plugin handleImportMetaUrl

* Make 'npm install github/branch' work

* Verify there is a valid changelog entry before releasing

* Create release notes and comments from CI

Minor change to maybe trigger a CI run

* Fix RegExp

* 4.0.0-14

* Minor changes for a test PR (#5139)

* Fix RegExp use

* 4.0.0-15

* Do not rely on current branch to find the PR

* 4.0.0-16

* Fix how to determine git commit range

* 4.0.0-17

* Make sure we fetch all history on publish

* 4.0.0-18

* Add proper permissions

* 4.0.0-19

* Use Double quotation marks instead of Single quotation marks if concurrently scripts with flags

* Remove "engines" from native packages

* Update CONTRIBUTING.md

---------

Co-authored-by: XiaoPi <530257315@qq.com>

* Update tests

* Retrieve the code that was omitted during the merge

* Restore test coverage

* Update docs/plugin-development/index.md

Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>

---------

Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com>
Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
@github-actions
Copy link

This PR has been released as part of rollup@4.0.0-20. Note that this is a pre-release, so to test it, you need to install Rollup via npm install rollup@4.0.0-20 or npm install rollup@beta. It will likely become part of a regular release later.

@github-actions
Copy link

This PR has been released as part of rollup@4.0.0-21. Note that this is a pre-release, so to test it, you need to install Rollup via npm install rollup@4.0.0-21 or npm install rollup@beta. It will likely become part of a regular release later.

@github-actions
Copy link

This PR has been released as part of rollup@4.0.0-22. Note that this is a pre-release, so to test it, you need to install Rollup via npm install rollup@4.0.0-22 or npm install rollup@beta. It will likely become part of a regular release later.

@github-actions
Copy link

This PR has been released as part of rollup@4.0.0-23. Note that this is a pre-release, so to test it, you need to install Rollup via npm install rollup@4.0.0-23 or npm install rollup@beta. It will likely become part of a regular release later.

lukastaegert added a commit that referenced this pull request Sep 29, 2023
* Add native compilation for local NodeJS

* Link instead of copying for faster dev cycles for now

* Parse AST

* Convert first trivial AST to a buffer

* Use SWC for parsing

* Extend AST conversion

* Make AST more similar

* Fix line number issue by creating a new sourcemap (and thus compiler) for each run

* Collect timings

* Add code_length to struct

* Refine parsing

* Extend parsing

* Extend AST: ImportDefaultSpecifier, LiteralBoolean, LiteralNull, ExportDefaultExpression

* Extend AST: ImportNamespaceSpecifier, ExportAll

* Extend AST: BinaryExpression, ArrayPattern, ObjectPattern, AssignmentPatternProperty, ArrayLiteral, ImportExpression

* Extend AST: ConditionalExpression

* Extend AST: FunctionDeclaration, ClassDeclaration, ClassBody, ReturnStatement

* Extend AST: ObjectLiteral, KeyValueProperty

* Extend AST: ShorthandProperty

* Extend AST: GetterProperty, AssignmentExpression, NewExpression, FunctionExpression

* Extend AST: ThrowStatement

* Extend AST: ExportDefaultDeclaration

* Extend AST: AssignmentPattern, AwaitExpression, BreakStatement
Start sorting AST nodes

* Extend AST: TryStatement, CatchClause, ChainExpression

* Extend AST: ClassExpression, ContinueStatement, DebuggerStatement, DoWhileStatement, EmptyStatement

* Extend AST: ExportNamedDeclaration, ForInStatement, ForOfStatement, ForStatement

* Extend AST: IfStatement

* Extend AST: Import attributes

* Extend AST: Literal<RegExp>, Literal<BigInt>

* Extend AST: LogicalExpression

* Extend AST: MetaProperty

* Extend AST: Various Property types

* Extend AST: Progress on classes

* Extend AST: MethodDefinition, PropertyDefinition, PrivateName, ThisExpression

* Extend AST: StaticBlock, Super

* Extend AST: RestElement, SequenceExpression, SwitchCase, SwitchStatement

* Extend AST: TaggedTemplateExpression, TemplateElement, TemplateLiteral, UnaryExpression, UpdateExpression, YieldExpression

* Extend AST: Properties in object patterns

* Finishing Fixes

* More fixes

* Run cargo fmt

* Handle directives

* Minor fixes

* Unicode support

* Fix optional chain expressions

* Adapt tests

* Do not run acorn anymore

* Update lockfile

* Minor fixes

* Move to rust folder

* Separate Rust Node bindings to allow adding WASM bindings in another workspace

* Make Napi build closer to how rs.napi works

* Fix path issues

* Disable browser build for now

* Add native package directories

* Refine runWithEcho

* Try initial steps with Github flow

* Trigger change

* Temporarily add yarn lockfile until we figured out if we get it to work with npm

* Use nightly toolchain

* Use default locations for Napi files to make things easier

* Adapt workflow

* Skip regular tests for now

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Test MacOS/WIndows

* Fix bootstrap build

* Skip tests

* Rename workflow

* Add additional tests

* Use zig differently

* Try to fix musl build

* Skip musl again for now

* Add publish to workflow

* 4.0.0-0

* Remove yarn lock again

* Fix coverage job

* Fix artefact handling

* Revert "4.0.0-0"

This reverts commit 734806f.

* 4.0.0-0

* Do not include default triples twice

* Fix native npm packages

* 4.0.0-1

* Add missing additional tests except browser tests

* Try to fix publish and tests

* 4.0.0-2

* Switch to faster utf-16 conversion

* 4.0.0-3

* Fix positioning algorithm when manually searching the code

* 4.0.0-4

* feat: Add WASM browser build (#5077)

* feat: add wasm browser build

* move wasm binding into a separate cargo workspace

* use imports replacing

* set the targetEnv option of wasm to browser in browser build

* add the wasm build to build command

* fix lint error and ci error

* add more comments to silence the linter

* big change

* trigger change

* run browser tests

* trigger change

* tweak wasm build on CI

* Increase build timeout

* Use shared string constants

* Extract fixed strings into constants

* Remove comment

* Get rid of dbg! calls

* Add lockfile hash to cargo cache

* Use if let over match in some cases

* Return the buffer of the syntax error in parse_ast

* Initial annotation support

* Put annotation types into string table

* Remove invalid annotations

* Support nested calls and new expressions

* Improve tree-shaking for annotations

* Adapt test

* Properly handle line-breaks, commas etc.

* Mark nested pure annotations as pure

* Remove sourcemap comments

* Handle function side effect annotatinos

* Remove old comment-handling code

* Increase timeout for browser tests

* Only skip the tests that still fail

* Run coverage again on CI

* Get the buffer of pos and message from the Syntax error

* Handle the lint errors from SWC

* Reenable tests about parse errors and adjust some relevant code

* Emit native.js to native.cjs

* Add cjs extension for native importee when bundling for ESM

* Change native importee with replace plugin and emit native.cjs in napi build

* Silence the linter for importing native

* Use node:path to resolve native binding files

* Add Node WASM files to Native packages for StackBlitz and similar use cases

* Unignore *.d.ts in the wasm dir

* 4.0.0-5

* Fix copy-wasm-node.js

* 4.0.0-6

* Remove .gitignore in wasm-node directory

* 4.0.0-7

* Include .cjs files when publishing rollup to npm

* 4.0.0-8

* Get readString function at runtime

* eslint: ignore wasm-node and set node extensions of import/resolver

* 4.0.0-9

* Change the required node to >=14.18.0 as before

* 4.0.0-10

* Prepare to fix ESM build

Still requires bug-fix on Rollup side for relative external dependencies
outside the ouput directory

* Update Rollup

* Enable ESM tests

* Re-enable another test

* Remove CJS eslint configuration

* Fix extension

* Fix test

* Fix entension for native import

* Support for publishing a completely separate package @rollup/wasm-node

* 4.0.0-11

* Fix publish for wasm node package

* Add AST verification to function tests

* Only use plugin arrays in form and function tests

* Fix spans in function tests

* Verify AST in form tests as well

* Try to publish @rollup/browser and fix publish-wasm-node-package.js

* 4.0.0-12

* Tweak publish scripts

* Fix importing wasm file in browser

* Parse code as unknown module type for greater compatibility

* Remove acorn options

* Tweak getReadStringFunction

* Fix browser tests

* 4.0.0-13

* Remove polyfills that are no longer needed in browser tests

* Convert to new import attributes AST format

* Rename assertions to attributes

* Deprecate externalImportAssertions in favor of externalImportAttributes

* Update SWC version

* Remove max-call-stack test

SWC is not capable of handling it and we cannot fix it

* Improve coverage

* re-enable repl-artefacts workflow

* Fix test

* Preload wasm file in docs

* docs: add functions to get full path of url

* Delete the build plugin handleImportMetaUrl

* Make 'npm install github/branch' work

* Verify there is a valid changelog entry before releasing

* Create release notes and comments from CI

Minor change to maybe trigger a CI run

* Fix RegExp

* 4.0.0-14

* Minor changes for a test PR (#5139)

* Fix RegExp use

* 4.0.0-15

* Do not rely on current branch to find the PR

* 4.0.0-16

* Fix how to determine git commit range

* 4.0.0-17

* Make sure we fetch all history on publish

* 4.0.0-18

* Add proper permissions

* 4.0.0-19

* Use Double quotation marks instead of Single quotation marks if concurrently scripts with flags

* Remove "engines" from native packages

* Update CONTRIBUTING.md

---------

Co-authored-by: XiaoPi <530257315@qq.com>
lukastaegert added a commit that referenced this pull request Sep 29, 2023
* Set minimum Node version to 18

* Set the default of skipSelf to true

* [v4.0] Switch parser to SWC and introduce native/WASM code (#5073)

* Add native compilation for local NodeJS

* Link instead of copying for faster dev cycles for now

* Parse AST

* Convert first trivial AST to a buffer

* Use SWC for parsing

* Extend AST conversion

* Make AST more similar

* Fix line number issue by creating a new sourcemap (and thus compiler) for each run

* Collect timings

* Add code_length to struct

* Refine parsing

* Extend parsing

* Extend AST: ImportDefaultSpecifier, LiteralBoolean, LiteralNull, ExportDefaultExpression

* Extend AST: ImportNamespaceSpecifier, ExportAll

* Extend AST: BinaryExpression, ArrayPattern, ObjectPattern, AssignmentPatternProperty, ArrayLiteral, ImportExpression

* Extend AST: ConditionalExpression

* Extend AST: FunctionDeclaration, ClassDeclaration, ClassBody, ReturnStatement

* Extend AST: ObjectLiteral, KeyValueProperty

* Extend AST: ShorthandProperty

* Extend AST: GetterProperty, AssignmentExpression, NewExpression, FunctionExpression

* Extend AST: ThrowStatement

* Extend AST: ExportDefaultDeclaration

* Extend AST: AssignmentPattern, AwaitExpression, BreakStatement
Start sorting AST nodes

* Extend AST: TryStatement, CatchClause, ChainExpression

* Extend AST: ClassExpression, ContinueStatement, DebuggerStatement, DoWhileStatement, EmptyStatement

* Extend AST: ExportNamedDeclaration, ForInStatement, ForOfStatement, ForStatement

* Extend AST: IfStatement

* Extend AST: Import attributes

* Extend AST: Literal<RegExp>, Literal<BigInt>

* Extend AST: LogicalExpression

* Extend AST: MetaProperty

* Extend AST: Various Property types

* Extend AST: Progress on classes

* Extend AST: MethodDefinition, PropertyDefinition, PrivateName, ThisExpression

* Extend AST: StaticBlock, Super

* Extend AST: RestElement, SequenceExpression, SwitchCase, SwitchStatement

* Extend AST: TaggedTemplateExpression, TemplateElement, TemplateLiteral, UnaryExpression, UpdateExpression, YieldExpression

* Extend AST: Properties in object patterns

* Finishing Fixes

* More fixes

* Run cargo fmt

* Handle directives

* Minor fixes

* Unicode support

* Fix optional chain expressions

* Adapt tests

* Do not run acorn anymore

* Update lockfile

* Minor fixes

* Move to rust folder

* Separate Rust Node bindings to allow adding WASM bindings in another workspace

* Make Napi build closer to how rs.napi works

* Fix path issues

* Disable browser build for now

* Add native package directories

* Refine runWithEcho

* Try initial steps with Github flow

* Trigger change

* Temporarily add yarn lockfile until we figured out if we get it to work with npm

* Use nightly toolchain

* Use default locations for Napi files to make things easier

* Adapt workflow

* Skip regular tests for now

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Test MacOS/WIndows

* Fix bootstrap build

* Skip tests

* Rename workflow

* Add additional tests

* Use zig differently

* Try to fix musl build

* Skip musl again for now

* Add publish to workflow

* 4.0.0-0

* Remove yarn lock again

* Fix coverage job

* Fix artefact handling

* Revert "4.0.0-0"

This reverts commit 734806f.

* 4.0.0-0

* Do not include default triples twice

* Fix native npm packages

* 4.0.0-1

* Add missing additional tests except browser tests

* Try to fix publish and tests

* 4.0.0-2

* Switch to faster utf-16 conversion

* 4.0.0-3

* Fix positioning algorithm when manually searching the code

* 4.0.0-4

* feat: Add WASM browser build (#5077)

* feat: add wasm browser build

* move wasm binding into a separate cargo workspace

* use imports replacing

* set the targetEnv option of wasm to browser in browser build

* add the wasm build to build command

* fix lint error and ci error

* add more comments to silence the linter

* big change

* trigger change

* run browser tests

* trigger change

* tweak wasm build on CI

* Increase build timeout

* Use shared string constants

* Extract fixed strings into constants

* Remove comment

* Get rid of dbg! calls

* Add lockfile hash to cargo cache

* Use if let over match in some cases

* Return the buffer of the syntax error in parse_ast

* Initial annotation support

* Put annotation types into string table

* Remove invalid annotations

* Support nested calls and new expressions

* Improve tree-shaking for annotations

* Adapt test

* Properly handle line-breaks, commas etc.

* Mark nested pure annotations as pure

* Remove sourcemap comments

* Handle function side effect annotatinos

* Remove old comment-handling code

* Increase timeout for browser tests

* Only skip the tests that still fail

* Run coverage again on CI

* Get the buffer of pos and message from the Syntax error

* Handle the lint errors from SWC

* Reenable tests about parse errors and adjust some relevant code

* Emit native.js to native.cjs

* Add cjs extension for native importee when bundling for ESM

* Change native importee with replace plugin and emit native.cjs in napi build

* Silence the linter for importing native

* Use node:path to resolve native binding files

* Add Node WASM files to Native packages for StackBlitz and similar use cases

* Unignore *.d.ts in the wasm dir

* 4.0.0-5

* Fix copy-wasm-node.js

* 4.0.0-6

* Remove .gitignore in wasm-node directory

* 4.0.0-7

* Include .cjs files when publishing rollup to npm

* 4.0.0-8

* Get readString function at runtime

* eslint: ignore wasm-node and set node extensions of import/resolver

* 4.0.0-9

* Change the required node to >=14.18.0 as before

* 4.0.0-10

* Prepare to fix ESM build

Still requires bug-fix on Rollup side for relative external dependencies
outside the ouput directory

* Update Rollup

* Enable ESM tests

* Re-enable another test

* Remove CJS eslint configuration

* Fix extension

* Fix test

* Fix entension for native import

* Support for publishing a completely separate package @rollup/wasm-node

* 4.0.0-11

* Fix publish for wasm node package

* Add AST verification to function tests

* Only use plugin arrays in form and function tests

* Fix spans in function tests

* Verify AST in form tests as well

* Try to publish @rollup/browser and fix publish-wasm-node-package.js

* 4.0.0-12

* Tweak publish scripts

* Fix importing wasm file in browser

* Parse code as unknown module type for greater compatibility

* Remove acorn options

* Tweak getReadStringFunction

* Fix browser tests

* 4.0.0-13

* Remove polyfills that are no longer needed in browser tests

* Convert to new import attributes AST format

* Rename assertions to attributes

* Deprecate externalImportAssertions in favor of externalImportAttributes

* Update SWC version

* Remove max-call-stack test

SWC is not capable of handling it and we cannot fix it

* Improve coverage

* re-enable repl-artefacts workflow

* Fix test

* Preload wasm file in docs

* docs: add functions to get full path of url

* Delete the build plugin handleImportMetaUrl

* Make 'npm install github/branch' work

* Verify there is a valid changelog entry before releasing

* Create release notes and comments from CI

Minor change to maybe trigger a CI run

* Fix RegExp

* 4.0.0-14

* Minor changes for a test PR (#5139)

* Fix RegExp use

* 4.0.0-15

* Do not rely on current branch to find the PR

* 4.0.0-16

* Fix how to determine git commit range

* 4.0.0-17

* Make sure we fetch all history on publish

* 4.0.0-18

* Add proper permissions

* 4.0.0-19

* Use Double quotation marks instead of Single quotation marks if concurrently scripts with flags

* Remove "engines" from native packages

* Update CONTRIBUTING.md

---------

Co-authored-by: XiaoPi <530257315@qq.com>

* Update tests

* Retrieve the code that was omitted during the merge

* Restore test coverage

* Update docs/plugin-development/index.md

Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>

---------

Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com>
Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
@github-actions
Copy link

github-actions bot commented Oct 3, 2023

This PR has been released as part of rollup@4.0.0-24. Note that this is a pre-release, so to test it, you need to install Rollup via npm install rollup@4.0.0-24 or npm install rollup@beta. It will likely become part of a regular release later.

@lukastaegert lukastaegert mentioned this pull request Oct 5, 2023
9 tasks
@github-actions
Copy link

github-actions bot commented Oct 5, 2023

This PR has been released as part of rollup@4.0.0-25. Note that this is a pre-release, so to test it, you need to install Rollup via npm install rollup@4.0.0-25 or npm install rollup@beta. It will likely become part of a regular release later.

lukastaegert added a commit that referenced this pull request Oct 5, 2023
* [v4.0] Set minimum Node version to 18

* [v4.0] Switch parser to SWC and introduce native/WASM code (#5073)

* Add native compilation for local NodeJS

* Link instead of copying for faster dev cycles for now

* Parse AST

* Convert first trivial AST to a buffer

* Use SWC for parsing

* Extend AST conversion

* Make AST more similar

* Fix line number issue by creating a new sourcemap (and thus compiler) for each run

* Collect timings

* Add code_length to struct

* Refine parsing

* Extend parsing

* Extend AST: ImportDefaultSpecifier, LiteralBoolean, LiteralNull, ExportDefaultExpression

* Extend AST: ImportNamespaceSpecifier, ExportAll

* Extend AST: BinaryExpression, ArrayPattern, ObjectPattern, AssignmentPatternProperty, ArrayLiteral, ImportExpression

* Extend AST: ConditionalExpression

* Extend AST: FunctionDeclaration, ClassDeclaration, ClassBody, ReturnStatement

* Extend AST: ObjectLiteral, KeyValueProperty

* Extend AST: ShorthandProperty

* Extend AST: GetterProperty, AssignmentExpression, NewExpression, FunctionExpression

* Extend AST: ThrowStatement

* Extend AST: ExportDefaultDeclaration

* Extend AST: AssignmentPattern, AwaitExpression, BreakStatement
Start sorting AST nodes

* Extend AST: TryStatement, CatchClause, ChainExpression

* Extend AST: ClassExpression, ContinueStatement, DebuggerStatement, DoWhileStatement, EmptyStatement

* Extend AST: ExportNamedDeclaration, ForInStatement, ForOfStatement, ForStatement

* Extend AST: IfStatement

* Extend AST: Import attributes

* Extend AST: Literal<RegExp>, Literal<BigInt>

* Extend AST: LogicalExpression

* Extend AST: MetaProperty

* Extend AST: Various Property types

* Extend AST: Progress on classes

* Extend AST: MethodDefinition, PropertyDefinition, PrivateName, ThisExpression

* Extend AST: StaticBlock, Super

* Extend AST: RestElement, SequenceExpression, SwitchCase, SwitchStatement

* Extend AST: TaggedTemplateExpression, TemplateElement, TemplateLiteral, UnaryExpression, UpdateExpression, YieldExpression

* Extend AST: Properties in object patterns

* Finishing Fixes

* More fixes

* Run cargo fmt

* Handle directives

* Minor fixes

* Unicode support

* Fix optional chain expressions

* Adapt tests

* Do not run acorn anymore

* Update lockfile

* Minor fixes

* Move to rust folder

* Separate Rust Node bindings to allow adding WASM bindings in another workspace

* Make Napi build closer to how rs.napi works

* Fix path issues

* Disable browser build for now

* Add native package directories

* Refine runWithEcho

* Try initial steps with Github flow

* Trigger change

* Temporarily add yarn lockfile until we figured out if we get it to work with npm

* Use nightly toolchain

* Use default locations for Napi files to make things easier

* Adapt workflow

* Skip regular tests for now

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Test MacOS/WIndows

* Fix bootstrap build

* Skip tests

* Rename workflow

* Add additional tests

* Use zig differently

* Try to fix musl build

* Skip musl again for now

* Add publish to workflow

* 4.0.0-0

* Remove yarn lock again

* Fix coverage job

* Fix artefact handling

* Revert "4.0.0-0"

This reverts commit 734806f.

* 4.0.0-0

* Do not include default triples twice

* Fix native npm packages

* 4.0.0-1

* Add missing additional tests except browser tests

* Try to fix publish and tests

* 4.0.0-2

* Switch to faster utf-16 conversion

* 4.0.0-3

* Fix positioning algorithm when manually searching the code

* 4.0.0-4

* feat: Add WASM browser build (#5077)

* feat: add wasm browser build

* move wasm binding into a separate cargo workspace

* use imports replacing

* set the targetEnv option of wasm to browser in browser build

* add the wasm build to build command

* fix lint error and ci error

* add more comments to silence the linter

* big change

* trigger change

* run browser tests

* trigger change

* tweak wasm build on CI

* Increase build timeout

* Use shared string constants

* Extract fixed strings into constants

* Remove comment

* Get rid of dbg! calls

* Add lockfile hash to cargo cache

* Use if let over match in some cases

* Return the buffer of the syntax error in parse_ast

* Initial annotation support

* Put annotation types into string table

* Remove invalid annotations

* Support nested calls and new expressions

* Improve tree-shaking for annotations

* Adapt test

* Properly handle line-breaks, commas etc.

* Mark nested pure annotations as pure

* Remove sourcemap comments

* Handle function side effect annotatinos

* Remove old comment-handling code

* Increase timeout for browser tests

* Only skip the tests that still fail

* Run coverage again on CI

* Get the buffer of pos and message from the Syntax error

* Handle the lint errors from SWC

* Reenable tests about parse errors and adjust some relevant code

* Emit native.js to native.cjs

* Add cjs extension for native importee when bundling for ESM

* Change native importee with replace plugin and emit native.cjs in napi build

* Silence the linter for importing native

* Use node:path to resolve native binding files

* Add Node WASM files to Native packages for StackBlitz and similar use cases

* Unignore *.d.ts in the wasm dir

* 4.0.0-5

* Fix copy-wasm-node.js

* 4.0.0-6

* Remove .gitignore in wasm-node directory

* 4.0.0-7

* Include .cjs files when publishing rollup to npm

* 4.0.0-8

* Get readString function at runtime

* eslint: ignore wasm-node and set node extensions of import/resolver

* 4.0.0-9

* Change the required node to >=14.18.0 as before

* 4.0.0-10

* Prepare to fix ESM build

Still requires bug-fix on Rollup side for relative external dependencies
outside the ouput directory

* Update Rollup

* Enable ESM tests

* Re-enable another test

* Remove CJS eslint configuration

* Fix extension

* Fix test

* Fix entension for native import

* Support for publishing a completely separate package @rollup/wasm-node

* 4.0.0-11

* Fix publish for wasm node package

* Add AST verification to function tests

* Only use plugin arrays in form and function tests

* Fix spans in function tests

* Verify AST in form tests as well

* Try to publish @rollup/browser and fix publish-wasm-node-package.js

* 4.0.0-12

* Tweak publish scripts

* Fix importing wasm file in browser

* Parse code as unknown module type for greater compatibility

* Remove acorn options

* Tweak getReadStringFunction

* Fix browser tests

* 4.0.0-13

* Remove polyfills that are no longer needed in browser tests

* Convert to new import attributes AST format

* Rename assertions to attributes

* Deprecate externalImportAssertions in favor of externalImportAttributes

* Update SWC version

* Remove max-call-stack test

SWC is not capable of handling it and we cannot fix it

* Improve coverage

* re-enable repl-artefacts workflow

* Fix test

* Preload wasm file in docs

* docs: add functions to get full path of url

* Delete the build plugin handleImportMetaUrl

* Make 'npm install github/branch' work

* Verify there is a valid changelog entry before releasing

* Create release notes and comments from CI

Minor change to maybe trigger a CI run

* Fix RegExp

* 4.0.0-14

* Minor changes for a test PR (#5139)

* Fix RegExp use

* 4.0.0-15

* Do not rely on current branch to find the PR

* 4.0.0-16

* Fix how to determine git commit range

* 4.0.0-17

* Make sure we fetch all history on publish

* 4.0.0-18

* Add proper permissions

* 4.0.0-19

* Use Double quotation marks instead of Single quotation marks if concurrently scripts with flags

* Remove "engines" from native packages

* Update CONTRIBUTING.md

---------

Co-authored-by: XiaoPi <530257315@qq.com>

* [v4.0] Set the default of skipSelf to true (#5142)

* Set minimum Node version to 18

* Set the default of skipSelf to true

* [v4.0] Switch parser to SWC and introduce native/WASM code (#5073)

* Add native compilation for local NodeJS

* Link instead of copying for faster dev cycles for now

* Parse AST

* Convert first trivial AST to a buffer

* Use SWC for parsing

* Extend AST conversion

* Make AST more similar

* Fix line number issue by creating a new sourcemap (and thus compiler) for each run

* Collect timings

* Add code_length to struct

* Refine parsing

* Extend parsing

* Extend AST: ImportDefaultSpecifier, LiteralBoolean, LiteralNull, ExportDefaultExpression

* Extend AST: ImportNamespaceSpecifier, ExportAll

* Extend AST: BinaryExpression, ArrayPattern, ObjectPattern, AssignmentPatternProperty, ArrayLiteral, ImportExpression

* Extend AST: ConditionalExpression

* Extend AST: FunctionDeclaration, ClassDeclaration, ClassBody, ReturnStatement

* Extend AST: ObjectLiteral, KeyValueProperty

* Extend AST: ShorthandProperty

* Extend AST: GetterProperty, AssignmentExpression, NewExpression, FunctionExpression

* Extend AST: ThrowStatement

* Extend AST: ExportDefaultDeclaration

* Extend AST: AssignmentPattern, AwaitExpression, BreakStatement
Start sorting AST nodes

* Extend AST: TryStatement, CatchClause, ChainExpression

* Extend AST: ClassExpression, ContinueStatement, DebuggerStatement, DoWhileStatement, EmptyStatement

* Extend AST: ExportNamedDeclaration, ForInStatement, ForOfStatement, ForStatement

* Extend AST: IfStatement

* Extend AST: Import attributes

* Extend AST: Literal<RegExp>, Literal<BigInt>

* Extend AST: LogicalExpression

* Extend AST: MetaProperty

* Extend AST: Various Property types

* Extend AST: Progress on classes

* Extend AST: MethodDefinition, PropertyDefinition, PrivateName, ThisExpression

* Extend AST: StaticBlock, Super

* Extend AST: RestElement, SequenceExpression, SwitchCase, SwitchStatement

* Extend AST: TaggedTemplateExpression, TemplateElement, TemplateLiteral, UnaryExpression, UpdateExpression, YieldExpression

* Extend AST: Properties in object patterns

* Finishing Fixes

* More fixes

* Run cargo fmt

* Handle directives

* Minor fixes

* Unicode support

* Fix optional chain expressions

* Adapt tests

* Do not run acorn anymore

* Update lockfile

* Minor fixes

* Move to rust folder

* Separate Rust Node bindings to allow adding WASM bindings in another workspace

* Make Napi build closer to how rs.napi works

* Fix path issues

* Disable browser build for now

* Add native package directories

* Refine runWithEcho

* Try initial steps with Github flow

* Trigger change

* Temporarily add yarn lockfile until we figured out if we get it to work with npm

* Use nightly toolchain

* Use default locations for Napi files to make things easier

* Adapt workflow

* Skip regular tests for now

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Test MacOS/WIndows

* Fix bootstrap build

* Skip tests

* Rename workflow

* Add additional tests

* Use zig differently

* Try to fix musl build

* Skip musl again for now

* Add publish to workflow

* 4.0.0-0

* Remove yarn lock again

* Fix coverage job

* Fix artefact handling

* Revert "4.0.0-0"

This reverts commit 734806f.

* 4.0.0-0

* Do not include default triples twice

* Fix native npm packages

* 4.0.0-1

* Add missing additional tests except browser tests

* Try to fix publish and tests

* 4.0.0-2

* Switch to faster utf-16 conversion

* 4.0.0-3

* Fix positioning algorithm when manually searching the code

* 4.0.0-4

* feat: Add WASM browser build (#5077)

* feat: add wasm browser build

* move wasm binding into a separate cargo workspace

* use imports replacing

* set the targetEnv option of wasm to browser in browser build

* add the wasm build to build command

* fix lint error and ci error

* add more comments to silence the linter

* big change

* trigger change

* run browser tests

* trigger change

* tweak wasm build on CI

* Increase build timeout

* Use shared string constants

* Extract fixed strings into constants

* Remove comment

* Get rid of dbg! calls

* Add lockfile hash to cargo cache

* Use if let over match in some cases

* Return the buffer of the syntax error in parse_ast

* Initial annotation support

* Put annotation types into string table

* Remove invalid annotations

* Support nested calls and new expressions

* Improve tree-shaking for annotations

* Adapt test

* Properly handle line-breaks, commas etc.

* Mark nested pure annotations as pure

* Remove sourcemap comments

* Handle function side effect annotatinos

* Remove old comment-handling code

* Increase timeout for browser tests

* Only skip the tests that still fail

* Run coverage again on CI

* Get the buffer of pos and message from the Syntax error

* Handle the lint errors from SWC

* Reenable tests about parse errors and adjust some relevant code

* Emit native.js to native.cjs

* Add cjs extension for native importee when bundling for ESM

* Change native importee with replace plugin and emit native.cjs in napi build

* Silence the linter for importing native

* Use node:path to resolve native binding files

* Add Node WASM files to Native packages for StackBlitz and similar use cases

* Unignore *.d.ts in the wasm dir

* 4.0.0-5

* Fix copy-wasm-node.js

* 4.0.0-6

* Remove .gitignore in wasm-node directory

* 4.0.0-7

* Include .cjs files when publishing rollup to npm

* 4.0.0-8

* Get readString function at runtime

* eslint: ignore wasm-node and set node extensions of import/resolver

* 4.0.0-9

* Change the required node to >=14.18.0 as before

* 4.0.0-10

* Prepare to fix ESM build

Still requires bug-fix on Rollup side for relative external dependencies
outside the ouput directory

* Update Rollup

* Enable ESM tests

* Re-enable another test

* Remove CJS eslint configuration

* Fix extension

* Fix test

* Fix entension for native import

* Support for publishing a completely separate package @rollup/wasm-node

* 4.0.0-11

* Fix publish for wasm node package

* Add AST verification to function tests

* Only use plugin arrays in form and function tests

* Fix spans in function tests

* Verify AST in form tests as well

* Try to publish @rollup/browser and fix publish-wasm-node-package.js

* 4.0.0-12

* Tweak publish scripts

* Fix importing wasm file in browser

* Parse code as unknown module type for greater compatibility

* Remove acorn options

* Tweak getReadStringFunction

* Fix browser tests

* 4.0.0-13

* Remove polyfills that are no longer needed in browser tests

* Convert to new import attributes AST format

* Rename assertions to attributes

* Deprecate externalImportAssertions in favor of externalImportAttributes

* Update SWC version

* Remove max-call-stack test

SWC is not capable of handling it and we cannot fix it

* Improve coverage

* re-enable repl-artefacts workflow

* Fix test

* Preload wasm file in docs

* docs: add functions to get full path of url

* Delete the build plugin handleImportMetaUrl

* Make 'npm install github/branch' work

* Verify there is a valid changelog entry before releasing

* Create release notes and comments from CI

Minor change to maybe trigger a CI run

* Fix RegExp

* 4.0.0-14

* Minor changes for a test PR (#5139)

* Fix RegExp use

* 4.0.0-15

* Do not rely on current branch to find the PR

* 4.0.0-16

* Fix how to determine git commit range

* 4.0.0-17

* Make sure we fetch all history on publish

* 4.0.0-18

* Add proper permissions

* 4.0.0-19

* Use Double quotation marks instead of Single quotation marks if concurrently scripts with flags

* Remove "engines" from native packages

* Update CONTRIBUTING.md

---------

Co-authored-by: XiaoPi <530257315@qq.com>

* Update tests

* Retrieve the code that was omitted during the merge

* Restore test coverage

* Update docs/plugin-development/index.md

Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>

---------

Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com>
Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>

* [v4.0] Imporve the performance of generating ast and rollup ast nodes (#5144)

* Set TsConfig useDefineForClassFields to false for reducing time consumption

* Adapt annotations props for reducing memory consumption

* [v4.0] Remove deprecated features (#5143)

* Remove hasModuleSideEffects from module info

* Remove this.moduleIds from plugin context

* Remove output.preferConst

* Remove output.dynamicImportFunction

* Remove output.experimentalDeepDynamicChunkOptimization

* Remove output.namespaceToStringTag

* Remove inlineDynamicImports input option

* Remove manualChunks and preserveModules input options as well as maxParallelFileReads

* [v4.0] feat: Do not watch files anymore if their content is returned by the load hook (#5150)

* feat: Do not watch files anymore if their content is returned by the load hook

* tweak test

* [v4.0] Remove onwarn from normalized input options (#5147)

Remove onwarn from normalized input options

Also remove the RollupWarning type

* [v4.0] Add parse option to allow return outside function (#5154)

Allow return outside functions

* [v4.0] Handle empty exports (#5157)

Handle empty exports

* [v4.0] feat: implement hashing content in Rust (#5155)

* [v4.0] fix: also strip BOM from code strings in JS (#5164)

fix: also strip BOM from code strings in JS

* [v4.0] feat: preserve shebang in entry module for CJS and ESM outputs (#5163)

* feat: preserve shebang in entry module for CJS and ESM outputs

* Remove the shebang insertion during cli build

* Parse shebang in JS code

* Render shebang in chunk.render()

---------

Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>

* [v4.0] warn for invalid annotations (#5165)

* Remove annotations for partially removed declarations

* Warn for invalid annotations

* 4.0.0-24

* [v.4.0] Ensure we support new import attribute "with" syntax (#5168)

* Update dependencies

* Use new import attribute syntax in test files

* [v4.0] Expose parser (#5169)

* Expose parser as separate API

* Ensure key and value of a shorthand property have different references

* 4.0.0-25

---------

Co-authored-by: XiaoPi <530257315@qq.com>
@github-actions
Copy link

github-actions bot commented Oct 5, 2023

This PR has been released as part of rollup@4.0.0. You can test it via npm install rollup.

Woodpile37 added a commit to Woodpile37/ethers.js that referenced this pull request Oct 27, 2023
<p>This PR was automatically created by Snyk using the credentials of a
real user.</p><br /><h3>Snyk has created this PR to upgrade rollup from
3.29.4 to 4.0.0.</h3>

:information_source: Keep your dependencies up-to-date. This makes it
easier to fix existing vulnerabilities and to more quickly identify and
fix newly disclosed vulnerabilities when they affect your project.
<hr/>

*Warning:* This is a major version upgrade, and may be a breaking
change.
- The recommended version is **25 versions** ahead of your current
version.
- The recommended version was released **21 days ago**, on 2023-10-05.


<details>
<summary><b>Release notes</b></summary>
<br/>
  <details>
    <summary>Package name: <b>rollup</b></summary>
    <ul>
      <li>
<b>4.0.0</b> - <a
href="https://snyk.io/redirect/github/rollup/rollup/releases/tag/v4.0.0">2023-10-05</a></br><h2>4.0.0</h2>
<p><em>2023-10-05</em></p>
<h3>BREAKING CHANGES</h3>
<h4>General Changes</h4>
<ul>
<li>The minimal required Node version is now 18.0.0 (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1899815236" data-permission-text="Title is private"
data-url="rollup/rollup#5142"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5142/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5142">#5142</a>)</li>
<li>The browser build now relies on a WASM artifact that needs to be
provided as well (<a class="issue-link js-issue-link"
data-error-text="Failed to load title" data-id="1820063431"
data-permission-text="Title is private"
data-url="rollup/rollup#5073"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5073/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5073">#5073</a>)</li>
<li>The NodeJS build now relies on an optional native binary; for
unsupported platforms, users can use the <code>@ rollup/wasm-node</code>
package that has the same interface as Rollup but relies on WASM
artifacts (<a class="issue-link js-issue-link" data-error-text="Failed
to load title" data-id="1820063431" data-permission-text="Title is
private" data-url="rollup/rollup#5073"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5073/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5073">#5073</a>)</li>
<li>The "with" syntax for import attributes is not yet supported,
awaiting support in SWC (<a class="issue-link js-issue-link"
data-error-text="Failed to load title" data-id="1820063431"
data-permission-text="Title is private"
data-url="rollup/rollup#5073"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5073/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5073">#5073</a>)</li>
<li>The <code>INVALID_IMPORT_ASSERTION</code> error code has been
replaced with <code>INVALID_IMPORT_ATTRIBUTE</code> (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1820063431" data-permission-text="Title is private"
data-url="rollup/rollup#5073"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5073/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5073">#5073</a>)</li>
<li>Rollup will now warn for <code>@ __PURE__</code> and <code>@
__NO_SIDE_EFFECTS__</code> annotations in invalid locations (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1921228669" data-permission-text="Title is private"
data-url="rollup/rollup#5165"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5165/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5165">#5165</a>)</li>
<li>If an entry module starts with a shebang comment <code>#!...</code>,
this comment will be prepended to the output for <code>es</code> and
<code>cjs</code> formats (<a class="issue-link js-issue-link"
data-error-text="Failed to load title" data-id="1920177473"
data-permission-text="Title is private"
data-url="rollup/rollup#5163"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5163/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5163">#5163</a>)</li>
<li>File hashes will now use url-safe base64 encoded hashes (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1911769288" data-permission-text="Title is private"
data-url="rollup/rollup#5155"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5155/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5155">#5155</a>)</li>
<li>The maximum hash length has been reduced to 22 characters (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1911769288" data-permission-text="Title is private"
data-url="rollup/rollup#5155"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5155/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5155">#5155</a>)</li>
<li>The <code>RollupWarning</code> type has been removed in favor of the
<code>RollupLog</code> type (<a class="issue-link js-issue-link"
data-error-text="Failed to load title" data-id="1906127628"
data-permission-text="Title is private"
data-url="rollup/rollup#5147"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5147/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5147">#5147</a>)</li>
</ul>
<h4>Changes to Rollup Options</h4>
<ul>
<li>Acorn plugins are no longer supported, the
<code>acornInjectPlugins</code> option has been removed (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1820063431" data-permission-text="Title is private"
data-url="rollup/rollup#5073"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5073/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5073">#5073</a>)</li>
<li>The <code>acorn</code> option has been removed (<a class="issue-link
js-issue-link" data-error-text="Failed to load title"
data-id="1820063431" data-permission-text="Title is private"
data-url="rollup/rollup#5073"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5073/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5073">#5073</a>)</li>
<li><code>output.externalImportAssertions</code> has been deprecated in
favor of <code>output.externalImportAttributes</code> (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1820063431" data-permission-text="Title is private"
data-url="rollup/rollup#5073"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5073/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5073">#5073</a>)</li>
<li><code>inlineDynamicImports</code>, <code>manualChunks</code> and
<code>preserveModules</code> have been removed on input option level:
Please use the corresponding output options of the same names (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1899897351" data-permission-text="Title is private"
data-url="rollup/rollup#5143"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5143/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5143">#5143</a>)</li>
<li>Removed output options (<a class="issue-link js-issue-link"
data-error-text="Failed to load title" data-id="1899897351"
data-permission-text="Title is private"
data-url="rollup/rollup#5143"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5143/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5143">#5143</a>):
<ul>
<li><code>output.experimentalDeepDynamicChunkOptimization</code>: This
option is no longer needed as Rollup now always runs the full chunking
algorithm</li>
<li><code>output.dynamicImportFunction</code>: Use the
<code>renderDynamicImport</code> plugin hook instead</li>
<li><code>output.namespaceToStringTag</code>: Use
<code>output.generatedCode.symbols</code> instead</li>
<li><code>output.preferConst</code>: Use
<code>output.generatedCode.constBindings</code> instead</li>
</ul>
</li>
</ul>
<h4>Plugin API Changes</h4>
<ul>
<li>For <code>this.resolve</code>, the default of the
<code>skipSelf</code> option is now <code>true</code> (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1899815236" data-permission-text="Title is private"
data-url="rollup/rollup#5142"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5142/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5142">#5142</a>)</li>
<li><code>this.parse</code> now only supports the
<code>allowReturnOutsideFunction</code> option for now (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1820063431" data-permission-text="Title is private"
data-url="rollup/rollup#5073"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5073/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5073">#5073</a>)</li>
<li>Import assertions now use the <a
href="https://snyk.io/redirect/github/estree/estree/blob/master/experimental/import-attributes.md">new
import attribute AST structure</a> (<a class="issue-link js-issue-link"
data-error-text="Failed to load title" data-id="1820063431"
data-permission-text="Title is private"
data-url="rollup/rollup#5073"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5073/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5073">#5073</a>)</li>
<li>"assertions" have been replaced with "attributes" in various places
of the plugin interface (<a class="issue-link js-issue-link"
data-error-text="Failed to load title" data-id="1820063431"
data-permission-text="Title is private"
data-url="rollup/rollup#5073"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5073/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5073">#5073</a>)</li>
<li>If the import of a module id is handled by the <code>load</code>
hook of a plugin, <code>rollup.watch</code> no longer watches the actual
file if the module id corresponds to a real path; if this is intended,
then the plugin is responsible for calling
<code>this.addWatchFile</code> for any dependency files (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1908157110" data-permission-text="Title is private"
data-url="rollup/rollup#5150"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5150/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5150">#5150</a>)</li>
<li>The normalized input options provided by <code>buildStart</code> and
other hooks no longer contain an <code>onwarn</code> handler; plugins
should use <code>onLog</code> instead (<a class="issue-link
js-issue-link" data-error-text="Failed to load title"
data-id="1906127628" data-permission-text="Title is private"
data-url="rollup/rollup#5147"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5147/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5147">#5147</a>)</li>
<li><code>this.moduleIds</code> has been removed from the plugin
context: Use <code>this.getModuleIds()</code> instead (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1899897351" data-permission-text="Title is private"
data-url="rollup/rollup#5143"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5143/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5143">#5143</a>)</li>
<li>The <code>hasModuleSideEffects</code> flag has been removed from the
<code>ModuleInfo</code> returned by <code>thi s.getModuleInfo()</code>:
Use <code>moduleSideEffects</code> on the <code>ModuleInfo</code>
instead (<a class="issue-link js-issue-link" data-error-text="Failed to
load title" data-id="1899897351" data-permission-text="Title is private"
data-url="rollup/rollup#5143"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5143/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5143">#5143</a>)</li>
</ul>
<h3>Features</h3>
<ul>
<li>Improve parsing speed by switching to a native SWC-based parser (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1820063431" data-permission-text="Title is private"
data-url="rollup/rollup#5073"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5073/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5073">#5073</a>)</li>
<li>Rollup will now warn for <code>@ __PURE__</code> and <code>@
__NO_SIDE_EFFECTS__</code> annotations in invalid locations (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1921228669" data-permission-text="Title is private"
data-url="rollup/rollup#5165"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5165/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5165">#5165</a>)</li>
<li>The parser is now exposed as a separate export <code>parseAst</code>
(<a class="issue-link js-issue-link" data-error-text="Failed to load
title" data-id="1928078406" data-permission-text="Title is private"
data-url="rollup/rollup#5169"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5169/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5169">#5169</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li>Rollup no longer tries to watch virtual files if their name
corresponds to an actual file name; instead, plugins handle watching via
<code>this.addWatchFile()</code> (<a class="issue-link js-issue-link"
data-error-text="Failed to load title" data-id="1908157110"
data-permission-text="Title is private"
data-url="rollup/rollup#5150"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5150/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5150">#5150</a>)</li>
</ul>
<h3>Pull Requests</h3>
<ul>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5073"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5073/hovercard">#5073</a>:
[v4.0] Switch parser to SWC and introduce native/WASM code (<a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/lukastaegert/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/lukastaegert">@
lukastaegert</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5142"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5142/hovercard">#5142</a>:
[v4.0] Set the default of skipSelf to true (<a class="user-mention
notranslate" data-hovercard-type="user"
data-hovercard-url="/users/TrickyPi/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/TrickyPi">@ TrickyPi</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5143"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5143/hovercard">#5143</a>:
[v4.0] Remove deprecated features (<a class="user-mention notranslate"
data-hovercard-type="user"
data-hovercard-url="/users/lukastaegert/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/lukastaegert">@
lukastaegert</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5144"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5144/hovercard">#5144</a>:
[v4.0] Imporve the performance of generating ast and rollup ast nodes
(<a class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/TrickyPi/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/TrickyPi">@ TrickyPi</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5147"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5147/hovercard">#5147</a>:
[v4.0] Remove onwarn from normalized input options (<a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/lukastaegert/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/lukastaegert">@
lukastaegert</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5150"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5150/hovercard">#5150</a>:
[v4.0] feat: Do not watch files anymore if their content is returned by
the load hook (<a class="user-mention notranslate"
data-hovercard-type="user"
data-hovercard-url="/users/TrickyPi/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/TrickyPi">@ TrickyPi</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5154"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5154/hovercard">#5154</a>:
[v4.0] Add parse option to allow return outside function (<a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/lukastaegert/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/lukastaegert">@
lukastaegert</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5155"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5155/hovercard">#5155</a>:
[v4.0] feat: implement hashing content in Rust (<a class="user-mention
notranslate" data-hovercard-type="user"
data-hovercard-url="/users/TrickyPi/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/TrickyPi">@ TrickyPi</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5157"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5157/hovercard">#5157</a>:
[v4.0] Handle empty exports (<a class="user-mention notranslate"
data-hovercard-type="user"
data-hovercard-url="/users/lukastaegert/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/lukastaegert">@
lukastaegert</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5160"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5160/hovercard">#5160</a>:
chore(deps): lock file maintenance minor/patch updates (<a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/renovate/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/renovate">@
renovate</a>[bot])</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5163"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5163/hovercard">#5163</a>:
[v4.0] feat: preserve shebang in entry module for CJS and ESM outputs
(<a class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/TrickyPi/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/TrickyPi">@ TrickyPi</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5164"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5164/hovercard">#5164</a>:
[v4.0] fix: also strip BOM from code strings in JS (<a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/TrickyPi/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/TrickyPi">@ TrickyPi</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5165"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5165/hovercard">#5165</a>:
[v4.0] warn for invalid annotations (<a class="user-mention notranslate"
data-hovercard-type="user"
data-hovercard-url="/users/lukastaegert/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/lukastaegert">@
lukastaegert</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5168"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5168/hovercard">#5168</a>:
[v4.0] Ensure we support new import attribute "with" syntax (<a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/lukastaegert/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/lukastaegert">@
lukastaegert</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5169"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5169/hovercard">#5169</a>:
[v4.0] Expose parser (<a class="user-mention notranslate"
data-hovercard-type="user"
data-hovercard-url="/users/lukastaegert/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/lukastaegert">@
lukastaegert</a>)</li>
</ul>
      </li>
      <li>
<b>4.0.0-25</b> - <a
href="https://snyk.io/redirect/github/rollup/rollup/releases/tag/v4.0.0-25">2023-10-05</a></br><p>4.0.0-25</p>
      </li>
      <li>
        <b>4.0.0-24</b> - 2023-10-03
      </li>
      <li>
        <b>4.0.0-23</b> - 2023-09-26
      </li>
      <li>
        <b>4.0.0-22</b> - 2023-09-26
      </li>
      <li>
        <b>4.0.0-21</b> - 2023-09-24
      </li>
      <li>
        <b>4.0.0-20</b> - 2023-09-24
      </li>
      <li>
        <b>4.0.0-19</b> - 2023-09-15
      </li>
      <li>
        <b>4.0.0-18</b> - 2023-09-15
      </li>
      <li>
        <b>4.0.0-17</b> - 2023-09-15
      </li>
      <li>
        <b>4.0.0-16</b> - 2023-09-15
      </li>
      <li>
        <b>4.0.0-15</b> - 2023-09-15
      </li>
      <li>
        <b>4.0.0-14</b> - 2023-09-15
      </li>
      <li>
        <b>4.0.0-13</b> - 2023-08-24
      </li>
      <li>
        <b>4.0.0-12</b> - 2023-08-23
      </li>
      <li>
        <b>4.0.0-10</b> - 2023-08-21
      </li>
      <li>
        <b>4.0.0-9</b> - 2023-08-20
      </li>
      <li>
        <b>4.0.0-8</b> - 2023-08-20
      </li>
      <li>
        <b>4.0.0-7</b> - 2023-08-20
      </li>
      <li>
<b>4.0.0-6</b> - <a
href="https://snyk.io/redirect/github/rollup/rollup/releases/tag/v4.0.0-6">2023-08-20</a></br><p>Check
publish</p>
      </li>
      <li>
        <b>4.0.0-5</b> - 2023-08-20
      </li>
      <li>
        <b>4.0.0-4</b> - 2023-08-04
      </li>
      <li>
        <b>4.0.0-3</b> - 2023-08-04
      </li>
      <li>
        <b>4.0.0-2</b> - 2023-08-01
      </li>
      <li>
        <b>4.0.0-1</b> - 2023-08-01
      </li>
      <li>
<b>3.29.4</b> - <a
href="https://snyk.io/redirect/github/rollup/rollup/releases/tag/v3.29.4">2023-09-28</a></br><h2>3.29.4</h2>
<p><em>2023-09-28</em></p>
<h3>Bug Fixes</h3>
<ul>
<li>Fix static analysis when an exported function uses callbacks (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1914196648" data-permission-text="Title is private"
data-url="rollup/rollup#5158"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5158/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5158">#5158</a>)</li>
</ul>
<h3>Pull Requests</h3>
<ul>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5158"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5158/hovercard">#5158</a>:
Deoptimize all parameters when losing track of a function (<a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/lukastaegert/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/lukastaegert">@
lukastaegert</a>)</li>
</ul>
      </li>
    </ul>
from <a
href="https://snyk.io/redirect/github/rollup/rollup/releases">rollup
GitHub release notes</a>
  </details>
</details>


<details>
  <summary><b>Commit messages</b></summary>
  </br>
  <details>
    <summary>Package name: <b>rollup</b></summary>
    <ul>
<li><a
href="https://snyk.io/redirect/github/rollup/rollup/commit/2f261358c62b4f9e62cb86bf99de8d4ff3668994">2f26135</a>
4.0.0</li>
<li><a
href="https://snyk.io/redirect/github/rollup/rollup/commit/4e8e5b40cf6eb1be278c9e2146c073db8ea603ec">4e8e5b4</a>
[v4.0] Expose parser (#5169)</li>
<li><a
href="https://snyk.io/redirect/github/rollup/rollup/commit/cade24fbf3390a31734301a1f803b24e34b6cedd">cade24f</a>
[v4.0] Ensure we support new import attribute &quot;with&quot; syntax
(#5168)</li>
<li><a
href="https://snyk.io/redirect/github/rollup/rollup/commit/dd709c3fab369232c7c08089162981e1a44bdd60">dd709c3</a>
[v4.0] warn for invalid annotations (#5165)</li>
<li><a
href="https://snyk.io/redirect/github/rollup/rollup/commit/bfbea66569491f5466fbba99de2ba6a0225f851b">bfbea66</a>
[v4.0] feat: preserve shebang in entry module for CJS and ESM outputs
(#5163)</li>
<li><a
href="https://snyk.io/redirect/github/rollup/rollup/commit/4e562e52db3f55832de17ce02fabcc05c292861f">4e562e5</a>
[v4.0] fix: also strip BOM from code strings in JS (#5164)</li>
<li><a
href="https://snyk.io/redirect/github/rollup/rollup/commit/fbc25afcc2e494b562358479524a88ab8fe0f1bf">fbc25af</a>
[v4.0] feat: implement hashing content in Rust (#5155)</li>
<li><a
href="https://snyk.io/redirect/github/rollup/rollup/commit/0b0eabd8cd93de7c6b69c95a4cac24559c040b80">0b0eabd</a>
[v4.0] Handle empty exports (#5157)</li>
<li><a
href="https://snyk.io/redirect/github/rollup/rollup/commit/fda977bb38ab31638c3a4a18e0c4f8b9c8482e6c">fda977b</a>
[v4.0] Add parse option to allow return outside function (#5154)</li>
<li><a
href="https://snyk.io/redirect/github/rollup/rollup/commit/7325320ad95955540e1bb38dab9d600f569d915c">7325320</a>
[v4.0] Remove onwarn from normalized input options (#5147)</li>
<li><a
href="https://snyk.io/redirect/github/rollup/rollup/commit/accd66a4247dfdb4d7f2605b399d12d001e5a3ed">accd66a</a>
[v4.0] feat: Do not watch files anymore if their content is returned by
the load hook (#5150)</li>
<li><a
href="https://snyk.io/redirect/github/rollup/rollup/commit/55abe0fbf7116c9160a53da6a27cc9bce2eafd40">55abe0f</a>
[v4.0] Remove deprecated features (#5143)</li>
<li><a
href="https://snyk.io/redirect/github/rollup/rollup/commit/62cbff4a20030c5d787f3162ea29981e40525030">62cbff4</a>
[v4.0] Imporve the performance of generating ast and rollup ast nodes
(#5144)</li>
<li><a
href="https://snyk.io/redirect/github/rollup/rollup/commit/92864d48896dd09c0381d4b1cbef769a03c3f7d1">92864d4</a>
[v4.0] Set the default of skipSelf to true (#5142)</li>
<li><a
href="https://snyk.io/redirect/github/rollup/rollup/commit/643272e0d11a28bd56491719b75f95147bb66ac7">643272e</a>
[v4.0] Switch parser to SWC and introduce native/WASM code (#5073)</li>
<li><a
href="https://snyk.io/redirect/github/rollup/rollup/commit/4576ef3dfaf83415b319c851acd1a85b100e4ad1">4576ef3</a>
[v4.0] Set minimum Node version to 18</li>
<li><a
href="https://snyk.io/redirect/github/rollup/rollup/commit/fac5f1c1c12dc0409ff090664e305586747dc2f7">fac5f1c</a>
chore(deps): lock file maintenance minor/patch updates (#5160)</li>
    </ul>

<a
href="https://snyk.io/redirect/github/rollup/rollup/compare/a6448b99f725d457e35821b73a865b5c4d4c6a61...2f261358c62b4f9e62cb86bf99de8d4ff3668994">Compare</a>
  </details>
</details>
<hr/>

**Note:** *You are seeing this because you or someone else with access
to this repository has authorized Snyk to open upgrade PRs.*

For more information: <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiIwNGFkNWFlMS01YjE4LTQ3N2MtOGZiOC05MzI3MzQ0MjJlYmEiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6IjA0YWQ1YWUxLTViMTgtNDc3Yy04ZmI4LTkzMjczNDQyMmViYSJ9fQ=="
width="0" height="0"/>

🧐 [View latest project
report](https://app.snyk.io/org/woodpile37/project/edb93f5a-17e2-4a56-beb9-1796f0e58302?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)

🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/woodpile37/project/edb93f5a-17e2-4a56-beb9-1796f0e58302/settings/integration?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)

🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/woodpile37/project/edb93f5a-17e2-4a56-beb9-1796f0e58302/settings/integration?pkg&#x3D;rollup&amp;utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)

<!---
(snyk:metadata:{"prId":"04ad5ae1-5b18-477c-8fb8-932734422eba","prPublicId":"04ad5ae1-5b18-477c-8fb8-932734422eba","dependencies":[{"name":"rollup","from":"3.29.4","to":"4.0.0"}],"packageManager":"npm","type":"auto","projectUrl":"https://app.snyk.io/org/woodpile37/project/edb93f5a-17e2-4a56-beb9-1796f0e58302?utm_source=github&utm_medium=referral&page=upgrade-pr","projectPublicId":"edb93f5a-17e2-4a56-beb9-1796f0e58302","env":"prod","prType":"upgrade","vulns":[],"issuesToFix":[],"upgrade":[],"upgradeInfo":{"versionsDiff":25,"publishedDate":"2023-10-05T15:15:21.062Z"},"templateVariants":[],"hasFixes":false,"isMajorUpgrade":true,"isBreakingChange":true,"priorityScoreList":[]})
--->
Woodpile37 added a commit to Woodpile37/ethers.js that referenced this pull request Nov 1, 2023
<p>This PR was automatically created by Snyk using the credentials of a
real user.</p><br /><h3>Snyk has created this PR to upgrade rollup from
4.0.0 to 4.0.2.</h3>

:information_source: Keep your dependencies up-to-date. This makes it
easier to fix existing vulnerabilities and to more quickly identify and
fix newly disclosed vulnerabilities when they affect your project.
<hr/>

- The recommended version is **2 versions** ahead of your current
version.
- The recommended version was released **22 days ago**, on 2023-10-06.


<details>
<summary><b>Release notes</b></summary>
<br/>
  <details>
    <summary>Package name: <b>rollup</b></summary>
    <ul>
      <li>
<b>4.0.2</b> - <a
href="https://snyk.io/redirect/github/rollup/rollup/releases/tag/v4.0.2">2023-10-06</a></br><h2>4.0.2</h2>
<p><em>2023-10-06</em></p>
<h3>Bug Fixes</h3>
<ul>
<li>Fix annotation detection logic to not fail when a non-ASCII
character precedes a double underscore (<a class="issue-link
js-issue-link" data-error-text="Failed to load title"
data-id="1930196242" data-permission-text="Title is private"
data-url="rollup/rollup#5178"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5178/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5178">#5178</a>)</li>
</ul>
<h3>Pull Requests</h3>
<ul>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5178"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5178/hovercard">#5178</a>:
Handle special characters before double underscores (<a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/lukastaegert/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/lukastaegert">@
lukastaegert</a>)</li>
</ul>
      </li>
      <li>
<b>4.0.1</b> - <a
href="https://snyk.io/redirect/github/rollup/rollup/releases/tag/v4.0.1">2023-10-06</a></br><h2>4.0.1</h2>
<p><em>2023-10-06</em></p>
<h3>Bug Fixes</h3>
<ul>
<li>Do not panic on trailing semicolons after class methods (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1929429451" data-permission-text="Title is private"
data-url="rollup/rollup#5173"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5173/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5173">#5173</a>)</li>
<li>Add artifact for arm64 linux musl target (<a class="issue-link
js-issue-link" data-error-text="Failed to load title"
data-id="1929668290" data-permission-text="Title is private"
data-url="rollup/rollup#5176"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5176/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5176">#5176</a>)</li>
</ul>
<h3>Pull Requests</h3>
<ul>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5172"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5172/hovercard">#5172</a>:
chore(deps): lock file maintenance minor/patch updates (<a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/renovate/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/renovate">@
renovate</a>[bot])</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5173"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5173/hovercard">#5173</a>: fix:
ignores empty statements in class body that is returned by SWC parser
(<a class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/TrickyPi/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/TrickyPi">@ TrickyPi</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5176"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5176/hovercard">#5176</a>: Fix
linux arm musl build (<a class="user-mention notranslate"
data-hovercard-type="user"
data-hovercard-url="/users/lukastaegert/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/lukastaegert">@
lukastaegert</a>)</li>
</ul>
      </li>
      <li>
<b>4.0.0</b> - <a
href="https://snyk.io/redirect/github/rollup/rollup/releases/tag/v4.0.0">2023-10-05</a></br><h2>4.0.0</h2>
<p><em>2023-10-05</em></p>
<h3>BREAKING CHANGES</h3>
<h4>General Changes</h4>
<ul>
<li>The minimal required Node version is now 18.0.0 (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1899815236" data-permission-text="Title is private"
data-url="rollup/rollup#5142"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5142/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5142">#5142</a>)</li>
<li>The browser build now relies on a WASM artifact that needs to be
provided as well (<a class="issue-link js-issue-link"
data-error-text="Failed to load title" data-id="1820063431"
data-permission-text="Title is private"
data-url="rollup/rollup#5073"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5073/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5073">#5073</a>)</li>
<li>The NodeJS build now relies on an optional native binary; for
unsupported platforms, users can use the <code>@ rollup/wasm-node</code>
package that has the same interface as Rollup but relies on WASM
artifacts (<a class="issue-link js-issue-link" data-error-text="Failed
to load title" data-id="1820063431" data-permission-text="Title is
private" data-url="rollup/rollup#5073"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5073/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5073">#5073</a>)</li>
<li>The "with" syntax for import attributes is not yet supported,
awaiting support in SWC (<a class="issue-link js-issue-link"
data-error-text="Failed to load title" data-id="1820063431"
data-permission-text="Title is private"
data-url="rollup/rollup#5073"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5073/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5073">#5073</a>)</li>
<li>The <code>INVALID_IMPORT_ASSERTION</code> error code has been
replaced with <code>INVALID_IMPORT_ATTRIBUTE</code> (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1820063431" data-permission-text="Title is private"
data-url="rollup/rollup#5073"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5073/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5073">#5073</a>)</li>
<li>Rollup will now warn for <code>@ __PURE__</code> and <code>@
__NO_SIDE_EFFECTS__</code> annotations in invalid locations (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1921228669" data-permission-text="Title is private"
data-url="rollup/rollup#5165"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5165/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5165">#5165</a>)</li>
<li>If an entry module starts with a shebang comment <code>#!...</code>,
this comment will be prepended to the output for <code>es</code> and
<code>cjs</code> formats (<a class="issue-link js-issue-link"
data-error-text="Failed to load title" data-id="1920177473"
data-permission-text="Title is private"
data-url="rollup/rollup#5163"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5163/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5163">#5163</a>)</li>
<li>File hashes will now use url-safe base64 encoded hashes (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1911769288" data-permission-text="Title is private"
data-url="rollup/rollup#5155"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5155/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5155">#5155</a>)</li>
<li>The maximum hash length has been reduced to 22 characters (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1911769288" data-permission-text="Title is private"
data-url="rollup/rollup#5155"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5155/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5155">#5155</a>)</li>
<li>The <code>RollupWarning</code> type has been removed in favor of the
<code>RollupLog</code> type (<a class="issue-link js-issue-link"
data-error-text="Failed to load title" data-id="1906127628"
data-permission-text="Title is private"
data-url="rollup/rollup#5147"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5147/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5147">#5147</a>)</li>
</ul>
<h4>Changes to Rollup Options</h4>
<ul>
<li>Acorn plugins are no longer supported, the
<code>acornInjectPlugins</code> option has been removed (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1820063431" data-permission-text="Title is private"
data-url="rollup/rollup#5073"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5073/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5073">#5073</a>)</li>
<li>The <code>acorn</code> option has been removed (<a class="issue-link
js-issue-link" data-error-text="Failed to load title"
data-id="1820063431" data-permission-text="Title is private"
data-url="rollup/rollup#5073"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5073/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5073">#5073</a>)</li>
<li><code>output.externalImportAssertions</code> has been deprecated in
favor of <code>output.externalImportAttributes</code> (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1820063431" data-permission-text="Title is private"
data-url="rollup/rollup#5073"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5073/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5073">#5073</a>)</li>
<li><code>inlineDynamicImports</code>, <code>manualChunks</code> and
<code>preserveModules</code> have been removed on input option level:
Please use the corresponding output options of the same names (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1899897351" data-permission-text="Title is private"
data-url="rollup/rollup#5143"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5143/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5143">#5143</a>)</li>
<li>Removed output options (<a class="issue-link js-issue-link"
data-error-text="Failed to load title" data-id="1899897351"
data-permission-text="Title is private"
data-url="rollup/rollup#5143"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5143/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5143">#5143</a>):
<ul>
<li><code>output.experimentalDeepDynamicChunkOptimization</code>: This
option is no longer needed as Rollup now always runs the full chunking
algorithm</li>
<li><code>output.dynamicImportFunction</code>: Use the
<code>renderDynamicImport</code> plugin hook instead</li>
<li><code>output.namespaceToStringTag</code>: Use
<code>output.generatedCode.symbols</code> instead</li>
<li><code>output.preferConst</code>: Use
<code>output.generatedCode.constBindings</code> instead</li>
</ul>
</li>
</ul>
<h4>Plugin API Changes</h4>
<ul>
<li>For <code>this.resolve</code>, the default of the
<code>skipSelf</code> option is now <code>true</code> (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1899815236" data-permission-text="Title is private"
data-url="rollup/rollup#5142"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5142/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5142">#5142</a>)</li>
<li><code>this.parse</code> now only supports the
<code>allowReturnOutsideFunction</code> option for now (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1820063431" data-permission-text="Title is private"
data-url="rollup/rollup#5073"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5073/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5073">#5073</a>)</li>
<li>Import assertions now use the <a
href="https://snyk.io/redirect/github/estree/estree/blob/master/experimental/import-attributes.md">new
import attribute AST structure</a> (<a class="issue-link js-issue-link"
data-error-text="Failed to load title" data-id="1820063431"
data-permission-text="Title is private"
data-url="rollup/rollup#5073"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5073/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5073">#5073</a>)</li>
<li>"assertions" have been replaced with "attributes" in various places
of the plugin interface (<a class="issue-link js-issue-link"
data-error-text="Failed to load title" data-id="1820063431"
data-permission-text="Title is private"
data-url="rollup/rollup#5073"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5073/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5073">#5073</a>)</li>
<li>If the import of a module id is handled by the <code>load</code>
hook of a plugin, <code>rollup.watch</code> no longer watches the actual
file if the module id corresponds to a real path; if this is intended,
then the plugin is responsible for calling
<code>this.addWatchFile</code> for any dependency files (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1908157110" data-permission-text="Title is private"
data-url="rollup/rollup#5150"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5150/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5150">#5150</a>)</li>
<li>The normalized input options provided by <code>buildStart</code> and
other hooks no longer contain an <code>onwarn</code> handler; plugins
should use <code>onLog</code> instead (<a class="issue-link
js-issue-link" data-error-text="Failed to load title"
data-id="1906127628" data-permission-text="Title is private"
data-url="rollup/rollup#5147"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5147/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5147">#5147</a>)</li>
<li><code>this.moduleIds</code> has been removed from the plugin
context: Use <code>this.getModuleIds()</code> instead (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1899897351" data-permission-text="Title is private"
data-url="rollup/rollup#5143"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5143/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5143">#5143</a>)</li>
<li>The <code>hasModuleSideEffects</code> flag has been removed from the
<code>ModuleInfo</code> returned by <code>thi s.getModuleInfo()</code>:
Use <code>moduleSideEffects</code> on the <code>ModuleInfo</code>
instead (<a class="issue-link js-issue-link" data-error-text="Failed to
load title" data-id="1899897351" data-permission-text="Title is private"
data-url="rollup/rollup#5143"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5143/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5143">#5143</a>)</li>
</ul>
<h3>Features</h3>
<ul>
<li>Improve parsing speed by switching to a native SWC-based parser (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1820063431" data-permission-text="Title is private"
data-url="rollup/rollup#5073"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5073/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5073">#5073</a>)</li>
<li>Rollup will now warn for <code>@ __PURE__</code> and <code>@
__NO_SIDE_EFFECTS__</code> annotations in invalid locations (<a
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1921228669" data-permission-text="Title is private"
data-url="rollup/rollup#5165"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5165/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5165">#5165</a>)</li>
<li>The parser is now exposed as a separate export <code>parseAst</code>
(<a class="issue-link js-issue-link" data-error-text="Failed to load
title" data-id="1928078406" data-permission-text="Title is private"
data-url="rollup/rollup#5169"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5169/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5169">#5169</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li>Rollup no longer tries to watch virtual files if their name
corresponds to an actual file name; instead, plugins handle watching via
<code>this.addWatchFile()</code> (<a class="issue-link js-issue-link"
data-error-text="Failed to load title" data-id="1908157110"
data-permission-text="Title is private"
data-url="rollup/rollup#5150"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5150/hovercard"
href="https://snyk.io/redirect/github/rollup/rollup/pull/5150">#5150</a>)</li>
</ul>
<h3>Pull Requests</h3>
<ul>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5073"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5073/hovercard">#5073</a>:
[v4.0] Switch parser to SWC and introduce native/WASM code (<a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/lukastaegert/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/lukastaegert">@
lukastaegert</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5142"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5142/hovercard">#5142</a>:
[v4.0] Set the default of skipSelf to true (<a class="user-mention
notranslate" data-hovercard-type="user"
data-hovercard-url="/users/TrickyPi/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/TrickyPi">@ TrickyPi</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5143"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5143/hovercard">#5143</a>:
[v4.0] Remove deprecated features (<a class="user-mention notranslate"
data-hovercard-type="user"
data-hovercard-url="/users/lukastaegert/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/lukastaegert">@
lukastaegert</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5144"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5144/hovercard">#5144</a>:
[v4.0] Imporve the performance of generating ast and rollup ast nodes
(<a class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/TrickyPi/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/TrickyPi">@ TrickyPi</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5147"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5147/hovercard">#5147</a>:
[v4.0] Remove onwarn from normalized input options (<a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/lukastaegert/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/lukastaegert">@
lukastaegert</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5150"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5150/hovercard">#5150</a>:
[v4.0] feat: Do not watch files anymore if their content is returned by
the load hook (<a class="user-mention notranslate"
data-hovercard-type="user"
data-hovercard-url="/users/TrickyPi/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/TrickyPi">@ TrickyPi</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5154"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5154/hovercard">#5154</a>:
[v4.0] Add parse option to allow return outside function (<a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/lukastaegert/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/lukastaegert">@
lukastaegert</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5155"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5155/hovercard">#5155</a>:
[v4.0] feat: implement hashing content in Rust (<a class="user-mention
notranslate" data-hovercard-type="user"
data-hovercard-url="/users/TrickyPi/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/TrickyPi">@ TrickyPi</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5157"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5157/hovercard">#5157</a>:
[v4.0] Handle empty exports (<a class="user-mention notranslate"
data-hovercard-type="user"
data-hovercard-url="/users/lukastaegert/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/lukastaegert">@
lukastaegert</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5160"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5160/hovercard">#5160</a>:
chore(deps): lock file maintenance minor/patch updates (<a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/renovate/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/renovate">@
renovate</a>[bot])</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5163"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5163/hovercard">#5163</a>:
[v4.0] feat: preserve shebang in entry module for CJS and ESM outputs
(<a class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/TrickyPi/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/TrickyPi">@ TrickyPi</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5164"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5164/hovercard">#5164</a>:
[v4.0] fix: also strip BOM from code strings in JS (<a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/TrickyPi/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/TrickyPi">@ TrickyPi</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5165"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5165/hovercard">#5165</a>:
[v4.0] warn for invalid annotations (<a class="user-mention notranslate"
data-hovercard-type="user"
data-hovercard-url="/users/lukastaegert/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/lukastaegert">@
lukastaegert</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5168"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5168/hovercard">#5168</a>:
[v4.0] Ensure we support new import attribute "with" syntax (<a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/lukastaegert/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/lukastaegert">@
lukastaegert</a>)</li>
<li><a href="https://snyk.io/redirect/github/rollup/rollup/pull/5169"
data-hovercard-type="pull_request"
data-hovercard-url="/rollup/rollup/pull/5169/hovercard">#5169</a>:
[v4.0] Expose parser (<a class="user-mention notranslate"
data-hovercard-type="user"
data-hovercard-url="/users/lukastaegert/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://snyk.io/redirect/github/lukastaegert">@
lukastaegert</a>)</li>
</ul>
      </li>
    </ul>
from <a
href="https://snyk.io/redirect/github/rollup/rollup/releases">rollup
GitHub release notes</a>
  </details>
</details>


<details>
  <summary><b>Commit messages</b></summary>
  </br>
  <details>
    <summary>Package name: <b>rollup</b></summary>
    <ul>
<li><a
href="https://snyk.io/redirect/github/rollup/rollup/commit/3d9c833c4fcb666301967554bac7ab0a0a698efe">3d9c833</a>
4.0.2</li>
<li><a
href="https://snyk.io/redirect/github/rollup/rollup/commit/b132bd43144b7699eda599ac5aa4693b7f5c0867">b132bd4</a>
Handle special characters before double underscores (#5178)</li>
<li><a
href="https://snyk.io/redirect/github/rollup/rollup/commit/fcab1f610fefb24621ce001dfb0831dd30e59ab3">fcab1f6</a>
4.0.1</li>
<li><a
href="https://snyk.io/redirect/github/rollup/rollup/commit/10eb5e8e43613ef91ee9e1bf0c46eb34dbac6110">10eb5e8</a>
Fix linux arm musl build (#5176)</li>
<li><a
href="https://snyk.io/redirect/github/rollup/rollup/commit/4611d8170cbd70a18d9096b166db975a2118f645">4611d81</a>
fix: ignores empty statements in class body that is returned by SWC
parser (#5173)</li>
<li><a
href="https://snyk.io/redirect/github/rollup/rollup/commit/7d88ef0709e3c4719b51ee206d0b664bcb4ff8b6">7d88ef0</a>
chore(deps): lock file maintenance minor/patch updates (#5172)</li>
<li><a
href="https://snyk.io/redirect/github/rollup/rollup/commit/95c2da8a46263b5f0f59e1e5cc85710e2fef8ea4">95c2da8</a>
Fix REPL artifacts workflow</li>
    </ul>

<a
href="https://snyk.io/redirect/github/rollup/rollup/compare/2f261358c62b4f9e62cb86bf99de8d4ff3668994...3d9c833c4fcb666301967554bac7ab0a0a698efe">Compare</a>
  </details>
</details>
<hr/>

**Note:** *You are seeing this because you or someone else with access
to this repository has authorized Snyk to open upgrade PRs.*

For more information: <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiI2ZDFmNzdkNi04ZTQ3LTQ3MmEtYTUwMy01YTAxNmY4MmMxMjMiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6IjZkMWY3N2Q2LThlNDctNDcyYS1hNTAzLTVhMDE2ZjgyYzEyMyJ9fQ=="
width="0" height="0"/>

🧐 [View latest project
report](https://app.snyk.io/org/woodpile37/project/edb93f5a-17e2-4a56-beb9-1796f0e58302?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)

🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/woodpile37/project/edb93f5a-17e2-4a56-beb9-1796f0e58302/settings/integration?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)

🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/woodpile37/project/edb93f5a-17e2-4a56-beb9-1796f0e58302/settings/integration?pkg&#x3D;rollup&amp;utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)

<!---
(snyk:metadata:{"prId":"6d1f77d6-8e47-472a-a503-5a016f82c123","prPublicId":"6d1f77d6-8e47-472a-a503-5a016f82c123","dependencies":[{"name":"rollup","from":"4.0.0","to":"4.0.2"}],"packageManager":"npm","type":"auto","projectUrl":"https://app.snyk.io/org/woodpile37/project/edb93f5a-17e2-4a56-beb9-1796f0e58302?utm_source=github&utm_medium=referral&page=upgrade-pr","projectPublicId":"edb93f5a-17e2-4a56-beb9-1796f0e58302","env":"prod","prType":"upgrade","vulns":[],"issuesToFix":[],"upgrade":[],"upgradeInfo":{"versionsDiff":2,"publishedDate":"2023-10-06T14:19:12.344Z"},"templateVariants":[],"hasFixes":false,"isMajorUpgrade":false,"isBreakingChange":false,"priorityScoreList":[]})
--->
@pi0 pi0 mentioned this pull request Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants