Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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 #30822
What is the current behavior?
Boolean props have to be bound explicitly. A bare attribute resolves to the empty string, so an editor reports
TS2322: Type 'string' is not assignable to type 'boolean'on markup like this:It compiles and works at runtime, because Stencil coerces boolean attributes on the element. The problem is what the Angular compiler accepts.
What is the new behavior?
Boolean props can now be set by attribute presence:
@stencil/angular-output-targetto 1.5.0 and enables its newbooleanAttributesoption on both Angular output targets.nullandundefinedare passed through rather than coerced tofalse, so props that treat them as a third state keep working.ion-item detail,ion-modal handleandion-content forceOverscrollall resolveundefinedto a mode-specific default.core's build. Onlycore/package.json,core/package-lock.jsonandcore/stencil.config.tsare hand-edited.Does this introduce a breaking change?
Other information
The dependency bump is the fix rather than an unrelated update. The generated proxies are overwritten on every
corebuild, so this could not be solved in this repo. The change was made upstream in stenciljs/output-targets#842 and released in 1.5.0.There is no new test here, which is deliberate. Neither of the two testing idioms available can cover this:
What the option changes is the emitted declaration, and that behavior is covered upstream by unit tests and a type-level test pinning the transform's accepted type.
Verified against
packages/angular/test/apps/ng18withstrictTemplatesenabled, consuming the built package:<ion-item button detail>compiles.<ion-item [button]="42">fails withType '42' is not assignable to type 'string | boolean | null | undefined', which shows type checking genuinely engages rather than silently passing.