Skip to content

Various Fixes with Modules #5510

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

Merged
merged 2 commits into from
Mar 20, 2017
Merged

Various Fixes with Modules #5510

merged 2 commits into from
Mar 20, 2017

Conversation

hansl
Copy link
Contributor

@hansl hansl commented Mar 19, 2017

fix(@ngtools/webpack): only remove moduleId in decorators …

Prior to this we were removing all mentions of moduleId, which is invalid if the users want to use it themselves. Now we only removes it if its in a decorator. There might be a slight regression with people using static const objects instead of object literals in their decorators but this shuold not happen often and even less often with moduleId.

Fixes #5509.


fix(@ngtools/webpack): add parent nodes and keep program …

Technically that program should always be the valid one, and is needed in some cases (e.g. diagnostics). Adding parent nodes get rid of the getChildAt error that happens, because the prop.parent is not set.

The issue happened because people are using "files": ["main.ts"] or something similar, and when we load
another file than main we dont set the parent nodes.

Fixes #5143
Fixes #4817

@@ -11,16 +11,49 @@ describe('@ngtools/webpack', () => {
host.writeFile('/file.ts', `
export const obj = { moduleId: 123 };
export const obj2 = { moduleId: 123, otherValue: 1 };
export const obj2 = { otherValue: 1, moduleId: 123 };
export const obj3 = { otherValue: 1, moduleId: 123 };
Copy link
Contributor

Choose a reason for hiding this comment

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

You added obj3 but don't check it on the tests. Is that intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed the check to not use the variable name.

hansl added 2 commits March 19, 2017 18:48
Prior to this we were removing all mentions of moduleId, which is invalid if the users want
to use it themselves. Now we only removes it if its in a decorator. There might be a slight
regression with people using static const objects instead of object literals in their
decorators but this shuold not happen often and even less often with moduleId.

Fixes angular#5509.
Technically that program should always be the valid one, and is needed in some cases (e.g. diagnostics).
Adding parent nodes get rid of the getChildAt error that happens, because the prop.parent is not
set.

The issue happened because people are using "files": ["main.ts"] or something similar, and when we load
another file than main we dont set the parent nodes.

Fixes angular#5143
Fixes angular#4817
@hansl hansl merged commit ebb495d into angular:master Mar 20, 2017
@hansl hansl deleted the fix-module-id branch November 28, 2018 23:34
@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 Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants