forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): export a value for InjectFlags (angular#27279)
A recent commit (probably 2c7386c) has changed the import graph of the DI types in core, and somehow results in the ngc compiler deciding to re-export core DI types from application factories which tangentially use inject(). This is not really surprising; ngc's import graph can be very unstable. However, this results in a re-export of InjectFlags surviving JS compilation. InjectFlags was a const enum, akin to an interface in TS, with no runtime repesentation. This causes a warning to be emitted by Webpack when it sees the re-export of InjectFlags. This commit avoids the issue by removing 'const' from the declaration of InjectFlags, causing it to have a runtime value. This is a temporary fix. The real fix will be for ngc to no longer write exports of const enums. Testing strategy: manually verified. Due to the problem only manifesting when recompiling after a change and then running Webpack, there is no existing framework via which this could be easily tested with an integration test. Additionally, the potential for this issue is gone in Ivy, so this solution is only temporarily needed. Fixes angular#27251. PR Close angular#27279
- Loading branch information
Showing
7 changed files
with
19 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,6 +86,9 @@ | |
{ | ||
"name": "INJECTOR_SIZE" | ||
}, | ||
{ | ||
"name": "InjectFlags" | ||
}, | ||
{ | ||
"name": "IterableChangeRecord_" | ||
}, | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -176,6 +176,9 @@ | |
{ | ||
"name": "Inject" | ||
}, | ||
{ | ||
"name": "InjectFlags" | ||
}, | ||
{ | ||
"name": "InjectionToken" | ||
}, | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,9 @@ | |
{ | ||
"name": "Inject" | ||
}, | ||
{ | ||
"name": "InjectFlags" | ||
}, | ||
{ | ||
"name": "InjectionToken" | ||
}, | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,9 @@ | |
{ | ||
"name": "INJECTOR_SIZE" | ||
}, | ||
{ | ||
"name": "InjectFlags" | ||
}, | ||
{ | ||
"name": "IterableChangeRecord_" | ||
}, | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -371,6 +371,9 @@ | |
{ | ||
"name": "Inject" | ||
}, | ||
{ | ||
"name": "InjectFlags" | ||
}, | ||
{ | ||
"name": "InjectionToken" | ||
}, | ||
|
This file contains 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