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

feat!: rollup v4 #14508

Merged
merged 41 commits into from
Oct 17, 2023
Merged

feat!: rollup v4 #14508

merged 41 commits into from
Oct 17, 2023

Conversation

sapphi-red
Copy link
Member

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

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
@sapphi-red

This comment was marked as outdated.

@vite-ecosystem-ci

This comment was marked as outdated.

@sapphi-red
Copy link
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

Copy link
Member

@bluwy bluwy left a comment

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.

packages/vite/src/node/server/pluginContainer.ts Outdated Show resolved Hide resolved
@sapphi-red
Copy link
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

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

@bluwy
Copy link
Member

bluwy commented Oct 6, 2023

Ah sorry about the additional change. I think GitHub does an internal merge by default when testing. Seem to see it happening more recently.

@sapphi-red
Copy link
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
Member Author

/ecosystem-ci run

@vite-ecosystem-ci
Copy link

vite-ecosystem-ci bot commented Oct 12, 2023

📝 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
Copy link
Member

@bluwy bluwy left a comment

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
Copy link
Member

bluwy commented Oct 15, 2023

/ecosystem-ci run

@vite-ecosystem-ci
Copy link

vite-ecosystem-ci bot commented Oct 15, 2023

📝 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
10 checks passed
@segevfiner
Copy link
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
Copy link
Member

bluwy commented Oct 17, 2023

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