From 2c6853758a19b6f31358c9a6775060216bcd05cb Mon Sep 17 00:00:00 2001 From: Dimitri Glazkov Date: Fri, 1 May 2015 12:48:22 -0700 Subject: [PATCH 1/2] Added pure functions idea to the timing alternatives. --- ...tive-API-for-Node-Distribution-in-Shadow-DOM.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/proposals/Imperative-API-for-Node-Distribution-in-Shadow-DOM.md b/proposals/Imperative-API-for-Node-Distribution-in-Shadow-DOM.md index 4a45cc14..45a073f0 100644 --- a/proposals/Imperative-API-for-Node-Distribution-in-Shadow-DOM.md +++ b/proposals/Imperative-API-for-Node-Distribution-in-Shadow-DOM.md @@ -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 + +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 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. From afdc5768bf49673077595d1b6279d85410a8af44 Mon Sep 17 00:00:00 2001 From: Dimitri Glazkov Date: Fri, 1 May 2015 14:43:37 -0700 Subject: [PATCH 2/2] Fixed numbering. --- .../Imperative-API-for-Node-Distribution-in-Shadow-DOM.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proposals/Imperative-API-for-Node-Distribution-in-Shadow-DOM.md b/proposals/Imperative-API-for-Node-Distribution-in-Shadow-DOM.md index 45a073f0..d4191c60 100644 --- a/proposals/Imperative-API-for-Node-Distribution-in-Shadow-DOM.md +++ b/proposals/Imperative-API-for-Node-Distribution-in-Shadow-DOM.md @@ -210,7 +210,7 @@ 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. -## 5. Run Distribution Callback in a Separate Scripting Context or as Pure Function +## 4. Run Distribution Callback in a Separate Scripting Context or as Pure Function 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. @@ -222,6 +222,6 @@ Yet another approach is to decouple the timing from the observability by making - 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 +## 5. Not a Problem for v1 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.