You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repo contains a very simple reproduction case for a bug when using Ionic in conjunction with your own design system utilizing Stencil. It is dead simple to recreate, and uses the component starter and pwa toolkit projects from using npm create stencil.
Run npm install and run npm run build. Then run npm link.
Navigate to the ionic-pwa-toolkit-app directory and run npm install. Then run npm link my-design-system.
Run npm run build and serve up the www with httpster or something
Open browser and navigate to the app on localhost:3333 or whatever port
Observe the app works 🎉
Now for the bug:
In the my-design-system project, in the my-component render function change the ion-button tag to an ion-app tag.
Run npm run build in the my-design-system project
Navigate to ionic-pwa-toolkit-app directory and run npm run build
Serve up the www with httpster or something
Open browser and navigate to the app on localhost:3333 or whatever port
Observe the app is broken and see the errors in the console
Notes:
This bug only happens in prod mode and I believe it's related to using multiple styleUrls and defining my own modes.
If you debug in the stencil code, in the loadModule function there is ultimately a list of modes available. In the first case with ion-button, there are my two modes available (msb, bch) and the two ionic modes (md, ios). When using ion-app, there are only my two modes available, no references to md or ios.
In the Ionic source code, I noticed that ion-button uses styleUrls for md and ios. ion-app does not use different styleUrls for each mode.
The text was updated successfully, but these errors were encountered:
This would be a really great bug to fix to better support design systems and rendering totally different styles like Ionic does. Basically someone could implement n themes in a scoped, maintainable way if this feature worked as intended.
This issue has been resolved in Stencil v4.8.2 by #5131. As a result, I'm going to close this out. Should this reappear, please feel free to open a new issue. Thanks!
Stencil version:
I'm submitting a:
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/
Current behavior:
Expected behavior:
I think it should just work TM
Steps to reproduce:
This repo contains a very simple reproduction case for a bug when using Ionic in conjunction with your own design system utilizing Stencil. It is dead simple to recreate, and uses the component starter and pwa toolkit projects from using
npm create stencil
.https://github.com/danbucholtz/stencil-ionic-design-system-mode-bug
my-design-system
directorynpm install
and runnpm run build
. Then runnpm link
.ionic-pwa-toolkit-app
directory and runnpm install
. Then runnpm link my-design-system
.npm run build
and serve up thewww
with httpster or somethingNow for the bug:
my-design-system
project, in themy-component
render function change theion-button
tag to anion-app
tag.npm run build
in themy-design-system
projectionic-pwa-toolkit-app
directory and runnpm run build
www
with httpster or somethingNotes:
This bug only happens in prod mode and I believe it's related to using multiple
styleUrls
and defining my own modes.If you debug in the stencil code, in the loadModule function there is ultimately a list of modes available. In the first case with
ion-button
, there are my two modes available (msb, bch) and the two ionic modes (md, ios). When usingion-app
, there are only my two modes available, no references tomd
orios
.In the Ionic source code, I noticed that
ion-button
usesstyleUrls
formd
andios
.ion-app
does not use differentstyleUrls
for each mode.The text was updated successfully, but these errors were encountered: