Skip to content

Remove module.id references #13883

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

Closed
gregmagolan opened this issue Oct 30, 2018 · 1 comment · Fixed by #17626
Closed

Remove module.id references #13883

gregmagolan opened this issue Oct 30, 2018 · 1 comment · Fixed by #17626
Assignees

Comments

@gregmagolan
Copy link
Contributor

gregmagolan commented Oct 30, 2018

Bug, feature request, or proposal:

The module.id references should be removed from Angular Material once they are no longer needed in Google3. This will likely have to wait until Ivy is released.

What is the current behavior?

A work-around for the module.id references is needed when building Angular & Material from source downstream when using ts_devserver and ts_web_test_suite. See /src/module-id.js in angular/angular-bazel-example#228.

Without the work-around, you'll see a module is not defined error in the browser when running ts_dev_server and ts_web_test_suite will fail due to the same error.

Uncaught ReferenceError: module is not defined
    at eval (tree.ts:48)
    at Object.eval (tree.ts:59)
    at Object.execCb (bundle.min.js:1696)
    at Module.check (bundle.min.js:883)
    at Module.<anonymous> (bundle.min.js:1139)
    at bundle.min.js:134
    at bundle.min.js:1189
    at each (bundle.min.js:59)
    at Module.emit (bundle.min.js:1188)
    at Module.check (bundle.min.js:938)

What is the expected behavior?

This work-around can be removed once the references are no longer needed and removed.

What is the use-case or motivation for changing an existing behavior?

Simplify Angular + Material + Bazel adoption.

@devversion devversion self-assigned this Oct 30, 2018
@jelbourn jelbourn changed the title Remove material.id references Remove module.id references Nov 3, 2018
devversion added a commit to devversion/material2 that referenced this issue Nov 6, 2019
Currently when building the libary with Gulp, we manually inline
resources and remove the `moduleId` properties. This is actually
why angular#13883 never came up
until Bazel.

Since we now release with Bazel and rely on the official resource
inlining from `@angular/compiler-cli` we no longer have control to
omit the `moduleId` properties. Technically since resources are
inlined, the `moduleId` is unnecessary and can cause unexpected
behavior. So this could be considered a bug in compiler-cli.

Possible fix: angular/angular#33621.

For now though, since it's unlikely that this is fixed upstream
in RC phase, we manually patch the NGC resource inlining transform
to also remove the `moduleId` property.
@Splaktar Splaktar removed the blocked label Nov 7, 2019
@angular-automatic-lock-bot
Copy link

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 Dec 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants