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.
Thanks,
Bill
On Tue, Apr 7, 2015 at 6:12 PM, Stuart Douglas <sdouglas(a)redhat.com> wrote:
Hi all,
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.
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'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.
Injection support is pluggable, and this can be used programatically from
embedded Undertow.
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.
When using Wildfly upstream'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.
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.
Full details are here:
https://github.com/undertow-io/undertow.js
I have an example of the Kitchen Sink Wildfly quickstart that has been
re-done to use this here:
https://github.com/wildfly/quickstart/compare/master...stuartwdouglas:js#...
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.
Stuart
_______________________________________________
undertow-dev mailing list
undertow-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/undertow-dev