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(engine): refactor boundary protection for render phase #1551

Merged

Conversation

ravijayaramappa
Copy link
Contributor

Details

Porting changes from #1507

  1. User land code is protected from making dangerous mutation during rendering phase.
  2. Rendering a component is two steps, first the render() is invoked and then the returned template is evaluated.
  3. The userland code was being protected using one global flag called isRendering.
  4. In between these two steps, the engine is executing its own routine and does not need to be protected from dangerous mutations.

This PR separates the flag into two. One for render invocation and another for template evaluation.

Fixes issue #1506

Does this PR introduce breaking changes?

  • No, it does not introduce breaking changes.

If yes, please describe the impact and migration path for existing applications.

The PR fulfills these requirements:

  • Have tests for the proposed changes been added? ✅
  • Have you followed these instructions to clearly describe the issue being fixed or feature enhanced? ✅

* test: automation for issue#1506
test case: A parent switches template and a child being disconnected sets a tracked property in  disconnectedCallback
* fix: mark template evaluation as a separate global flag
* fix: split boundary protection for render into two steps
test: run test only if global promise rejection handler is supported
@ravijayaramappa ravijayaramappa force-pushed the ravi/master/rendering-invariant-refactor/W-6572707 branch from 222a33b to 099f288 Compare October 4, 2019 17:50
@ravijayaramappa ravijayaramappa merged commit 4942cc4 into master Oct 14, 2019
@ravijayaramappa ravijayaramappa deleted the ravi/master/rendering-invariant-refactor/W-6572707 branch October 14, 2019 19:30
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.

3 participants