-
Notifications
You must be signed in to change notification settings - Fork 309
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: add support for zone.js 0.11.1 #448
Conversation
@ahnpnl , please review, thank you! |
The CI is failing, but it works in my local, will check what is wrong. |
@ahnpnl , I modified the logic, we don't need to check the |
thanks a lot @JiaLiPassion !!, the changes LGTM. |
@ahnpnl , thanks, still need some final tuning, the bundle name is not correct, will update in a minute. |
@ahnpnl, I have updated the commit, now it is ok for review, thanks. |
// Fallback logic to load zone and zone-patch | ||
// when the user still use zone.js 0.10.x | ||
// TODO: @JiaLiPassion, remove the fallback when Angular 10 LTS finished. | ||
require('zone.js/dist/zone'); |
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'm not sure if we can remove this fallback later because the preset supposes to support various Angular versions. If removing fallback means we don't have backward compatibility anymore for Angular < 9 ?
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.
Yeah, totally depends on the policy of the library, of course we can support any version of Angular with the latest version of the jest-preset-angular, or we can support different version of Angular with different versions of the jest-preset-angular. I just removed the comment.
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 talked to thymikee and the preset will follow Angular support policy starting from next major version. Once we do that, at some points we can drop this fallback.
zone.js 0.11.1 support jest, so all logic of `zone-patch` are no longer needed, also zone.js 0.11.1 change the `dist` bundles to `Angular Package Format`, so the current `require` absolute path will not work any longer. So this PR make the following changes. 1. Add logic in `setup-jest.ts`, to load `zone.js` and `zone.js/testing` moudles, if the jest patch is already available which means zone.js is 0.11.1+, we don't need to import zone.js module and patch ourselves. If the jest patch is not available, we still need to use the current logic as fallback. 2. Add e2e test for Angular 10 with zone.js 0.11.1
zone.js 0.11.1 support jest, so all logic of
zone-patch
are no longer needed,also zone.js 0.11.1 change the
dist
bundles toAngular Package Format
, so thecurrent
require
absolute path will not work any longer.So this PR make the following changes.
setup-jest.ts
, to loadzone.js
andzone.js/testing
moudles,if the jest patch is already available which means zone.js is 0.11.1+, we don't need to
import zone.js module and patch ourselves. If the jest patch is not available, we
still need to use the current logic as fallback.