Mixing Iodide with React?

51 views
Skip to first unread message

Simon Frost

unread,
Mar 15, 2019, 11:09:49 AM3/15/19
to iodide-dev
Dear All,

This is probably the wrong place to post - but better than an issue on GitHub - can you mix React with JSMD? This fails to render:


Is there a way to escape the rendered HTML code.

Also, it is possible to name the module that comes back from fetch? Importing React gives reactDom rather than ReactDOM.

Best
Simon

Hamilton Ulmer

unread,
Mar 15, 2019, 11:46:15 AM3/15/19
to Simon Frost, iodide-dev
(oops, I only replied to Simon before - adding iodide-dev)

Hey Simon! The issue is that your code has JSX in it, which by default iodide does not support. I did duct-tape together a JSX language plugin, however, which you can see here:


Wouldn't trust the plugin too much, since I made that a while ago and I'm sure it could be made better. If that's something that interests you, feel free to reach me at this email address and we can chat more.

If you use React without JSX, however, it should work as you expect.


--
You received this message because you are subscribed to the Google Groups "iodide-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iodide-dev+...@googlegroups.com.
To post to this group, send email to iodid...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/iodide-dev/d82e2d6c-d99d-464d-a4bb-d7f5aa947e5a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Simon Frost

unread,
Mar 15, 2019, 1:45:55 PM3/15/19
to iodide-dev
Dear Hamilton,

Thanks! I've updated https://alpha.iodide.io/notebooks/585/ as per your advice. Any comments on naming the module returned by fetch?

Best
Simon

Hamilton Ulmer

unread,
Mar 15, 2019, 1:55:35 PM3/15/19
to Simon Frost, iodide-dev
We don't have many feelings about that at this point, but I can see a case for naming es modules the way we do for text, json, and blob. Feel free to file an issue about that if you'd like!

--
You received this message because you are subscribed to the Google Groups "iodide-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iodide-dev+...@googlegroups.com.
To post to this group, send email to iodid...@googlegroups.com.

brendan c.

unread,
Mar 15, 2019, 3:19:23 PM3/15/19
to iodide-dev
Hamilton do you think it would be worth setting up a repo for you JSX plugin under iodide-project? Perhaps interested folks would be able jump in and help get it to the point where it feels robust and tested enough to recommend without reservation?


On Friday, March 15, 2019 at 10:55:35 AM UTC-7, Hamilton Ulmer wrote:
We don't have many feelings about that at this point, but I can see a case for naming es modules the way we do for text, json, and blob. Feel free to file an issue about that if you'd like!

On Fri, Mar 15, 2019 at 10:45 AM Simon Frost <sdwf...@gmail.com> wrote:
Dear Hamilton,

Thanks! I've updated https://alpha.iodide.io/notebooks/585/ as per your advice. Any comments on naming the module returned by fetch?

Best
Simon

--
You received this message because you are subscribed to the Google Groups "iodide-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iodide-dev+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages