Building with Parenscript and Preact: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Created page with "I read an article a while back about Parenscript, and the way he described it makes it seem downright romantic. <blockquote> Helpful? Olaf is clearly a master of understatement. Try beautiful. [...] It contains syntactic sweeteners for React classes, methods, properties, and most important, DOM tree generation. Olaf had thereby done away with React's grossest feature, the JSX minilanguage, in about 10 lines of code. [...] It will not only educate but inspire you. </bloc...")
 
No edit summary
Line 44: Line 44:
</syntaxhighlight>
</syntaxhighlight>


When you execute that chunk of code, it (re)defines a component, interfaces with Preact's prefresh package and then flushes updates, effectively performing a hot replacement of the component. And it's true, it only took about 50 lines of macro code to implement. Combine that with trident-mode to push the snippets to the frontend for evaluation, and you have a full fledged interactive hot reloading environment! I don't want to get all Reddit about it, but "look at what they need to mimic a fraction of our power."
When you execute that chunk of code, it (re)defines a component, interfaces with Preact's prefresh package and then flushes updates, effectively performing a hot replacement of the component. And it's true, it only took about 50 lines of macro code to implement. Combine that with trident-mode to push the snippets to the frontend for evaluation, and you have a full fledged interactive hot reloading environment! I don't want to get all Reddit about it, but:
 
[[File:8q5nqk.jpg]]


Once I had this in hand, I got to work implementing the actual card game.
Once I had this in hand, I got to work implementing the actual card game.

Navigation menu