fix(@angular/build): link partial Ivy dependencies in Vitest runner - #34200
alan-agius4 wants to merge 1 commit into
Conversation
34e669b to
885c783
Compare
There was a problem hiding this comment.
Code Review
This pull request integrates the Angular linker into the Vitest unit test runner by utilizing JavaScriptTransformer to link partially-compiled packages. It also configures dependency optimization using browser targets and adds a behavior test to verify the linking process. The review feedback suggests optimizing the angular:linker plugin by using the existing textDecoder to decode transformed data instead of creating a temporary Buffer instance.
| const transformedData = await prebundleTransformer.transformData(id, code); | ||
|
|
||
| return Buffer.from(transformedData).toString('utf-8'); |
There was a problem hiding this comment.
Since textDecoder is already instantiated at the module level (line 323), we can use it here to decode transformedData instead of creating a temporary Node.js Buffer instance. This is more consistent with the rest of the file and avoids unnecessary buffer allocations.
| const transformedData = await prebundleTransformer.transformData(id, code); | |
| return Buffer.from(transformedData).toString('utf-8'); | |
| const transformedData = await prebundleTransformer.transformData(id, code); | |
| return textDecoder.decode(transformedData); |
Closes #34198