fix: linker uses version-aware standalone defaulting for pre-v19 libraries#90
Merged
Brooooooklyn merged 1 commit intomainfrom Mar 6, 2026
Merged
Conversation
…aries The linker unconditionally defaulted `standalone` to `true` when `isStandalone` was absent from partial declarations. Angular v12–v18 libraries default to `false`; only v19+ defaults to `true`. This caused NgModule-declared components from older libraries (e.g. PrimeNG v12) to be incorrectly marked standalone, breaking directive resolution (NG0303). Add `get_default_standalone_value()` using the `semver` crate to read the `version` field and return `major >= 19`. The special `0.0.0-PLACEHOLDER` dev sentinel also defaults to `true`, matching the Angular reference linker. - Fix #87 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
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.

The linker unconditionally defaulted
standalonetotruewhenisStandalonewas absent from partial declarations. Angular v12–v18 libraries default to
false; only v19+ defaults totrue. This caused NgModule-declared componentsfrom older libraries (e.g. PrimeNG v12) to be incorrectly marked standalone,
breaking directive resolution (NG0303).
Add
get_default_standalone_value()using thesemvercrate to read theversionfield and returnmajor >= 19. The special0.0.0-PLACEHOLDERdev sentinel also defaults to
true, matching the Angular reference linker.standalone: truefor pre-v19 NgModule-declared components/directives/pipes #87Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Note
Medium Risk
Changes code generation for linked directives/components/pipes when
isStandaloneis omitted, which can affect runtime behavior across many Angular libraries. Risk is mitigated by targeted semver parsing and extensive new regression tests across version ranges and edge cases.Overview
Fixes the linker to stop defaulting
standalonetotrueunconditionally whenisStandaloneis missing from partial declarations.Adds semver-based version detection (
version.major >= 19, with special handling for0.0.0-PLACEHOLDER) and applies it toɵɵdefineComponent,ɵɵdefineDirective, andɵɵdefinePipeoutput so pre-v19 libraries default tostandalone: false.Introduces a
semverdependency and adds regression tests covering v12/v18/v19+/prerelease/placeholder behavior and explicitisStandaloneoverrides.Written by Cursor Bugbot for commit 404107d. This will update automatically on new commits. Configure here.