chore(angular): test schematics and code-splitting - #31401
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ShaneK
left a comment
There was a problem hiding this comment.
Glad to see this, it's the test I was after on the exports PR. Two big things I noticed though, the export type move breaks IonicSafeString at runtime, and neither new test fails yet on what it's protecting. There's some other things worth looking at too though, and some nits.
ShaneK
left a comment
There was a problem hiding this comment.
Getting close! The job split and the new build step in the schematics test are both good additions.
Two bigger ones this round. The codemod corrupts any import that has a comment in it, and the code-split assertion still passes when a component ends up in main.js. I built the fixture to check both. There are replies on the older threads too, including a couple where you were right and I wasn't.
| execSync(`npm run build`, { cwd: PROJECT_DIR, stdio: 'inherit' }); | ||
|
|
||
| const stats = fs.readJsonSync(STATS_FILE); | ||
| const chunks = findChunksForPage(stats, 'landing.page.ts'); |
There was a problem hiding this comment.
The closure rewrite works. Both regressions fail against it now: importing IonToggle eagerly into AppComponent exits 1, and putting main.ts back on a barrel import of IonicRouteStrategy does too. You were right that main.js needs no special case, it's already in the closure.
The header half of last round's check didn't make it in though, and without it this can pass having measured nothing. When no output matches, findChunksForPage returns an empty Set and the script prints its success line and exits 0. I renamed landing.page.ts to landing.view.ts, fixed the route import and reran it: green, exit 0, nothing checked. Could you assert ion-header is in the closure alongside the toggle check? I confirmed it's in there, so it should pass as is.
Issue number: internal
What is the new behavior?
package.json.packages/angulartests.Does this introduce a breaking change?