syrjs / core

Light Dynamic UI Engine for Native and Web with a React Like API
http://syr.js.org
MIT License
56 stars 24 forks source link

Use babel-plugin-rawact? #280

Open brodycj opened 5 years ago

brodycj commented 5 years ago

I found https://github.com/sokra/rawact (babel-plugin-rawact) last week, wonder if it could help support a similar programming API more efficiently?

dmikey commented 5 years ago

So I took a look, and the only issue with this, is that we've completely removed the dependency on any react (even at build time), we actually transform directly to an AST using only Babel's support for recognizing JSX trees, and since we have API's to represent both natively and on the javascript side, there's a bit more glue that we require for event life cycles. Looks like Rawact is an awesome step, just not sure it fits in with out current paradigm. Thanks for pointing it out!

brodycj commented 5 years ago

Thanks @dmikey, makes sense.

It looks to me like the counterpart to React VDOM is in raster.js (https://github.com/syrjs/core/blob/develop/lib/rasters/dom/raster.js). I saw it before, wonder if we should documented it better someday. I think a comparison would be nice.

dmikey commented 5 years ago

That's actually a great idea. Re-opening issue for discussion. You're totally right, that it should be better documented so that the comparison makes more sense.