Skip to content

Conversation

@dmjio
Copy link
Owner

@dmjio dmjio commented Dec 5, 2025

This should remove intermediate allocations of Value during View m a construction in buildVTree, for select prop combinators. Using the most generic prop combinator is now discouraging in favor of more specific textProp, doubleProp, intProp.

  • Add Property data type.
  • Define integerProp in terms of doubleProp.

There is no ToJSVal on Integer, users can marshall their Integer into a Double, or we can add a custom BigInt (non-IE compatible). Previously integerProp was marshalled into a Scientific value and then converted into a JS float.

Defining integerProp in terms of doubleProp is identical to this.

This should have a dramatic performance improvement on rendering large strings, since we now bypass calls to textFromJSString.

This should remove intermediate allocations of `Value` during `View m
a` construction.

- [x] Constrain `prop` on `ToJSVal a => a`
- [x] Define `integerProp` in terms of `doubleProp`.

There is no `ToJSVal` on `Integer`, users can marshall their `Integer`
into a `Double`, or we can add a custom `BigInt` (non-IE
compatible). Previously `integerProp` was marshalled into a
`Scientific` value and then converted into a JS `float`.

Defining `integerProp` in terms of `doubleProp` is identical to this.
@dmjio dmjio mentioned this pull request Dec 5, 2025
4 tasks
@dmjio dmjio changed the title Define prop in terms of ToJSVal. Add Property data type Dec 5, 2025
@dmjio dmjio marked this pull request as draft December 7, 2025 09:52
@dmjio
Copy link
Owner Author

dmjio commented Dec 11, 2025

Make sure this is tested on the JS backend, w/ WASM it might be slower because it uses Text for everything since its using jsaddle command protocol and not raw FFI backend. Similar to #1264

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants