Skip to content

fix(compiler): inherited @Element, _-prefixed members, plain-component imports, watch versioning, scopeCss $-patterns and decorator diagnostics - #7061

Merged
johnjenkins merged 3 commits into
v5from
fix/v5-various-quirky-bits
Nov 28, 2026
Merged

johnjenkins merged 3 commits into
v5from
fix/v5-various-quirky-bits

Conversation

@johnjenkins

@johnjenkins johnjenkins commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

What is the current behavior?

GitHub Issue Number/s: All found from https://github.com/popcorn245/StencilRS/blob/main/docs/quirks.md - thanks @popcorn245 !

  • Plain components (no members, styles or JSX) call __stencil_transformTag without importing it, so the module throws on load.
  • Members whose names start with _ (e.g. @State() _filters) are left out of the runtime metadata, so they aren't reactive.
  • @Element() declared on a base class is undefined in components that extend it.
  • The incremental compiler versions a file by its length plus first and last character, so watch mode can miss edits like 10 → 20.
  • scopeCss expands $&, $` and $' found in selectors (with commentOriginalSelector, and in @supports selector(...) conditions).
  • A numeric @Watch / @Listen argument crashes the compiler, and computed member names produce bogus members or invalid JS.
  • An unreadable decorator argument (e.g. a failing resolveVar()) discards every other diagnostic in the file.

What is the new behavior?

  • Plain components import transformTag.
  • _-prefixed members are kept. Only the internal _astNode field is filtered.
  • elementRef is inherited from base classes in all outputs (standalone, lazy, SSR), and the base class no longer emits an el field that would hide the getter.
  • Files are versioned by a content hash.
  • scopeCss uses function replacers, so selector text is inserted literally.
  • New compile errors: a non-string @Watch / @Listen argument, a computed name on @Event / @Element / @Method / @Watch / @Listen, and an unresolvable computed name on @Prop / @State / @AttachInternals.
  • A decorator argument that can't be read fails only its own class; the file's other diagnostics are kept.

Documentation

Does this introduce a breaking change?

  • Yes
  • No

Code that previously compiled into broken components now fails with a compile error (see BREAKING_CHANGES.md, "Unusable Decorator Names and Arguments Are Errors"). Migration: use a plain member name, or a const string / enum member for @Prop / @State / @AttachInternals.

Testing

  • Regression unit tests for each fix (decorator-diagnostics.spec.ts, native-component, lazy-component, parse-extends, parse-states, incremental-compiler, scope-css). The versioning and scopeCss tests were checked to fail without the fix.
  • test/runtime extends-element: inherited @Element() read from the base class, from render() and from componentWillLoad (lazy, standalone, standalone-predefined). All 6 tests fail without the fix.
  • pnpm build, typecheck, test, lint, format, spellcheck and knip pass.

Other information

Found by cross-checking against an external parity suite of Stencil v5 behaviour.

…t imports, watch versioning, scopeCss $-patterns and decorator diagnostics
@johnjenkins
johnjenkins requested a review from a team as a code owner November 28, 2026 00:19
@johnjenkins
johnjenkins merged commit b9ffd21 into v5 Nov 28, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant