Repository navigation
ivy+docs-infra: compile angular.io with Ivy #26947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ca50c73
refactor(core): remove duplicate check in `defaultStyleSanitizer`
gkalpak d4b85f5
fix(ivy): add missing private render3 exports
gkalpak 76e2e2c
fix(ivy): return correct declaration for class indentifiers for ES5 i…
gkalpak f520ef0
refactor(docs-infra): get rid of `on` component input
gkalpak 5b679e1
build(docs-infra): upgrade @angular/cli to 7.2.1
gkalpak 4225a89
ci(docs-infra): compile with Ivy
gkalpak e5aa29d
refactor: correctly name `cli-hello-world-ivy` project to distinguish…
gkalpak 54b33bd
test: log cli version in `cli-hello-world[-ivy]` integration projects
gkalpak cb9d93a
fixup! fix(ivy): return correct declaration for class indentifiers fo…
gkalpak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| // Imports | ||
| const {extend, parse} = require('cjson'); | ||
| const {readFileSync, writeFileSync} = require('fs'); | ||
| const {join, resolve} = require('path'); | ||
| const {exec, set} = require('shelljs'); | ||
|
|
||
| set('-e'); | ||
|
|
||
| // Constants | ||
| const ROOT_DIR = resolve(__dirname, '..'); | ||
| const TS_CONFIG_PATH = join(ROOT_DIR, 'tsconfig.json'); | ||
| const NG_COMPILER_OPTS = { | ||
| angularCompilerOptions: { | ||
| // Related Jira issue: FW-737 | ||
| allowEmptyCodegenFiles: true, | ||
| enableIvy: 'ngtsc', | ||
| }, | ||
| }; | ||
|
|
||
| // Run | ||
| _main(process.argv.slice(2)); | ||
|
|
||
| // Functions - Definitions | ||
| function _main(buildArgs) { | ||
| console.log('\nModifying `tsconfig.json`...'); | ||
| const oldTsConfigStr = readFileSync(TS_CONFIG_PATH, 'utf8'); | ||
| const oldTsConfigObj = parse(oldTsConfigStr); | ||
| const newTsConfigObj = extend(true, oldTsConfigObj, NG_COMPILER_OPTS); | ||
| const newTsConfigStr = JSON.stringify(newTsConfigObj, null, 2); | ||
| writeFileSync(TS_CONFIG_PATH, newTsConfigStr); | ||
| console.log(newTsConfigStr); | ||
|
|
||
| try { | ||
| const buildArgsStr = buildArgs.join(' '); | ||
|
|
||
| console.log(`\nBuilding${buildArgsStr && ` with args \`${buildArgsStr}\``}...`); | ||
| exec(`yarn ~~build ${buildArgsStr}`, {cwd: ROOT_DIR}); | ||
| } finally { | ||
| console.log('\nRestoring `tsconfig.json`...'); | ||
| writeFileSync(TS_CONFIG_PATH, oldTsConfigStr); | ||
| } | ||
|
|
||
| console.log('\nDone!'); | ||
| } | ||
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed this before. This is an ok workaround for now, but we should work on removing this flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see angular/angular-cli#13524 (review) for more context.