Skip to content
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

feat(compiler): use replace-resources transformer from Angular for isolatedModules: true #717

Merged
merged 1 commit into from
Jan 7, 2021
Merged

feat(compiler): use replace-resources transformer from Angular for isolatedModules: true #717

merged 1 commit into from
Jan 7, 2021

Conversation

ahnpnl
Copy link
Collaborator

@ahnpnl ahnpnl commented Jan 7, 2021

Summary

Copy source code of TypeScript transpileModule so that we can get Program which is created in that function which then allows us to use replace-resources transformer from Angular.

This also provides fully compatibility to ESM for isolatedModules: true, related to #710

Test plan

Adjusted unit tests, green CI

Does this PR introduce a breaking change?

  • Yes
  • No
  • inline-files and strip-styles are removed from jest-preset-angular and now jest-preset-angular always uses Angular replace-resources instead for both isolatedModules: false and isolatedModules: true.
  • inline-files and strip-styles transformers in your jest config
'jest-preset-angular/build/InlineFilesTransformer',
'jest-preset-angular/build/StripStylesTransformer',

must be removed

Other information

N.A.

Copy source code of TypeScript `transpileModule` so that we can get `Program` which is created in that function which then allows us to use `replace-resources` transformer from Angular

BREAKING CHANGE
- `inline-files` and `strip-styles` are removed from `jest-preset-angular` and now `jest-preset-angular` always uses Angular `replace-resources` instead for both `isolatedModules: false` and `isolatedModules: true`.
- Users who are using `inline-files` and `strip-styles` transformers in jest config
```
'jest-preset-angular/build/InlineFilesTransformer',
'jest-preset-angular/build/StripStylesTransformer',
```
must be removed
@ahnpnl ahnpnl added the 💣 Breaking Changes Includes a breaking change and should probably wait until we're preparing for the release of a major label Jan 7, 2021
@ahnpnl ahnpnl added this to the 9.0.0 milestone Jan 7, 2021
@ahnpnl ahnpnl changed the title feat(compiler): use replace-resources for isolatedModules: true feat(compiler): use replace-resources transformer from Angular for isolatedModules: true Jan 7, 2021
@ahnpnl ahnpnl marked this pull request as ready for review January 7, 2021 14:59
@ahnpnl ahnpnl merged commit 76c25d2 into thymikee:master Jan 7, 2021
@ahnpnl ahnpnl deleted the replace-resources-isolatedmodules branch January 7, 2021 15:01
@ahnpnl ahnpnl mentioned this pull request Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💣 Breaking Changes Includes a breaking change and should probably wait until we're preparing for the release of a major
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant