mayu-live / framework

Mayu is a live updating server-side component-based VDOM rendering framework written in Ruby
https://mayu.live
GNU Affero General Public License v3.0
139 stars 4 forks source link

Transform instance and global variables to state and props #50

Closed aalin closed 1 year ago

aalin commented 1 year ago

Transform @foo into self.state[:foo] and @bar into self.state[:bar], also wrap @foo = 123 within self.update { self.state[:foo] = 123 }

Instance variables and global variables aren't really needed in components. State needs to be managed, so better use this syntax.

Not sure if it would be a good idea to keep the globals related to regexps

aalin commented 1 year ago

I just did this for props in the main branch. Need to think a little bit more about what to do about instance variables