Skip to content

chore(deps): update stencil core to v5 - #31403

Draft
johnjenkins wants to merge 12 commits into
ionic-team:mainfrom
johnjenkins:update-stencil-core-v5
Draft

johnjenkins wants to merge 12 commits into
ionic-team:mainfrom
johnjenkins:update-stencil-core-v5

Conversation

@johnjenkins

@johnjenkins johnjenkins commented Aug 25, 2026 •

Copy link
Copy Markdown

I'm mainly just using this as an example testing @stencil/core v5 against a complex project. Additionally, perhaps it'll be helpful for upgrading when the time comes :)

Included:

  • updating stencil core to version 5 (mainly using auto migrations)
  • swapping out the integrated jest harness for an independent vitest setup
  • updating e2e test paths
  • general spruce. Changing the default module type to esm
  • some css formatting fixes

Build times are inline with other performance reports - around 40-100% improvements depending on the type of build.

atm I've had to disable ionicons due to ionic-team/ionicons#1513 so some e2e tests which rely on icons are failing. Will enable once (if) it's fixed

@vercel

vercel Bot commented Aug 25, 2026

Copy link
Copy Markdown

@johnjenkins is attempting to deploy a commit to the Ionic Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added package: core @ionic/core package package: angular @ionic/angular package package: vue @ionic/vue package package: react @ionic/react package labels Aug 25, 2026
@vercel

vercel Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ionic-framework Error Error Nov 20, 2026 1:58pm UTC

Request Review

Resolves conflicts with main and ports main's new and updated unit
tests from Jest to Vitest:

- package.json: keep Stencil 5 alpha, Vitest and the current output
  target versions (react 1.7 / vue 0.14.7 require Stencil >=5.0.0-beta.18),
  take main's Playwright and axe updates
- input: keep the HTMLElement cast with main's StartEndContainerController
- hardware-back-button spec: take main's close watcher rewrite and port it
- port remaining jest.* usage and add the stencil environment to new
  DOM specs from main
- click-controller spec: remove the document listener after each test
- point test pages added on main at /dist/loader-bundle
- ssr: output to hydrate/ so @ionic/core/hydrate keeps its path, and
  emit CJS since v5 no longer does by default
- loader-bundle: emit CJS
- package.json exports: point at dist/loader-bundle and the v5 .cjs
  file names
- rename CommonJS scripts and the ESLint config to .cjs, since the
  package is now "type": "module"
- lazy-imports: check dist/loader-bundle/esm and cjs
@brandyscarney

Copy link
Copy Markdown
Member

Hey! I merged main into this branch and pushed two commits.

Merge (d432c7a): I ported main's newer Jest specs to Vitest, fixed a listener leak in click-controller.spec.ts, and pointed the new test pages from main at /dist/loader-bundle. I kept your Stencil/Vitest setup, and left the React/Vue output targets at 1.6.2 / 0.14.1, since the newer versions need Stencil >=5.0.0-beta.18.

v5 fixes (5622c45): ssr now outputs to hydrate/ so @ionic/core/hydrate keeps its path. loader-bundle and ssr emit CJS again, and exports points at the new v5 files. I also renamed the ESLint config and a few CommonJS scripts to .cjs, since "type": "module" broke them. Feel free to revert any of my changes if you'd rather handle this differently!

The build, all unit tests and test.lazy-imports pass locally. Still open:

  • Possible Stencil bug: with cjs: true, the chunks in dist/loader-bundle/cjs/ are still .js, so under "type": "module" require('@ionic/core') and require('@ionic/core/loader') fail. A {"type":"commonjs"} package.json in that folder fixes it.
  • test.treeshake: the LogLevel enum in src/utils/logging no longer tree-shakes under v5.
  • Lint: import/order in toast/animations/utils.ts, and a stylelint error at range.md.scss:191.

Let us know if there's anything you need from us for this!

@brandyscarney brandyscarney changed the title deps: Update to use stencil core v5 chore(deps): update stencil core to v5 Nov 19, 2026
@johnjenkins

johnjenkins commented Nov 20, 2026 •

Copy link
Copy Markdown
Author

hey @brandyscarney 👋 tysm for trying it out and raising those things!
I've fixed the linting bits now.
Additionally, for the cjs thing I made stenciljs/core#7027 (and released in v5.0.0-rc.8)

Integrating the latest rc raised a couple of other bits: css vars with preceding comments are now added to docs which swept in some internal / private ionic things. I've removed those with @internal markers.

re LogLevel tree-shaking (rollup can't drop { [LogLevel.OFF]: 0 }). I think this is the same in v4? < I don't think any bundler could read the enum IIFE as 'side-effect-free' (I don't think test.treeshake runs in ci?)

This branch had an error being deployed

1 failed deployment
Preview — dd3e9396 Deployed Nov 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: angular @ionic/angular package package: core @ionic/core package package: react @ionic/react package package: vue @ionic/vue package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants