-
Notifications
You must be signed in to change notification settings - Fork 25k
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
build: reference zone.js directly from source instead of npm #33046
Conversation
9e03a8d
to
e931f22
Compare
bdb03f8
to
411bf9d
Compare
tools/cjs-jasmine/index-tools.ts
Outdated
@@ -9,23 +9,23 @@ | |||
'use strict'; | |||
|
|||
const glob = require('glob'); | |||
require('zone.js/dist/zone-node.js'); | |||
import '@angular/zone.js/lib/node/rollup-main'; |
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 don't think these imports should change - the package is zone.js
not @angular/zone.js
something needs to make the mapping available to type-checker and runtime
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.
Got it, so it should be import 'zone.js/lib/node/rollup-main'
or you mean keep it like require('zone.js/dist/zone-node.js');
? Because currently we only have the source not the built npm_package
. So in this PR.
- for
packages/* (such as packages/core)
, I updated the reference tozone.js source code
, just like this one, import '@angular/zone.js/lib/node/rollup-main'; - for
modules/*
, I updated the reference tozone.js dist bazel rule
. - for
integrations/*
, I added build zone.jsnpm_package
first, and addzone.js built folder
topackage.json
.
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.
we should never import '@angular/zone.js/...
- why is that needed? Bazel should understand a zone.js
import
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.
Got it, I have updated all @angular/zone.js
to zone.js
.
411bf9d
to
4920e4c
Compare
@@ -7,11 +7,10 @@ | |||
*/ | |||
|
|||
// Needed to run animation tests | |||
require('zone.js/dist/zone-node.js'); | |||
|
|||
import '@angular/zone.js/lib/node/rollup-main'; |
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.
this doesn't look right. what do we need to fix so the 'zone.js/...' import works?
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.
Do you mean import zone.js/lib/node/rollup-main
? or import zone.js/dist/zone-node.js
.
- to support
import zone.js/lib/node/rollup-main
? We just need to update thepath mapping in tsconfig
and some other mapping, I will make a list. - to support
import zone.js/dist/zone-node.js
., we need to build//packages/zone.js:npm_package
first and then update the `path mapping to "zone.js": "dist/bin/packages/zone.js/npm_package"
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.
Ideally Angular would depend directly on the TS outputs of zone, not on the bundled rollup distribution, because the latter is a longer re-build. So ideally I think you want 1.
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.
@alexeagle , thank you, and I have updated the reference to zone.js
. Please review, thanks!
c90feea
to
a2e9082
Compare
outs = ["zone.js.d.ts"], | ||
cmd = "find $(SRCS) -name \"zone.d.ts\" -exec cp {} $(@D)/zone.js.d.ts \;", | ||
cmd = "cp $< $@", |
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.
nice fix
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.
Thanks!
@@ -0,0 +1,30 @@ | |||
{ |
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.
this file is surprising - do you mean to add it? bad merge maybe?
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, thanks, I have deleted it.
MERGE_ASSISTANCE: Global Approval |
The expanding_rows benchmark test appears to be failing with error |
934eb84
to
ae92649
Compare
7692c80
to
42dcb7e
Compare
42dcb7e
to
203e24d
Compare
@atscott, thanks and I just updated the PR, please review. |
…st.sh` In angular#33046, internal uses of `zone.js` were switched to reference it directly from source (built with Bazel) instead of npm. As a result, the necessary scripts were updated to build `zone.js` as necessary. However, the `integration/ngcc/debug-test.sh` script was missed (probably because it is not used on CI, but only locally as a helper for debugging the ngcc integration project). This commit updates the `debug-test.sh` script to also build `zone.js` as needed.
…st.sh` In angular#33046, internal uses of `zone.js` were switched to reference it directly from source (built with Bazel) instead of npm. As a result, the necessary scripts were updated to build `zone.js` as necessary. However, the `integration/ngcc/debug-test.sh` script was missed (probably because it is not used on CI, but only locally as a helper for debugging the ngcc integration project). This commit updates the `debug-test.sh` script to also build `zone.js` as needed.
…st.sh` In angular#33046, internal uses of `zone.js` were switched to reference it directly from source (built with Bazel) instead of npm. As a result, the necessary scripts were updated to build `zone.js` as necessary. However, some `integration/**/debug-test.sh` scripts were missed (apparently because they are not used on CI, but only locally as helpers for debugging the integration projects). This commit updates the `scripts/build-packages-dist.sh` script to also build `zone.js`, so that other scripts (such as the various `debug-test.sh` scripts) can use it.
…st.sh` In angular#33046, internal uses of `zone.js` were switched to reference it directly from source (built with Bazel) instead of npm. As a result, the necessary scripts were updated to build `zone.js` as necessary. However, some `integration/**/debug-test.sh` scripts were missed (apparently because they are not used on CI, but only locally as helpers for debugging the integration projects). This commit updates the `scripts/build-packages-dist.sh` script to also build `zone.js`, so that other scripts (such as the various `debug-test.sh` scripts) can use it.
…st.sh` (#33733) In #33046, internal uses of `zone.js` were switched to reference it directly from source (built with Bazel) instead of npm. As a result, the necessary scripts were updated to build `zone.js` as necessary. However, some `integration/**/debug-test.sh` scripts were missed (apparently because they are not used on CI, but only locally as helpers for debugging the integration projects). This commit updates the `scripts/build-packages-dist.sh` script to also build `zone.js`, so that other scripts (such as the various `debug-test.sh` scripts) can use it. PR Close #33733
…st.sh` (#33733) In #33046, internal uses of `zone.js` were switched to reference it directly from source (built with Bazel) instead of npm. As a result, the necessary scripts were updated to build `zone.js` as necessary. However, some `integration/**/debug-test.sh` scripts were missed (apparently because they are not used on CI, but only locally as helpers for debugging the integration projects). This commit updates the `scripts/build-packages-dist.sh` script to also build `zone.js`, so that other scripts (such as the various `debug-test.sh` scripts) can use it. PR Close #33733
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. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #32482
What is the new behavior?
reference zone.js directly from source instead of npm
Does this PR introduce a breaking change?