Sponsored Content
Skip to content

feat!: rollup v4 - #14508

Merged
bluwy merged 41 commits into
vitejs:mainfrom
sapphi-red:feat/rollup-4
Oct 17, 2023
Merged

feat!: rollup v4#14508
bluwy merged 41 commits into
vitejs:mainfrom
sapphi-red:feat/rollup-4

Conversation

@sapphi-red

@sapphi-red sapphi-red commented Sep 30, 2023

Copy link
Copy Markdown
Member

Description

This PR upgrades Rollup to v4.

Remaining TODOs:

refs rollup/rollup#5140
close #13342

Additional context

this.parse

Rollup now uses SWC with a custom tree converter (converts SWC AST to ESTree AST) to parse JS.

This PR gets this.parse from rollup by creating a dummy bundle and uses that in dev. I'm not sure if this is legal 😅
This way we can be 100% compatible with rollup.

The other way is to use acorn in dev. But it seems even if we added both acorn-import-attributes and acorn-import-assertions, acorn cannot parse asserts. So we have to create our own acorn plugin or remove support for either asserts if we take this way.

skipSelf: true is now default

Maybe #13852 should be given more priority now.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@sapphi-red sapphi-red added breaking change p3-significant High priority enhancement (priority) labels Sep 30, 2023
Comment thread packages/vite/src/node/ssr/ssrTransform.ts Outdated
Comment thread playground/resolve/utf8-bom/main.js Outdated
@sapphi-red

This comment was marked as outdated.

@vite-ecosystem-ci

This comment was marked as outdated.

@sapphi-red

Copy link
Copy Markdown
Member Author

Most of the fails are type incompatibility errors.

This analog fail might be a bug in rollup.
https://github.com/vitejs/vite-ecosystem-ci/actions/runs/6363871721/job/17279764712#step:8:866

@bluwy bluwy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look great so far. Nice to see there's not too many change needed on our end.

Comment thread packages/vite/src/node/server/pluginContainer.ts Outdated
@sapphi-red

Copy link
Copy Markdown
Member Author

Back to green 🫡
Lint CI is failing because vitepress is failing to build. I guess vitepress needs to tweak some code (replace \w+ with [-\w]+ in some places) to work with the new hash algorithm.

@lukastaegert

Copy link
Copy Markdown

All Rollup plugins (except sucrase, there was a weird hiccup in the pipeline) have been updated (thought the changelog does not reflect it...).

@sapphi-red

Copy link
Copy Markdown
Member Author

No problem 😃 Hmm, I see. Yeah, it seems to be working like that 🧐
https://github.com/vitejs/vite/actions/runs/6430200937/job/17461260148?pr=14508#step:2:81

@sapphi-red

Copy link
Copy Markdown
Member Author

/ecosystem-ci run

@vite-ecosystem-ci

vite-ecosystem-ci Bot commented Oct 12, 2023

Copy link
Copy Markdown

📝 Ran ecosystem CI: Open

suite result
analogjs ✅ success
astro ❌ failure
histoire ❌ failure
ladle ✅ success
laravel ✅ success
marko ✅ success
nuxt ❌ failure
nx ❌ failure
previewjs ✅ success
qwik ❌ failure
rakkas ✅ success
sveltekit ❌ failure
unocss ❌ failure
vike ❌ failure
vite-plugin-pwa ✅ success
vite-plugin-react ✅ success
vite-plugin-react-pages ❌ failure
vite-plugin-react-swc ✅ success
vite-plugin-svelte ✅ success
vite-plugin-vue ❌ failure
vite-setup-catalogue ✅ success
vitepress ❌ failure
vitest ❌ failure

bluwy
bluwy previously approved these changes Oct 13, 2023

@bluwy bluwy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. If we want to stay on track with the release schedule, I think we should merge this as soon as possible.

To make the ecosystem-ci slightly greener so we don't catch type issues, maybe we can override rollup to v4 too.

@bluwy

bluwy commented Oct 15, 2023

Copy link
Copy Markdown
Member

/ecosystem-ci run

@vite-ecosystem-ci

vite-ecosystem-ci Bot commented Oct 15, 2023

Copy link
Copy Markdown

📝 Ran ecosystem CI: Open

suite result
analogjs ✅ success
astro ❌ failure
histoire ✅ success
ladle ✅ success
laravel ✅ success
marko ✅ success
nuxt ✅ success
nx ❌ failure
previewjs ✅ success
qwik ❌ failure
rakkas ✅ success
sveltekit ❌ failure
unocss ✅ success
vike ❌ failure
vite-plugin-pwa ❌ failure
vite-plugin-react ✅ success
vite-plugin-react-pages ✅ success
vite-plugin-react-swc ✅ success
vite-plugin-svelte ✅ success
vite-plugin-vue ❌ failure
vite-setup-catalogue ✅ success
vitepress ✅ success
vitest ❌ failure

bluwy
bluwy previously approved these changes Oct 16, 2023
@bluwy
bluwy merged commit dee6067 into vitejs:main Oct 17, 2023
@segevfiner

Copy link
Copy Markdown
Contributor

Isn't parse exposed from rollup/parseAst https://rollupjs.org/javascript-api/#accessing-the-parser, so you don't really need the dummy bundle trick?

@bluwy

bluwy commented Oct 17, 2023

Copy link
Copy Markdown
Member

Yeah we've updated to use that now. It was discussed at #14508 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change p3-significant High priority enhancement (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rollup Cannot call "addWatchFile" after the build has finished. with manualChunks and build --watch

4 participants