Repository navigation
Conversation
…pressions Babel's linker links every ɵɵngDeclare* call; this one walked only some expression kinds and missed declarations inside array and object literals, `new` arguments, member and binary expressions, templates and awaits. A library compiled with Deepkit's runtime types records each static initializer as a function in a `static __type = [...]` array, so every class carried an unlinked copy of its declarations, whose `ngImport: i0` kept all of @angular/core in the bundle (+130 KB minified in an app using @deepkit/desktop-ui).
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.
Babel's linker (
@angular/compiler-cli/linker/babel) links everyɵɵngDeclare*call it meets. This linker walked only some expression kinds and left declarations unlinked inside array and object literals,newarguments, static and computed member expressions, unary and binary expressions, template literals andawait.That matters for libraries compiled with Deepkit's runtime types, which record each static initializer as a function in a
static __type = [...]array:Every class then carried an unlinked copy of its declarations, and their
ngImport: i0kept all of@angular/corein the bundle (+130 KB minified in an app using@deepkit/desktop-ui).walk_expressionnow descends into those expression kinds.test_link_declarations_nested_in_arrays_and_objects(tests/linker_test.rs) links declarations in each position and fails without the change.