-
Notifications
You must be signed in to change notification settings - Fork 26.2k
refactor(core): remove unused fakeAsyncFallback and asyncFallback #37879
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
Conversation
c6c1dc1 to
2e1ec96
Compare
2d0dc7c to
b3ba146
Compare
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.
LGTM
Reviewed-For:dev-infra
|
|
|
@mhevery , I think the error means, this or something like this if the So is that possible to update this
If import from source if import from node_modules.
import from source Thanks. |
|
If we have to change a lot of apps in presubmit To get the latest amount of work which would be needed to land this. About 1,300+ tests fail do to this. |
| @@ -5,11 +5,13 @@ | |||
| * Use of this source code is governed by an MIT-style license that can be | |||
| * found in the LICENSE file at https://angular.io/license | |||
| */ | |||
| import {discardPeriodicTasksFallback, fakeAsyncFallback, flushFallback, flushMicrotasksFallback, resetFakeAsyncZoneFallback, tickFallback} from './fake_async_fallback'; | |||
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.
Why can't we add import here?
import `zone.js/lib/testing/zone-testing`;
That way it would fix all google3 applications?
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.
Since currently the application generated by the Angular CLI will have a test.ts, and in the test.ts, it is loading zone-testing.
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/dist/zone-testing';
import { getTestBed } from '@angular/core/testing';
...
So if we are adding the import here, the testing bundle will be loaded twice and may throw error in some cases.
With the same idea, we can try to import the missing logic from
import `zone.js/lib/testing/fake-async`;
import `zone.js/lib/testing/async-testing`;
But still if the application already loaded the zone-testing bundle, it will throw error in some cases.
We can change the code in zone.js/lib/testing/fake-async and zone.js/lib/testing/async-test to make it work for this case (duplicate import), not sure we should do that in this way.
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.
Adding import here fixes google3. Could zone.js api loading make sure that we don't double load it. This would allow the PR to land.
60795d2 to
619d245
Compare
|
A lot better but still errors: I see |
ce1b4d7 to
e82daef
Compare
`zone.js` 0.8.25 introduces `zone-testing` bundle and move all `fakeAsync/async` logic from `@angular/core/testing` to `zone.js` package. But in case some user still using the old version of `zone.js`, an old version of `fakeAsync/async` logic were still kept inside `@angular/core/testing` package as `fallback` logic. Since now `Angular8+` already use `zone.js 0.9+`, so those fallback logic is removed.
e82daef to
1d90165
Compare
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.
reviewed-for: global-approvers
…7879) `zone.js` 0.8.25 introduces `zone-testing` bundle and move all `fakeAsync/async` logic from `@angular/core/testing` to `zone.js` package. But in case some user still using the old version of `zone.js`, an old version of `fakeAsync/async` logic were still kept inside `@angular/core/testing` package as `fallback` logic. Since now `Angular8+` already use `zone.js 0.9+`, so those fallback logic is removed. PR Close #37879
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
zone.js0.8.25 introduceszone-testingbundle and move allfakeAsync/asynclogicfrom
@angular/core/testingtozone.jspackage. But in case some user still using the oldversion of
zone.js, an old version offakeAsync/asynclogic were still kept inside@angular/core/testingpackage as
fallbacklogic. Since nowAngular8+already usezone.js 0.9+, sothose fallback logic can be removed.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Other information