Skip to content

Commit

Permalink
Add notes
Browse files Browse the repository at this point in the history
  • Loading branch information
dy committed Oct 22, 2024
1 parent bb9824c commit 71792dc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
32 changes: 16 additions & 16 deletions r&d.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
- We can use `:="{data}"` fro sprae autoinit, since scope has confusing name: `:scope={}`, `:sprae={}`, `:with={}`
-> let's use :prop= for now, since `:={}` can have multiple interpretations

## [ ] What's a use-case for `:={props}` - do we need it? -> likely yes
## [x] What's a use-case for `:={props}` - do we need it? -> likely yes

* {...props} is useful in react components to pass down all unmentioned or unknown props to children
- but sprae is not about componentization
Expand Down Expand Up @@ -690,29 +690,29 @@
## [ ] Prop modifiers

- overall seems code complication without much benefit
* [ ] value.bind? value.watch?
* value.bind? value.watch?
- let's wait for use-case: value can be too big to set it every time
* [ ] prop.reflect, prop.observe
* prop.reflect, prop.observe
- let's wait for use-case
* [ ] prop.boolean, .number, .string, .array, .object
* prop.boolean, .number, .string, .array, .object
- let's wait for use-case
* [ ] prop.once, prop.fx ? prop.init?
* prop.once, prop.fx ? prop.init?
- doesn't seem required, let's wait for use case
* [ ] prop.change - run only if value changes
* prop.change - run only if value changes
- seems like unnecessary manual optimization that must be done always automatically
? are there cases where force-update is necessary?
* [ ] prop.throttle-xxx, prop.debounce-xxx
* prop.throttle-xxx, prop.debounce-xxx
- let's wait until that's really a problem
* [ ] prop.class
* prop.class
? what's the use-case
* [ ] prop.next="" - run update after other DOM updates happen
* [ ] prop.fx="" - run effect without changing property
* [ ] x.prop="xyz" - set element property, rather than attribute (following topic)
* [ ] x.raf="abc" - run regularly?
* [ ] x.watch-a-b-c - update by change of any of the deps
* [ ] :x.always - update by _any_ dep change
* [ ] :class.active="active"
* [ ] :x.persist="v"
* prop.next="" - run update after other DOM updates happen
* prop.fx="" - run effect without changing property
* x.prop="xyz" - set element property, rather than attribute (following topic)
* x.raf="abc" - run regularly?
* x.watch-a-b-c - update by change of any of the deps
* :x.always - update by _any_ dep change
* :class.active="active"
* :x.persist="v"
- solvable via nadis

## [x] Writing props on elements (like ones in :each) -> nah, just use `:x="this.x=abc"`
Expand Down
1 change: 1 addition & 0 deletions test/optional.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ test("data: base", async () => {
is(el.outerHTML, `<input data-a="1" data-foo-bar="2" data--upper-case="3">`);
});

// NOTE: we don't have :html anymore
test.skip("html: by ref", async () => {
let a = h`<template :ref="abc"><div :text="123"></div></template><x :html="abc">456</x>`;
sprae(a);
Expand Down

0 comments on commit 71792dc

Please sign in to comment.