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

chore: upgrade rollup to 3.25.2 #13608

Merged
merged 9 commits into from Jun 25, 2023
Merged

Conversation

sun0day
Copy link
Member

@sun0day sun0day commented Jun 24, 2023

Description

Additional context


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.

@stackblitz
Copy link

stackblitz bot commented Jun 24, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@sun0day
Copy link
Member Author

sun0day commented Jun 25, 2023

It seems that rollup version upgrade logic didn't follow the semantic versioning. I was thinking whether vite should keep the rollup version in the published package the same as vite main branch's or use ~x.y.z at least. @patak-dev @bluwy @sapphi-red

@patak-dev
Copy link
Member

/ecosystem-ci run

@vite-ecosystem-ci
Copy link

vite-ecosystem-ci bot commented Jun 25, 2023

📝 Ran ecosystem CI: Open

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

@patak-dev
Copy link
Member

It seems that rollup version upgrade logic didn't follow the semantic versioning. I was thinking whether vite should keep the rollup version in the published package the same as vite main branch's or use ~x.y.z at least. @patak-dev @bluwy @sapphi-red

For reference, we already did this for a while last year, after other type changes in a rollup minor brought issues downstream. Since it is rare, we ended up reverting with time so projects could use newer versions of rollup sooner. It is hard to know what is best here. I'm leaning towards keeping the current scheme, interested in others' opinions.

@bluwy
Copy link
Member

bluwy commented Jun 25, 2023

Yeah I think it's probably fine to keep it as-is for now. We have close development with Rollup, so we can followup the type changes as needed.

The PR looks good though. Could you also update it to 3.25.2 to fix #13571? Also, when I run pnpm i locally, pnpm creates a new line at the end of pnpm-lock.yaml (pnpm 8.6.3), the PR doesn't seem to have that new line 🤔

@sun0day sun0day changed the title chore: upgrade rollup to 3.25.1 chore: upgrade rollup to 3.25.2 Jun 25, 2023
@@ -15,7 +15,7 @@ export function prepareError(err: Error | RollupError): ErrorPayload['err'] {
id: (err as RollupError).id,
frame: strip((err as RollupError).frame || ''),
plugin: (err as RollupError).plugin,
pluginCode: (err as RollupError).pluginCode,
pluginCode: (err as RollupError).pluginCode?.toString(),
Copy link
Member Author

@sun0day sun0day Jun 25, 2023

Choose a reason for hiding this comment

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

Not sure whether we should deal with non-(string|number)-type pluginCode and code.

Copy link
Member

Choose a reason for hiding this comment

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

I think that's fine for now 👍

@patak-dev
Copy link
Member

All failing CIs are also failing in main, except for vite-plugin-ssr. @brillout I think we should merge this PR and release a new beta so we give a week more to others to try it out. I'll do that now, would you check why updating rollup is affecting your tests?

@patak-dev patak-dev merged commit 5497abe into vitejs:main Jun 25, 2023
14 checks passed
@brillout
Copy link
Contributor

@patak-dev Fix pushed on VPS's main branch.

But I get another error which seems unrelated to Rollup:

[stderr] failed to load config from boilerplates/boilerplate-react-ts/vite.config.ts
[stderr] error during build:
Error: The URL must be of scheme file at boilerplates/boilerplate-react-ts/vite.config.ts
    at loadConfigFromBundledFile (file:///home/runner/work/vite-plugin-ssr/vite-plugin-ssr/node_modules/.pnpm/vite@4.4.0-beta.3_@types+node@18.16.5/node_modules/vite/dist/node/chunks/dep-64acfab2.js:65812:19)

The error originates from:

// node_modules/vite/dist/node/chunks/dep-64acfab2.js:65812:19

  65798 async function loadConfigFromBundledFile(fileName, bundledCode, isESM) {                                                                                            
  65799     // for esm, before we can register loaders without requiring users to run node                                                                                  
  65800     // with --experimental-loader themselves, we have to do a hack here:                                                                                            
  65801     // convert to base64, load it with native Node ESM.                                                                                                             
  65802     if (isESM) {                                                                                                                                                    
  65803         try {                                                                                                                                                       
  65804             // Postfix the bundled code with a timestamp to avoid Node's ESM loader cache                                                                           
  65805             const configTimestamp = `${fileName}.timestamp:${Date.now()}-${Math.random()                                                                            
  65806                 .toString(16)                                                                                                                                       
  65807                 .slice(2)}`;                                                                                                                                        
  65808             return (await dynamicImport('data:text/javascript;base64,' +                                                                                            
  65809                 Buffer.from(`${bundledCode}\n//${configTimestamp}`).toString('base64'))).default;                                                                   
  65810         }                                                                                                                                                           
  65811         catch (e) {                                                                                                                                                 
  65812             throw new Error(`${e.message} at ${fileName}`);                                                                                                         
  65813         }                                                                                                                                                           
  65814     } 

Let me know if you want a reproduction for that one.

@patak-dev
Copy link
Member

Yes, please create a new issue. We're trying to avoid the temporal bundled config file in 4.4

@brillout
Copy link
Contributor

Done: #13631.

@ailadas

This comment was marked as spam.

xinxinhe1810 pushed a commit to xinxinhe1810/vite that referenced this pull request Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants