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(deps): update dependency @rollup/plugin-commonjs to v22 #7886

Closed
wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 24, 2022

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@rollup/plugin-commonjs ^21.1.0 -> ^22.0.0 age adoption passing confidence

Release Notes

rollup/plugins

v22.0.0

2022-04-24

Breaking Changes
  • fix: add heuristic to deoptimize requires after calling imported function (requires rollup@2.68.0) (#​1038)
  • feat: reimplement dynamic import handling (requires Node 12, no longer supports require.cache) (#​1038)
Bugfixes
  • fix: support CJS modules re-exporting transpiled ESM modules (#​1165)
  • fix: Warn when plugins do not pass options to resolveId (#​1038)
  • fix: Do not change semantics when removing requires in if statements (#​1038)
  • fix: handle external dependencies when using the cache (#​1038)
  • fix: proxy all entries to not break legacy polyfill plugins (#​1038)
  • fix: use correct version and add package exports (#​1038)
  • fix: validate node-resolve peer version (#​1038)
  • fix: inject module name into dynamic require function (#​1038)
  • fix: do not transform "typeof exports" for mixed modules (#​1038)
  • fix: attach correct plugin meta-data to commonjs modules (#​1038)
Features
  • feat: expose plugin version (#​1038)
  • feat: throw for dynamic requires from outside the configured root (#​1038)
  • feat: add dynamicRequireRoot option (#​1038)
  • feat: auto-detect conditional requires (#​1038)
  • feat: limit ignoreTryCatch to external requires (#​1038)
  • feat: make namespace callable when requiring ESM with function default (#​1038)
  • feat: Infer type for unidentified modules (#​1038)
  • feat: automatically wrap cyclic modules (#​1038)
  • feat: add strictRequires option to wrap modules (#​1038)
Updates
  • refactor: deconflict helpers only once globals are known (#​1038)

Configuration

📅 Schedule: "before 3am on Monday" (UTC).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, click this checkbox.

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot added the dependencies Pull requests that update a dependency file label Apr 24, 2022
@fwouts
Copy link
Contributor

fwouts commented Apr 24, 2022

This PR should fix #2139.

@fwouts
Copy link
Contributor

fwouts commented Apr 25, 2022

I managed to fix the serve tests in https://github.com/fwouts/vite/tree/renovate/rollup-plugin-commonjs-22.x but a lot of build tests are failing. It could be because of rollup/plugins#1169, although I'm not familiar enough with Vite internals to be able to tell.

@NMinhNguyen
Copy link
Contributor

Thanks for your work on this @fwouts. I also raised #7894 because bumping the plugin alone isn't sufficient - we need to bump Rollup too. But I guess you're right in that there's an issue upstream that needs fixing first..

@patak-dev
Copy link
Member

I think the change in plugin-commonjs is big enough to push it to the next minor/major. There may be bugs that are going to surface in the next weeks. We're going to start the Vite 3 beta period soon, so let's merge it then.

@patak-dev patak-dev added this to the 3.0 milestone Apr 25, 2022
@renovate renovate bot force-pushed the renovate/rollup-plugin-commonjs-22.x branch from 9a06895 to e589e0d Compare May 9, 2022 07:38
@renovate renovate bot force-pushed the renovate/rollup-plugin-commonjs-22.x branch from e589e0d to 239047f Compare May 9, 2022 08:32
@patak-dev
Copy link
Member

We are no longer going to use @rollup/plugin-commonjs by default in Vite v3. I'll remove the 3.0 milestone from this PR as it is no longer a blocker for v3. But it would still be good to look into what is the problem here and be able to use the latest version for users that can't migrate to the new esbuild-based interop.

@patak-dev patak-dev removed this from the 3.0 milestone May 29, 2022
@patak-dev patak-dev added the p2-nice-to-have Not breaking anything but nice to have (priority) label May 29, 2022
@patak-dev
Copy link
Member

Actually, closing this one as #7894 is more advanced towards being able to update.

@patak-dev patak-dev closed this May 29, 2022
@renovate
Copy link
Contributor Author

renovate bot commented May 29, 2022

Renovate Ignore Notification

As this PR has been closed unmerged, Renovate will ignore this upgrade and you will not receive PRs for any future 22.x releases. However, if you upgrade to 22.x manually then Renovate will reenable minor and patch updates automatically.

If this PR was closed by mistake or you changed your mind, you can simply rename this PR and you will soon get a fresh replacement PR opened.

@renovate renovate bot deleted the renovate/rollup-plugin-commonjs-22.x branch May 29, 2022 22:20
@dantman
Copy link

dantman commented May 30, 2022

@patak-dev rollup/plugins#988 is probably the primary reason for some users to want the updated plugin-commonjs. There is a collection of libraries using cyclic requires in ways that the version of plugin-commonjs that Vite is currently using breaks. So those libraries just cannot be used in Vite.

@kskalski
Copy link

migrate to the new esbuild-based interop

@patak-dev Any docs on what it will take to do so?

There is a collection of libraries using cyclic requires

Right, which makes me wonder if "esbuild-based interop" will solve that naturally or will it become even farther from being solved by completely eliminating those libraries (in my case pulled as dependency indirectly) from being used in Vite.

@patak-dev
Copy link
Member

@dantman @kskalski you can already try esbuild-based interop in vite@3.0.0-alpha.7, it is the default at least during the alpha. If there is a bug in esbuild with cyclic requires, then it would be good to report it to esbuild so it is fixed. But IIUC, this wasn't the case. Please report back, there may still be other issues though as this new code path is new and we need to polish it before the stable release.
And about the update to rollup plugin-commonjs v22, check #7894. I closed this issue and removed both from the v3 milestone because looks like it isn't a blocker anymore but we still need to make Vite compatible with it. If someone finds out a way to move #7894, contribution welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

requires to access .default after build while it's not required in dev (CJS dependency)
6 participants