-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bazel/spec-bundling): support specifying strategy for handling u…
…nknown linker declarations This is necessary to that we can use the spec bundle rule in Angular itself where Angular packages are using `0.0.0-PLACEHOLDER`.
- Loading branch information
1 parent
5df32aa
commit 04a54cd
Showing
6 changed files
with
74 additions
and
7 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
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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// This is an ESM import that would usually break within `jasmine_node_test` because it | ||
// consumes devmode CommonJS sources and `rules_nodejs` does not support ESM well yet. | ||
import {VERSION} from '@angular/core'; | ||
import * as core from '@angular/core'; | ||
|
||
describe('@angular/core ESM import', () => { | ||
it('should work', () => { | ||
expect(VERSION.major).toBeGreaterThanOrEqual(13); | ||
}); | ||
|
||
it('should have run the linker', () => { | ||
expect(() => { | ||
class TestCmp {} | ||
core.ɵɵngDeclareComponent({ | ||
version: '0.0.0', | ||
// use a high version that would cause the linking process to fail due to | ||
// an unknown version. We expect the bundling to still work though since | ||
// we set the handling to `ignore` using `linker_unknown_declaration_handling`. | ||
minVersion: '9999999999999.0.0', | ||
type: TestCmp, | ||
selector: 'test', | ||
ngImport: core, | ||
template: `<span>Test template</span>`, | ||
} as any); | ||
}).not.toThrow(); | ||
}); | ||
}); |