fix(split-pane): inline default literal for when#31164
Closed
gnbm wants to merge 2 commits into
Closed
Conversation
The `when` prop default was initialized from `QUERY['lg']`. Upcoming Stencil compiler changes resolve such identifier/element-access default initializers to their underlying literal in the generated `components.d.ts`, producing a drift between the committed file and a clean rebuild and breaking the Stencil Nightly Build. Inline the literal `'(min-width: 992px)'` so both the current and upcoming Stencil compiler emit identical output. Runtime behavior is unchanged: the shortcut lookup `QUERY[query] || query` continues to resolve user-supplied shortcuts (`'lg'`, `'md'`, etc.) via the `QUERY` map.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Author
|
Closing this — thanks for the review feedback. Summary of why this is not the right fix:
The approach in this PR (inlining the literal so neither old nor new Stencil produces a diff) papers over the review signal and strips the readability of the Closing and deleting the branch — no action needed in core today. |
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.
Issue number: resolves N/A
What is the current behavior?
IonSplitPane.whenis initialized toQUERY['lg'], whereQUERYis a localconstmapping shortcut keys to CSS media query strings.An upcoming Stencil compiler change (ionic-team/stencil#6728) resolves
@Propdefault initializers that reference identifiers / property accesses / element accesses to their underlying primitive literal when generatingcomponents.d.ts. Once that change ships, a clean rebuild of@ionic/corewill produce acomponents.d.tswhose@defaultJSDoc reads'(min-width: 992px)'instead of the committedQUERY['lg'], failing thegit diff --exit-codeguard intest-core-clean-build,build-angular,build-vue, andbuild-react.The Stencil Nightly Build (#931) — which is pointed at Stencil's
main— is already failing on exactly this diff:What is the new behavior?
core/src/components/split-pane/split-pane.tsx: inline the literal'(min-width: 992px)'as the prop default instead of dereferencingQUERY['lg'].core/src/components.d.ts: regenerate the two@defaultJSDoc lines (one inComponents, one inLocalJSX) to match.Both the current and upcoming Stencil compiler now emit identical output. Runtime behavior is unchanged: the shortcut lookup
QUERY[query] || querycontinues to resolve user-supplied shortcuts ('lg','md', etc.) via theQUERYmap at the same place as before.Does this introduce a breaking change?
The default value is identical (
'(min-width: 992px)'is exactly whatQUERY['lg']evaluated to). Consumers passing the shortcut'lg'/'md'/etc. towhenkeep working unchanged.Other information
core/src/componentsdid not find any other@Propdefault that uses an identifier / property / element access pattern, soIonSplitPanewas the only affected component.