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(runtime): do regular clone of normal slotting #2694

Merged
merged 4 commits into from
Oct 15, 2020

Conversation

justusromijn
Copy link
Contributor

@justusromijn justusromijn commented Oct 6, 2020

The extra option cloneNode has a drawback for angularJS. When an ng-if is true at its initial render, the originally slotted content is not visible. This is not a problem for ng-if blocks that start out with a falsy value and are appearing later.

By adding a check to not patch up any non-stencil nodes, this problem seems resolved.

I would like to get some feedback from the maintainers whether this has a chance of making the codebase, it is quite a blocker for our team to upgrade to 1.8.x and higher.

I could not find any tests related to the dom-extra's, please point me in the correct direction if this needs proper coverage.

Here's a demo repository with a stencil generated app (1.8.x), loading a very basic angularJS binding context to demonstrate the problem. In the readme are the steps to reproduce the different problems, and a way to apply the patch of this PR to see the solution.

@justusromijn
Copy link
Contributor Author

justusromijn commented Oct 6, 2020

Ive created a demonstration app to show the problem with the cloneNode patch, once finished I will link it from the PR.

Issue #2257 might be related.

@justusromijn justusromijn changed the title fix: do regular clone of normal slotting fix(runtime): do regular clone of normal slotting Oct 6, 2020
@justusromijn
Copy link
Contributor Author

I've included a test scenario as requested. Its not perfect with the inclusion of the angular library, I could not find a way to prevent double loading when running karma tests (but if I do not load it from the karma config, it seems to also not load from the index file itself). Maybe the Ionic Team can help me out there?

@adamdbradley adamdbradley merged commit 8306f0e into ionic-team:1.8.x Oct 15, 2020
adamdbradley pushed a commit that referenced this pull request Oct 19, 2020
Co-Authored-By: Justus Romijn <1901845+justusromijn@users.noreply.github.com>
adamdbradley pushed a commit that referenced this pull request Oct 22, 2020
Co-Authored-By: Justus Romijn <1901845+justusromijn@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants