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

Make validate and invalidate protected #290

Closed
sorvell opened this issue Nov 5, 2018 · 4 comments · Fixed by #368
Closed

Make validate and invalidate protected #290

sorvell opened this issue Nov 5, 2018 · 4 comments · Fixed by #368

Comments

@sorvell
Copy link
Member

sorvell commented Nov 5, 2018

These are useful extension points for scheduling rendering so they should be protected.

@sorvell sorvell added this to the 0.7.0 milestone Nov 5, 2018
@sorvell sorvell self-assigned this Nov 5, 2018
@dorivaught dorivaught modified the milestones: 0.7.0, 1.0.0 Nov 29, 2018
@Westbrook
Copy link
Contributor

I'd love to help get this closed as it looks like a blocker to 1.0.0! If you aren't already working on it, of course...

This change is mainly updating:

private _validate() {

to

protected validate() {

and

private async _invalidate() {

to

protected async invalidate() {

and then making reference corrections across the repo, right?

I'll get started on putting together PR, but look forward to any other desires around this in the interim!

@Westbrook
Copy link
Contributor

I could probably use some help with the README content, too!

@daKmoR
Copy link
Contributor

daKmoR commented Nov 30, 2018

As I just saw it here: https://github.com/Polymer/lit-element/pull/276/files#diff-c5f280d12b2d91f8b89fe4ac3b6313d8R522

I think it will still be

protected _validate() {
protected async _invalidate() {

to keep following the naming conventions (as real protected and private are probably still some time off for "plain" javascript 🙈 )

@Westbrook
Copy link
Contributor

I guess it's a question of whether it's a lifecycle method, or an extension point... I was basing my decision off of https://github.com/Polymer/lit-element/blob/master/src/lib/updating-element.ts#L589

Hope this conversations is helping more than it's hurting @sorvell. Let me know which way I can move forward on this!

sorvell pushed a commit that referenced this issue Dec 13, 2018
Fixes #290. The previous private `_validate` method has been made protected and named `performUpdate`. It's all now possible to return a promise from this method and doing so will block the update's completion until the promise is resolved. This allows control over the timing of update and integration with schedulers.

Fixes #258. Updates are now deferred until element connection. This ensures that microtask checkpoints that may occur during element construction do not generate errors or cause extra update cycles.
kevinpschaaf pushed a commit that referenced this issue Dec 18, 2018
* Adds `performUpdate` and defers update until connection

Fixes #290. The previous private `_validate` method has been made protected and named `performUpdate`. It's all now possible to return a promise from this method and doing so will block the update's completion until the promise is resolved. This allows control over the timing of update and integration with schedulers.

Fixes #258. Updates are now deferred until element connection. This ensures that microtask checkpoints that may occur during element construction do not generate errors or cause extra update cycles.

* Format.

* Address review feedback.

* Address review feedback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants