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

build: upgrade ng-packagr for ivy #1397

Merged
merged 2 commits into from
Oct 22, 2019

Conversation

paullryan
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

This uses ng-packagr >= 5.6.0 (using 5.7.0) which fixes some package linkage issues with ngcc to prepare for angular 9.x and ivy. Without it errors like the following occur on SSR builds with NGXS

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[x] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

ERROR in /Users/pryan/workspaces/@campgroundbooking/portal/node_modules/@ngxs/devtools-plugin/__ivy_ngcc__/bundles/ngxs-devtools-plugin.umd.js 4:192
Module parse failed: Unexpected character '@' (4:192)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|     typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@ngxs/store'), require('rxjs/operators'),require('@angular/core'),require('@ngxs/store')) :
|     typeof define === 'function' && define.amd ? define('@ngxs/devtools-plugin', ['exports', '@angular/core', '@ngxs/store', 'rxjs/operators','@angular/core','@ngxs/store'], factory) :
>     (global = global || self, factory((global.ngxs = global.ngxs || {}, global.ngxs['devtools-plugin'] = {}), global.ng.core, global['ngxs-store'], global.rxjs.operators,global.ng.core,global.@ngxs/store));
| }(this, function (exports, core, store, operators,ɵngcc0,ɵngcc1) { 'use strict';
|

The problem is the improper global resolution of the UMD submodule (e.g. global.ng.core,global.@ngxs/store)

Issue Number: N/A

What is the new behavior?

Packaged builds will properly resolve these submodules for ngcc.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

Copy link
Member

@markwhitfeld markwhitfeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you & congratulations on your first time contribution.
Looks good to me.

bundlesize.config.json Show resolved Hide resolved
@markwhitfeld markwhitfeld merged commit bae896e into ngxs:master Oct 22, 2019
@paullryan paullryan deleted the ivy-ready branch October 23, 2019 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants