<div dir="ltr">Could this potentially be used to server side render react.js components inside of undertow to create an isomorphic app?  I was considering investigating a way to do that.<div><br></div><div>Thanks,</div><div>Bill</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 7, 2015 at 6:12 PM, Stuart Douglas <span dir="ltr">&lt;<a href="mailto:sdouglas@redhat.com" target="_blank">sdouglas@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
There has been some discussion about supporting JavaScript in Wildfly/Undertow for a while now, and as a result I have come up with a simple proof of concept of the form I think this support could take.<br>
<br>
The form that this is taking is undertow.js, which is a jar file that you can include in your apps and allows you to register JavaScript based handlers. These handlers can be mapped to URL&#39;s, and inject container resources such as CDI beans and JNDI data sources. It also provide some simple JavaScript wrappers to make some EE objects easier to use from scripts.<br>
<br>
Injection support is pluggable, and this can be used programatically from embedded Undertow.<br>
<br>
At the moment handlers are mainly useful as REST endpoints, although if there is interest I am planning on adding template engine support as well.<br>
<br>
When using Wildfly upstream&#39;s new external resources feature this allows for changes in your script files to be immediately visible, without even needing to copy to an exploded deployment.<br>
<br>
I envisage the main use of this will not be creating node.js like apps that are pure javascript, but rather to allow simpler parts of the of a mostly Java app to be written in JavaScript, providing a hybrid approach and this avoiding the compile+redeploy cycle for the javascript parts.<br>
<br>
Full details are here: <a href="https://github.com/undertow-io/undertow.js" target="_blank">https://github.com/undertow-io/undertow.js</a><br>
<br>
I have an example of the Kitchen Sink Wildfly quickstart that has been re-done to use this here:<br>
<br>
<a href="https://github.com/wildfly/quickstart/compare/master...stuartwdouglas:js#diff-598449fd216b3768c251e297895211deR1" target="_blank">https://github.com/wildfly/quickstart/compare/master...stuartwdouglas:js#diff-598449fd216b3768c251e297895211deR1</a><br>
<br>
At this stage I am really not sure how this will evolve, or if it will go anywhere, I am just putting it out there to get some feedback.<br>
<br>
Stuart<br>
_______________________________________________<br>
undertow-dev mailing list<br>
<a href="mailto:undertow-dev@lists.jboss.org">undertow-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/undertow-dev</a><br>
</blockquote></div><br></div>