Repository navigation
Conversation
The custom elements build has inlined the Stencil runtime since e04eccc (externalRuntime: false), and none of the package's export targets (dist, loader, components, icons) import @stencil/core at runtime. The only shipped artifact that references it, dist/collection, is consumed by Stencil projects that provide their own copy at build time. Moving it to devDependencies removes it from the dependency tree of every `npm install ionicons` consumer. Fixes ionic-team#1519
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1519
Problem
npm install ioniconspulls in@stencil/coreas a runtime dependency, even though nothing shipped in the package needs it at runtime.Why it is unused at runtime
Since e04eccc (v8.0.0) the custom elements output target is generated with
externalRuntime: false, which inlines the Stencil runtime intocomponents/:dist/(main + loader): self-contained, no stencil importscomponents/(custom elements + direct component path): Stencil runtime inlinedicons/: data-URL strings onlyThe only shipped artifact that references
@stencil/coreisdist/collection, which is not reachable through theexportsmap. It is consumed by Stencil projects that re-compile the collection, and those projects necessarily provide their own@stencil/coreat build time.Verified on the published
8.1.1tarball: none of the entry points (dist/index.js,dist/index.cjs.js,dist/loader/index.js,components/index.js,components/ion-icon.js,icons/index.*) contains an@stencil/coreimport.Change
Move
@stencil/corefromdependenciestodevDependencies. The lockfile picks up onlydev/peermarkers — no version or resolved URL changed.Verification
npm run buildbefore/after: byte-identical output (compared full hash trees ofdist/,components/,icons/)npm run test.spec: 50 passed, 2 skipped — same before and afternpm packbefore/after, each installed into a clean consumer project:ionicons └── @stencil/core@4.45.6(3 packages installed)ioniconsalone (1 package), nonode_modules/@stencil/core@stencil/coreis not resolvable:import 'ionicons',import 'ionicons/components/ion-icon.js',require('ionicons'),require('ionicons/icons')all workdefineCustomElement()registersion-icon;addIcons({ checkmark })+<ion-icon name="checkmark">renders the sanitized SVG into the shadow DOMgetAssetPathfallback warning instead of throwingnpm run prettier.dry-run: cleanRisk
None for the documented entry points — they do not import
@stencil/core. The only behavioral difference is that consumers no longer receive a transitive@stencil/corecopy; a project that relied on it being hoisted would already have to declare it itself, because it can only matter in a Stencil build that provides its own copy.