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

fix(ngcc): support UMD global factory in comma lists #32709

Closed

Conversation

@petebacondarwin
Copy link
Member

commented Sep 17, 2019

Previously we were looking for a global factory call that looks like:

(factory((global.ng = global.ng || {}, global.ng.common = {}), global.ng.core))"

but in some cases it looks like:

(global = global || self, factory((global.ng = global.ng || {}, global.ng.common = {}), global.ng.core))"

Note the global = global || self at the start of the statement.

This commit makes the test when finding the global factory
function call resilient to being in a comma list.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@petebacondarwin petebacondarwin requested a review from angular/fw-ngcc as a code owner Sep 17, 2019
@ngbot ngbot bot modified the milestone: needsTriage Sep 17, 2019
@googlebot googlebot added the cla: yes label Sep 17, 2019
@petebacondarwin petebacondarwin force-pushed the petebacondarwin:ngcc-umd-import-fix branch 2 times, most recently from eeb41d5 to 3dce251 Sep 17, 2019
Previously we were looking for a global factory call that looks like:

```ts
(factory((global.ng = global.ng || {}, global.ng.common = {}), global.ng.core))"
```

but in some cases it looks like:

```ts
(global = global || self, factory((global.ng = global.ng || {}, global.ng.common = {}), global.ng.core))"
```

Note the `global = global || self` at the start of the statement.

This commit makes the test when finding the global factory
function call resilient to being in a comma list.
@petebacondarwin petebacondarwin force-pushed the petebacondarwin:ngcc-umd-import-fix branch from 3dce251 to 44b9fd2 Sep 17, 2019
@mhevery

This comment has been minimized.

Copy link
Member

commented Sep 17, 2019

CARETAKER: global approval

arnehoek added a commit to arnehoek/angular that referenced this pull request Sep 26, 2019
Previously we were looking for a global factory call that looks like:

```ts
(factory((global.ng = global.ng || {}, global.ng.common = {}), global.ng.core))"
```

but in some cases it looks like:

```ts
(global = global || self, factory((global.ng = global.ng || {}, global.ng.common = {}), global.ng.core))"
```

Note the `global = global || self` at the start of the statement.

This commit makes the test when finding the global factory
function call resilient to being in a comma list.

PR Close angular#32709
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.