fable-compiler / Fable.Solid

Fable bindings for SolidJS
http://fable.io/Fable.Solid/
MIT License
45 stars 5 forks source link

Stack overflow when the model includes large lists (1k-2k elements) #15

Open lilnasy opened 12 months ago

lilnasy commented 12 months ago

I am writing an entry for Fable.Solid Elmish in krausest/js-framework-benchmark. The benchmark involves creating, rendering, appending, updating, and deleting rows.

The implementation fails with the error below when the number of rows goes beyond 1k.

image I'm pretty sure application code is not at fault here; the update function returns control without any errors after adding over 1k elements to the model. You can see the full code here: App.fs

AlexErrant commented 11 months ago

Unrelated, but Ryan ran into your PR on stream and was amused.

joprice commented 2 weeks ago

I was able to get this working with a few changes: https://github.com/krausest/js-framework-benchmark/compare/master...joprice:js-framework-benchmark:solidjs-elmish

MangelMaxime commented 2 weeks ago

Tuples are represented using arrays.

let a = "maxime", 32
export const a = ["maxime", 32];
goswinr commented 2 weeks ago

To track changes in an array, you would have to use a Foror Index component. Only functions and member expressions (=property access) are tracked when used in a reactive scope ( e.g. an effect or in JSX). That is why anonymous records work and tuples not.

(BTW I just updated the samples in this repo to use the latest version of solid-js)