Skip to content

fix(platform-browser): insert APP_ID in styles, contentAttr and hostAttr #17745

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

Conversation

petersalomonsen
Copy link
Contributor

@petersalomonsen petersalomonsen commented Jun 24, 2017

PR Checklist

Does please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ x] 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: 16676

What is the new behavior?

APP_ID is inserted between nghost/ngcontent and component id in styles, contentAttr and hostAttr as it is supposed to do according to the documentation (https://angular.io/guide/component-styles)

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

Existing tests have been modified to check for the APP_ID presence. Documentation already states that this should be present, so the change is bringing the implementation closer to how the documentation says it should work.

Sorry, something went wrong.

@IgorMinar IgorMinar added area: core Issues related to the framework runtime action: review The PR is still awaiting reviews from at least one requested reviewer labels Jul 11, 2017
@mhevery mhevery force-pushed the 16676-viewencapsulation-appid branch from b3eac64 to 3207d21 Compare July 26, 2017 18:39
@splincode
Copy link
Contributor

@petersalomonsen what is the status of your pull request? is it still relevant? please fix conflicts if they exist

@petersalomonsen
Copy link
Contributor Author

@splincode It is still relevant. Without it you will have overlapping styles when having multiple angular apps on the same page, which is caused by the app id no being included as it is supposed to be according to the documentation here: https://angular.io/guide/component-styles#inspecting-generated-css

@glipecki
Copy link

Additionally, current behavior is misleading as APP_ID documentation states that APP_ID should be used as a part of generated attributes for ViewEncapsulation.Emulated (https://angular.io/api/core/APP_ID).

This PR would help me a lot! :-)

@glipecki
Copy link

@petersalomonsen Are you going to fix PR checks?

@petersalomonsen
Copy link
Contributor Author

@glipecki Can have a look at it.

petersalomonsen added a commit to petersalomonsen/angular that referenced this pull request Mar 27, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@petersalomonsen
Copy link
Contributor Author

packages/core/test/render3/imported_renderer2.ts was added after my initial PR. The DomRenderer2Factory was instanced without the app id parameter (that I added in my PR), so I added a dummy app id to get around it. Tests passed locally so hopefully passes the CI too? (I'm not 100% up to speed on all that's going on in the CI tests).

@splincode
Copy link
Contributor

@petersalomonsen This pull request is big!

@petersalomonsen
Copy link
Contributor Author

petersalomonsen commented Mar 27, 2018

@splincode Did I merge / rebase the wrong way?

I did this:

git rebase master -i
git push -f

(as written here: https://github.com/angular/angular/blob/master/CONTRIBUTING.md - if changes are suggested (10))

I've only made two commits. These are the only changes: master...petersalomonsen:16676-viewencapsulation-appid

@petersalomonsen petersalomonsen force-pushed the 16676-viewencapsulation-appid branch from eef0bb0 to c17cf8c Compare March 27, 2018 10:32
@petersalomonsen
Copy link
Contributor Author

@splincode Should never have used the sync button in visual studio code that created a merge commit. Merge commit is removed now.

@splincode
Copy link
Contributor

@petersalomonsen Can you edit the code according to the formatting rules (default tslint.json)?

@splincode
Copy link
Contributor

@petersalomonsen Use interactive git rebase to combine your little commits into one

@petersalomonsen petersalomonsen force-pushed the 16676-viewencapsulation-appid branch from c17cf8c to 623edf2 Compare March 27, 2018 10:52
@petersalomonsen
Copy link
Contributor Author

petersalomonsen commented Mar 27, 2018

@splincode Now combined into one commit. And I've also run gulp format.

@petersalomonsen petersalomonsen force-pushed the 16676-viewencapsulation-appid branch 3 times, most recently from 65f79bc to f73b907 Compare March 28, 2018 05:29
@petersalomonsen
Copy link
Contributor Author

All CI tests are passing now. What more can I do for this PR to be accepted?

@aaaa0441
Copy link

@petersalomonsen this PR looks great! I also need this fix to allow our micro-apps to have non-conflicting styles when using https://github.com/CanopyTax/single-spa.

Do you know what's preventing this PR from being approved/merged? (Sorry that I'm not familiar with the contribution process.)

@petersalomonsen
Copy link
Contributor Author

@aaaa0441 I think the remaining depends on the Angular repository managers now, but if there's something more I can do to complete the merge I'd be happy to help - so let me know.

@aaaa0441
Copy link

@petersalomonsen Thanks for responding. I got your changes and applied the diff to my local node_modules/@angular/platform-browser dependency using patch-package. Works well.

I definitely prefer Angular to have this fixed instead of monkey patching it the way I am doing. However, I have no other way for our project to move on now. =(

Really hope this gets merged soon. Who can we @ to get this expedited?

@petersalomonsen
Copy link
Contributor Author

@aaaa0441 I think @chuckjaz is member of the Angular team and maybe can give some info on what needs to be done to get the merge through.

@mhevery mhevery added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Apr 8, 2019
@ngbot
Copy link

ngbot bot commented Apr 8, 2019

I see that you just added the PR action: merge label, but the following checks are still failing:
    failure status "ci/circleci: test_ivy_aot" is failing
    failure status "code-review/pullapprove" is failing
    pending missing required labels: PR target: *
    pending status "google3" is pending
    pending missing required status "ci/circleci: publish_snapshot"

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken master, please try rebasing to master and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

@mhevery mhevery force-pushed the 16676-viewencapsulation-appid branch from 530486e to db0818c Compare April 8, 2019 23:14
@petersalomonsen petersalomonsen requested review from IgorMinar and a team as code owners April 8, 2019 23:14
@mhevery mhevery added the target: patch This PR is targeted for the next patch release label Apr 8, 2019
@mhevery
Copy link
Contributor

mhevery commented Apr 8, 2019

@mhevery mhevery self-assigned this Apr 8, 2019
@mleibman
Copy link

mleibman commented Apr 9, 2019

@petersalomonsen looks like this is failing some unit tests, including a regex check for the _nghost attribute in

/<host-cmp>foo<\/host-cmp><embedded-cmp _nghost-c(\d+)="">From module injector<\/embedded-cmp>/);

@petersalomonsen petersalomonsen force-pushed the 16676-viewencapsulation-appid branch 5 times, most recently from ce1642d to 633825f Compare April 9, 2019 22:01
@petersalomonsen
Copy link
Contributor Author

petersalomonsen commented Apr 9, 2019

@mleibman I believe the regex checks are fixed now. The circle_ci integration test passed on the previous push, and there were no other changes than a few spaces to please the linter (sorry for not sorting this out locally before pushing).

@mleibman
Copy link

mleibman commented Apr 9, 2019

@petersalomonsen Thanks! I'm not an Angular team member, so I can't review/merge it myself. I'm just facilitating since I depend on this fix :)

@mhevery mhevery force-pushed the 16676-viewencapsulation-appid branch from 633825f to 9e3d82f Compare April 9, 2019 22:41
@mhevery mhevery added the merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note label Apr 9, 2019
@mhevery
Copy link
Contributor

mhevery commented Apr 9, 2019

CARETAKER: The build failure is bazel build time, which is unrelated to this PR, please merge manually.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@IgorMinar IgorMinar force-pushed the 16676-viewencapsulation-appid branch from 9e3d82f to 56dc55d Compare April 11, 2019 14:44
IgorMinar pushed a commit that referenced this pull request Apr 11, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…ttr (#17745)

PR Close #17745
@IgorMinar IgorMinar closed this in 712d60e Apr 11, 2019
wKoza pushed a commit to wKoza/angular that referenced this pull request Apr 17, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…ttr (angular#17745)

PR Close angular#17745
@fazil1987
Copy link

is this PR merged to master ?

@petersalomonsen
Copy link
Contributor Author

petersalomonsen commented Jul 4, 2019 via email

@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 15, 2019
@petersalomonsen petersalomonsen deleted the 16676-viewencapsulation-appid branch March 25, 2020 16:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime cla: yes merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: patch This PR is targeted for the next patch release type: bug/fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet