Skip to content

Various Fixes with Modules - #5510

Merged
hansl merged 2 commits into
angular:masterfrom
hansl:fix-module-id
Mar 20, 2017
Merged

Various Fixes with Modules#5510
hansl merged 2 commits into
angular:masterfrom
hansl:fix-module-id

Conversation

@hansl

@hansl hansl commented Mar 19, 2017

Copy link
Copy Markdown
Contributor

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

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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