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

Clean up and simplify setupRenderingContext #296

Merged
merged 1 commit into from
Jan 1, 2018

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Dec 31, 2017

Moves core functionality into the importable render / clearRender / etc utility functions and out of the setupRenderingContext directly.

This simplifies how the methods work together (since they no longer have access to everything in closure scope), and sets the stage for an eventual deprecation of this.render and this.clearRender.

@rwjblue rwjblue requested a review from Turbo87 December 31, 2017 03:10
// In older Ember versions (2.4) the element itself is not stable,
// and therefore we cannot update the `this.element` until after the
// rendering is completed
context.element = document.querySelector('#ember-testing > .ember-view');
Copy link
Member

Choose a reason for hiding this comment

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

I assume this will break once the RFC from @cibernox is implemented?

Copy link
Contributor

Choose a reason for hiding this comment

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

It probably will 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

It just changes to use the rootElement directly (based on a feature detect):

context.element = getRootElement();

At which point the various interaction helpers (which were just changed to use rootElement instead of this) and this.element will be back in sync...

Moves core functionality into the importable `render` / `clearRender` /
etc utility functions and out of the `setupRenderingContext` directly.

This simplifies how the methods work together (since they no longer have
access to _everything_ in closure scope), and sets the stage for an
eventual deprecation of `this.render` and `this.clearRender`.
@rwjblue rwjblue force-pushed the refactor-setup-rendering-test branch from 3aef417 to 26c7ad8 Compare December 31, 2017 23:00
@rwjblue rwjblue merged commit 767d54d into emberjs:master Jan 1, 2018
@rwjblue rwjblue deleted the refactor-setup-rendering-test branch January 1, 2018 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants