Comments (3)
this.hasRendered
- easy to do yourself within the render loop
this.isRefreshing
- a fun name for its pun potential but hard to determine for async trees. Is an enqueued update a refreshing update if it is the result of both a parent rendering and a refresh call? Should the last call determine this?
from crank.
I have been toying with the idea of computed properties which match the special props. There could even be special behaviors when reading/writing, if it makes sense. What would reading each computed property mean for each prop
?
-
this.$key
for$key
- Readable?
Readability case is great. Great for visually debugging key behavior, which is actually tricky. I often pass the key along as a data attributedata-key
, I just want to get what the key is so I can do some sanity checks.
Could even make the case for key chains (not sure what this means but it sounds interesting) - Writeable???
Not really sure what over-writing a key would do. A component which re-assigns its key to a new value, would be the same as committing seppuku. The valid result might be instant unmounting (and remounting), but what is the use-case of that?
One thing I have wanted is the ability for components to somehow “suggest” a key to the parent. I thought that make this API could be verbosely written asthis.setOuterKey(key)
. The idea would be giving the component a suggested key when a$key
is not explicitly passed.
The implementation of outer keys or over-writable keys suffers from a chicken and egg problem, where a component can’t suggest a key without being called, but we don’t really know how to call the component without knowing if there’s already a keyed instance with the same key. API would have to be constrained somehow. Or maybe we need dark magic.
- Readable?
-
this.$ref
for$ref
- Readable?
If refs are just callbacks, then readingthis.$ref
might imply the default behavior for refs and components is disabled. The idea is if you read the ref, you are responsible for calling it with the thing you need, probably passing the ref to a child. - Writable
Probably no valid use-cases for a writeablethis.$ref
- Readable?
-
this.$static
for$static
- Readable???
this.$static
would always be false if the component is rendering, so uhhhh not sure. - Writable?
Could create some optional default static semantics to fully isolate a child rendering from a parent rendering. But a lot of the same problems as writable$key
, it would be dark magic.
- Readable???
from crank.
Related Issues (20)
- tolerate nullish/undefined elements for props in html renderer
- Allow the Context type to be passed a Component type to infer props HOT 1
- Uncaught TypeError: Invalid value used as weak map key HOT 6
- jsx-runtime missing HOT 6
- Allow generator functions to yield once so we don’t have to use try/finally HOT 1
- Restart generator components which return when re-rendered HOT 1
- Precise DOM mutations HOT 1
- Allow async generator components to use `for... of` HOT 2
- `null` vs `undefined` as a way to indicate deleting props/attributes from host elements HOT 2
- Async unmounting/updating
- Better error messages for tagged template function Syntax Errors.
- Call `cleanup()` functions even if component is unmounted HOT 1
- Full-stack (meta?) framework / CLI HOT 2
- Adopt React’s element identity behavior HOT 1
- Errors being swallowed in the second async component of a race. HOT 1
- Export `renderer` and `Renderer` based on environment from `@b9g/crank/standalone`
- The type="text" attribute on input elements is being removed HOT 6
- Use `key`, `ref` and `static` props instead of the variants HOT 6
- Attempting to set up with Vite HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crank.