-
Notifications
You must be signed in to change notification settings - Fork 25.6k
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
test(ivy): add render3 integration tests #21557
Conversation
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.
overall lgtm, just needs a bit of cleanup.
integration/_payload-limits.json
Outdated
"hello_world__render3__closure": { | ||
"master": { | ||
"gzip7": { | ||
"bundle": 3138 |
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.
please remove limits for gzip7 and gzip9. going forward we want to break builds only if uncompressed size changes by more than 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.
Done
@@ -0,0 +1,2 @@ | |||
find built/packages/core/src/render3/* -name '*.js' -exec sed -i '' -e "s/import '.\/ng_dev_mode';//g" {} \; |
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.
can you document what this does and why do we do it this way?
I thought closure had a way to set the compilation constant via config so I'm not sure why we do this kind of search&replace. if there is a good reason for it, please document it in this file.
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 is workaround for google/closure-compiler#1601 Can you include the link in a 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.
Could you see if you can get it work with
-D "ngDevMode$$module$built$packages$core$src$render3$ng_dev_mode=false"
-D "ngDevMode=false"
This should set the closure compiler vars and tree shake them, but I don't seem to be able to get it to work.
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.
Comment added. Due to this bug, I couldn't make it work either.
{ | ||
"name": "angular-integration", | ||
"version": "0.0.0", | ||
"license": "MIT", |
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.
add "private: true" plz
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.
Done
"compilerOptions": { | ||
"module": "es2015", | ||
"moduleResolution": "node", | ||
"strictNullChecks": true, |
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.
replace with "strict": true
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.
Done
"outDir": "../built/e2e", | ||
"types": ["jasmine"], | ||
// TODO(alexeagle): was required for Protractor 4.0.11 | ||
"skipLibCheck": true |
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.
add "strict": true
?
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.
Done
{ | ||
"name": "angular-integration", | ||
"version": "0.0.0", | ||
"license": "MIT", |
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.
private true
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.
Done
"compilerOptions": { | ||
"module": "es2015", | ||
"moduleResolution": "node", | ||
"strictNullChecks": true, |
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.
replace with "strict": true
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.
Done
@@ -0,0 +1,2 @@ | |||
find built/packages/core/src/render3/* -name '*.js' -exec sed -i '' -e "s/import '.\/ng_dev_mode';//g" {} \; |
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 is workaround for google/closure-compiler#1601 Can you include the link in a comment?
--rewrite_polyfills=false | ||
--jscomp_off=checkVars | ||
|
||
node_modules/zone.js/dist/zone_externs.js |
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 am confused why do we need zone here. Render3 should have no dependency on it.
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.
Removed the leftover
"dependencies": { | ||
"rxjs": "file:../../node_modules/rxjs", | ||
"typescript": "file:../../node_modules/typescript", | ||
"zone.js": "file:../../node_modules/zone.js" |
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 is there dep on rxjs
if we don't need it? (Also zone.js)?
Why is there NO dep on core
which is needed?
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.
Removed rxjs
For the Angular source code, this scenario doesn't use distributed packages but just the source transpiled to ES2015. It is copied into built
folder before the build.
@IgorMinar @mhevery thanks for the reviews, I've updated the PR with your comments, please take another look |
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
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. |
This PR adds two Hello World integration tests with the
Render3
engine. They don't use the compiler yet, but they will be useful to track the size of a small application.They implement the same Hello World application as the other integration tests.
The first one is using Rollup to create the bundle and targets the standard packages of @angular. Since they are not correctly tree-shakable, the bundle ends up at 56.6kB of minified code (15.3kB after gzip).
The second is a bit more hacky. It uses Closure Compiler and the Angular source code compiled to ES2015, in order to remove as much unused code as possible. With this setup, the bundle is only 6.6kB minified (3.1kB after gzip).