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

Added pure functions idea to the timing alternatives. #47

Merged
merged 2 commits into from
May 1, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion proposals/Imperative-API-for-Node-Distribution-in-Shadow-DOM.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,18 @@ Introduce a variant of mutation observers where the callback is invoked after ea
- It could be as messy as old mutation events
- Might be still too expensive to use with the second approach which requires collecting every distribution candidate.

## 4. Not a problem for v1
## 5. Run Distribution Callback in a Separate Scripting Context or as Pure Function
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps this should be 4?


Yet another approach is to decouple the timing from the observability by making callback execution not be observable. This can be accomplished by either creating a separate scripting context just for running distribution callbacks (similar to Houdini [ideas](https://wiki.css-houdini.org/explaining-css-layout#layout)), or some sort of not-yet-invented [pure function](http://en.wikipedia.org/wiki/Pure_function) ECMAScript primitive.

### Pros
- Provides consisten distribution state to user code
- Interoperable

### Cons
- Both separate scripting context and pure function ideas need much more thorough examination and may take years to get right


## 4. Not a Problem for v1
Copy link
Collaborator

Choose a reason for hiding this comment

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

and this be 5?


At least the distribution API proposals 1/2 have some way forward where triggering can be introduced later and therefore this might not be a problem we want to address for v1.