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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(deps): upgrade rollup, commonjs plugin #5274

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

rwaskiewicz
Copy link
Member

@rwaskiewicz rwaskiewicz commented Jan 18, 2024

DO NOT MERGE! I want to squash this as a feat() to surface the changes in the changelog. While I've tested this pretty well (subjective, I know 馃槈), I want folks to see this core piece of infra is being updated, as it impacts them as well.

What is the current behavior?

Our rollup infrastructure is lagging behind the latest. We're currently working on a few different modernization efforts for handling newer JS paradigms + infra; this is one of them.

GitHub Issue Number: N/A

What is the new behavior?

upgrade rollup to v2.56.3 and @rollup/plugin-commonjs to v21.1.

this commit raises these libraries to the highest version as possible
without introducing breaking changes. v2.57 has a bug in it that
requires @rollup/plugin-commonjs@22 for handling CJS-ESM interop.
that version of @rollup/plugin-commonjs requires
@rollup/plugin-node-resolve@13. however,
@rollup/plugin-node-resolve@11 has changes that would be breaking
for existing users (see #5269)

future upgrades will be slated to stencil v5.0.0.

Does this introduce a breaking change?

  • Yes
  • No - We do not believe this is going to introduce any breaking changes. However, folks upgrading to the version of Stencil this upgrade lands in are encouraged to file bugs early/often.

Testing

I created a dev build of Stencil, 4.10.0-dev.1705594858.56d0fba and used that in a CI run of Framework, which passed https://github.com/ionic-team/ionic-framework/actions/runs/7573347378

I did a pretty comprehensive diff of the changes that are going to be applied to the Ionic Framework as a part of this. For every minor version of rollup of @rollup/plugin-commonjs, I:

  • Built Stencil (npm run clean && npm ci && npm run build && npm pack)
  • Installed the tarball into Ionic Framework Core
  • Built Ionic Framework Core (npm run build)
  • Diffed the components, css, dist, hydrate, loader directories of the latest version I just built with the previous

In doing so, I noticed minimal changes. Happy to discuss them in a jam session or otherwise.

Other information

My notes for this are an attachment on the JIRA ticket.

Copy link
Contributor

--strictNullChecks error report

Typechecking with --strictNullChecks resulted in 1210 errors on this branch.

That's the same number of errors on main, so at least we're not creating new ones!

reports and statistics

Our most error-prone files
Path Error Count
src/dev-server/index.ts 37
src/mock-doc/serialize-node.ts 36
src/dev-server/server-process.ts 32
src/compiler/prerender/prerender-main.ts 22
src/testing/puppeteer/puppeteer-element.ts 22
src/runtime/client-hydrate.ts 20
src/screenshot/connector-base.ts 19
src/runtime/vdom/vdom-render.ts 17
src/compiler/config/test/validate-paths.spec.ts 16
src/dev-server/request-handler.ts 15
src/compiler/prerender/prerender-optimize.ts 14
src/compiler/sys/stencil-sys.ts 14
src/compiler/transpile/transpile-module.ts 14
src/sys/node/node-sys.ts 14
src/compiler/prerender/prerender-queue.ts 13
src/compiler/sys/in-memory-fs.ts 13
src/runtime/connected-callback.ts 13
src/runtime/set-value.ts 13
src/compiler/output-targets/output-www.ts 12
src/compiler/transformers/test/parse-vdom.spec.ts 12
Our most common errors
Typescript Error Code Count
TS2345 366
TS2322 364
TS18048 223
TS18047 99
TS2722 37
TS2532 26
TS2531 23
TS2454 14
TS2352 12
TS2790 11
TS2769 8
TS2538 8
TS2344 6
TS2416 6
TS2493 3
TS18046 2
TS2684 1
TS2430 1

Unused exports report

There are 14 unused exports on this PR. That's the same number of errors on main, so at least we're not creating new ones!

Unused exports
File Line Identifier
src/runtime/bootstrap-lazy.ts 21 setNonce
src/screenshot/screenshot-fs.ts 18 readScreenshotData
src/testing/testing-utils.ts 198 withSilentWarn
src/utils/index.ts 145 CUSTOM
src/utils/index.ts 269 normalize
src/utils/index.ts 7 escapeRegExpSpecialCharacters
src/compiler/app-core/app-data.ts 25 BUILD
src/compiler/app-core/app-data.ts 115 Env
src/compiler/app-core/app-data.ts 117 NAMESPACE
src/compiler/fs-watch/fs-watch-rebuild.ts 123 updateCacheFromRebuild
src/compiler/types/validate-primary-package-output-target.ts 61 satisfies
src/compiler/types/validate-primary-package-output-target.ts 61 Record
src/testing/puppeteer/puppeteer-declarations.ts 485 WaitForEventOptions
src/compiler/sys/fetch/write-fetch-success.ts 7 writeFetchSuccessSync

@rwaskiewicz rwaskiewicz marked this pull request as ready for review January 18, 2024 20:23
@rwaskiewicz rwaskiewicz requested a review from a team as a code owner January 18, 2024 20:23
upgrade rollup to v2.56.3 and `@rollup/plugin-commonjs` to v21.1.

this commit raises these libraries to the highest version as possible
without introducing breaking changes. v2.57 has a bug in it that
requires `@rollup/plugin-commonjs@22` for handling CJS-ESM interop.
that version of `@rollup/plugin-commonjs` requires
`@rollup/plugin-node-resolve@13`. however,
`@rollup/plugin-node-resolve@11` has changes that would be breaking
for existing users (see #5269)

in these various versions of both libraries, new flags have been added
to configure its output. for now, we continue to use the existing
configurations to prevent breaking users. these new configurations have
been recorded and tackled when we upgrade to newer versions of rollup
(as a part of stencil v5).

future upgrades will be slated to stencil v5.0.0.

STENCIL-595
@rwaskiewicz rwaskiewicz force-pushed the rwaskiewicz/rollup-v2-minor-upgrade branch from 61a6230 to 1baacd7 Compare January 18, 2024 22:11
@rwaskiewicz rwaskiewicz added this pull request to the merge queue Jan 18, 2024
Merged via the queue into main with commit 661120c Jan 18, 2024
120 checks passed
@rwaskiewicz rwaskiewicz deleted the rwaskiewicz/rollup-v2-minor-upgrade branch January 18, 2024 22:27
@christian-bromann
Copy link
Member

christian-bromann commented Jan 22, 2024

This patch has been released as a part of today's Stencil v4.11.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants