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

[Engine] expose an updated callback for services #163

Closed
kevinv11n opened this issue Mar 17, 2018 · 4 comments
Closed

[Engine] expose an updated callback for services #163

kevinv11n opened this issue Mar 17, 2018 · 4 comments

Comments

@kevinv11n
Copy link
Contributor

kevinv11n commented Mar 17, 2018

Description

Engine services currently have these callbacks:

export interface ServiceDef {
    wiring?: ServiceCallback;
    connected?: ServiceCallback;
    disconnected?: ServiceCallback;
    rendered?: ServiceCallback;
    piercing?: MembranePiercingCallback;
}

This issue proposes an additional callback: updated. This is fired once if one or more tracked properties are updated.

Wire service will leverage this. It will allow wire service to stop monkey patching the component instance with setters to intercept updates to properties used in its DSL ($-prefixed variables). It will reduce an additional microtask used to collect all property changes.

More details to come.

@kevinv11n
Copy link
Contributor Author

fyi @caridy @yungcheng

@caridy
Copy link
Contributor

caridy commented Nov 23, 2018

@kevinv11n is this still something that we need to consider? or can this be closed?

@kevinv11n
Copy link
Contributor Author

We’ll move @wire to a real decorator in the future which makes the service usable in other frameworks. Property descriptor hooks remain the approach which will still require a microtask to queue for when all property updates are complete.

@jbenallen
Copy link

The @wire decorator implementation will need access to the element's lifecycle callbacks, which means that its implementation will need access to privileged hooks as it has through the service hooks today. It's the same technical obstacles related to #512.

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

No branches or pull requests

4 participants