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

Update to nodejs rules 0.27 #29210

Closed

Conversation

@gregmagolan
Copy link
Contributor

@gregmagolan gregmagolan commented Mar 10, 2019

No description provided.

@gregmagolan gregmagolan requested review from as code owners Mar 10, 2019
@ngbot ngbot bot added this to the needsTriage milestone Mar 10, 2019
@gregmagolan gregmagolan requested a review from as a code owner Mar 10, 2019
@gregmagolan gregmagolan force-pushed the build/rules-nodejs-0.27.0 branch from d841b63 to 06b3bf2 Mar 10, 2019
@alexeagle alexeagle force-pushed the build/rules-nodejs-0.27.0 branch from 06b3bf2 to 9da15a6 Mar 11, 2019
@alexeagle alexeagle changed the title Update to nodejs rules 0.27.3 Update to nodejs rules 0.27 Mar 11, 2019
@gregmagolan gregmagolan force-pushed the build/rules-nodejs-0.27.0 branch 6 times, most recently from 70ccdfc to 37b9d30 Mar 11, 2019
@gregmagolan gregmagolan requested review from as code owners Mar 11, 2019
@gregmagolan gregmagolan force-pushed the build/rules-nodejs-0.27.0 branch from e498ca2 to 37b9d30 Mar 11, 2019
@gregmagolan gregmagolan force-pushed the build/rules-nodejs-0.27.0 branch 2 times, most recently from c56b6bd to ab2bda6 Mar 13, 2019
@gregmagolan
Copy link
Contributor Author

@gregmagolan gregmagolan commented Mar 13, 2019

Note: material-unit-tests failure has numerous failures that look like this

Firefox 63.0.0 (Linux 0.0.0) MatPaginator with the default internationalization provider should re-render when the i18n labels change FAILED
    Error: BrowserDynamicTestingModule has no @NgModule annotation in node_modules/systemjs/dist/system.js line 4 > eval (line 1564)
    TestBedRender3</TestBedRender3.prototype._compileNgModule@node_modules/@angular/core/bundles/core-testing.umd.js:1564:23
    calcTransitiveScopesFor/<@node_modules/@angular/core/bundles/core-testing.umd.js:1597:139
    transitiveScopesFor/<@node_modules/@angular/core/bundles/core.umd.js:21168:17

if @__PURE__ annotations are stripped out of the angular bundles (which happens by default with the update to rollup 1.3.1.

The platform-browser-dynamic-testing.umd.js Ivy bundle contains a number of __PURE__ annotations including one for BrowserDynamicTestingModule:

    var BrowserDynamicTestingModule = /** @class */ (function () {
        function BrowserDynamicTestingModule() {
        }
        BrowserDynamicTestingModule.ngModuleDef = i0.ɵdefineNgModule({ type: BrowserDynamicTestingModule, exports: [testing$1.BrowserTestingModule] });
        BrowserDynamicTestingModule.ngInjectorDef = i0.defineInjector({ factory: function BrowserDynamicTestingModule_Factory(t) { return new (t || BrowserDynamicTestingModule)(); }, providers: [
                { provide: testing.TestComponentRenderer, useClass: DOMTestComponentRenderer },
            ], imports: [[testing$1.BrowserTestingModule]] });
        return BrowserDynamicTestingModule;
    }());
    /*@__PURE__*/ i0.ɵsetClassMetadata(BrowserDynamicTestingModule, [{
            type: i0.NgModule,
            args: [{
                    exports: [testing$1.BrowserTestingModule],
                    providers: [
                        { provide: testing.TestComponentRenderer, useClass: DOMTestComponentRenderer },
                    ]
                }]
        }], null, null);

There are also __PURE__ annotations in other Ivy bundles.

@gregmagolan
Copy link
Contributor Author

@gregmagolan gregmagolan commented Mar 13, 2019

For reference, rollup version was updated here bazelbuild/rules_nodejs#584 which brough in the @__PURE__ annotation tree shaking feature.

packages/bazel/src/ng_package/ng_package.bzl Show resolved Hide resolved
# which tree shakes @__PURE__ annotations by default. We turn this feature off
# for ng_package as Angular bundles contain these annotations and there are
# test failures if they are removed. See comments in
# https://github.com/angular/angular/pull/29210 for more information.
Copy link
Contributor

@alexeagle alexeagle Mar 13, 2019

yeah seems like a bug for these annotations to be tree-shaken in the testing bundles? since many tests need them in JIT mode?

Copy link
Member

@filipesilva filipesilva Mar 13, 2019

I don't think it's a rollup bug. I think libraries need to be run rollup with this option turned off, and applications need to run with it turned on.

@gregmagolan gregmagolan force-pushed the build/rules-nodejs-0.27.0 branch from 2fa4eb5 to a54d507 Mar 13, 2019
@gregmagolan gregmagolan force-pushed the build/rules-nodejs-0.27.0 branch from 67dcd15 to ceef0ea Mar 13, 2019
@gregmagolan gregmagolan force-pushed the build/rules-nodejs-0.27.0 branch from e2a9d59 to 3dc868c Mar 14, 2019
"rollup": "^0.41.6",
"rollup-plugin-commonjs": "^8.0.2",
"rollup-plugin-node-resolve": "2.0.0",
"rollup": "^1.1.0",
Copy link
Contributor Author

@gregmagolan gregmagolan Mar 14, 2019

rollup needed an upgrade to fix test failures in the upgrade-phonecat-2-hybrid test. It seems like rollup 0.41.6 couldn't handle the angular bundles produced by rollup 1.3.1 (which is what ng_packager now uses since it shares the version with rollup_bundle).

@alexeagle
Copy link
Contributor

@alexeagle alexeagle commented Mar 14, 2019

Caretaker: has global approval

@matsko matsko closed this in 08231f0 Mar 14, 2019
matsko added a commit that referenced this issue Mar 14, 2019
matsko added a commit that referenced this issue Mar 15, 2019
kara added a commit to kara/angular that referenced this issue Mar 15, 2019
matsko added a commit that referenced this issue Mar 15, 2019
alexeagle added a commit to alexeagle/angular that referenced this issue Mar 15, 2019
wKoza added a commit to wKoza/angular that referenced this issue Apr 17, 2019
wKoza added a commit to wKoza/angular that referenced this issue Apr 17, 2019
wKoza added a commit to wKoza/angular that referenced this issue Apr 17, 2019
wKoza added a commit to wKoza/angular that referenced this issue Apr 17, 2019
@angular-automatic-lock-bot
Copy link

@angular-automatic-lock-bot angular-automatic-lock-bot bot commented Sep 14, 2019

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants