react-lua icon indicating copy to clipboard operation
react-lua copied to clipboard

ReactBinding Rewrite

Open gaymeowing opened this issue 3 months ago • 1 comments

Rewrites ReactBinding to be cleaner, and also use less memory as its now properly using metatables.

  • Improve error messages
  • Removes use of pairs()
  • Removes impl table jank
  • Removes createSignal as its no-longer used
  • Remove BindingInternal<T> type as its useless (will be replacing with proper types for each prototype table and each type of binding in React Next, I just cant be bothered to do proper types when its going to be thrown out soon anyways)
  • Rename BindingInternalApi table to ReactBinding
  • Mark __subscribeToBinding as depricated as every binding now has a :_subscribe() method that should be used instead
  • Makes RobloxComponentProps use _:subscribe()
  • Make the update function not iterate twice when firing off callbacks
  • Signal implementation for bindings now uses less memory, as it only uses one table for storing callbacks and nolonger creates connection objects

Checklist before submitting:

  • [x] Added/updated relevant tests
  • [x] Added/updated documentation

gaymeowing avatar Sep 29 '25 22:09 gaymeowing

image

Ran on:

image

Benchmark place: ReactBindingRewriteBenchmark.zip

gaymeowing avatar Sep 30 '25 12:09 gaymeowing