On Wed, Apr 14, 2021 at 5:23 AM [email protected] <
[email protected]> wrote:

> This is something I have been pushing my teams to do.
>
> We keep out GWT apps very simple, just "CRUD" so that they can run in
> DevMode but also de-couple from business logic and background tasks as much
> as possible, a microservices approach.
>
> If that is not enough we equip the GWT app strictly with front-end code,
> we keep the back-end services in a separate application and bridge the two
> with a remote API (e.g. REST+JSON).
>
> I believe this is what is implied by "pure GWT frontend"
>
> On Tuesday, 13 April 2021 at 20:14:16 UTC+1 [email protected] wrote:
>
>> What do you mean by "pure GWT frontend" ? Do you need servlets ? Or
>> serving only static files would be OK?
>> Because the problem is with server side code.
>>
>
One thing you may want to consider is actually publishing all resources as
"<public/>" assets in your gwt modules. That way you can sneakily use the
codeserver to host your launcher page and everything else and only need the
codeserver. As long as you don't not have massive numbers of local assets
or large size it works quite well. In short we put the launcher html inside
public and use the "/recompile-requester/mygwtmodule" as the url for the js
code.

So in a typical GWT only microservice frontend we end up with 3 GWT modules
(1 common, 1 for local development and 1 for production) that declare 1
public dir each. In each public dir is the appropriate assets (common
assets in common public dir, dev launcher in development public dir,
production launcher in production public dir). Then you can just start
local code server and run the app from in it ;)

For example:

* Common GWT module:
https://github.com/react4j/react4j-heart-rate-monitor/blob/master/src/main/java/react4j/hrm/HeartRateMonitor.gwt.xml
* Development GWT module:
https://github.com/react4j/react4j-heart-rate-monitor/blob/master/src/main/java/react4j/hrm/HeartRateMonitorDev.gwt.xml
* Production GWT module:
https://github.com/react4j/react4j-heart-rate-monitor/blob/master/src/main/java/react4j/hrm/HeartRateMonitorProd.gwt.xml

* Common public assets:
https://github.com/react4j/react4j-heart-rate-monitor/tree/master/src/main/java/react4j/hrm/public/common
* Development GWT Asset (just a launch page):
https://github.com/react4j/react4j-heart-rate-monitor/tree/master/src/main/java/react4j/hrm/public/dev
* Production GWT Asset (just a launch page):
https://github.com/react4j/react4j-heart-rate-monitor/tree/master/src/main/java/react4j/hrm/public/prod

Often we can just use these as is but sometimes we do put a proxy in it
(when they use host relative services/links/whatnot, SSL or other
capabilities). Seems to work fine for us ;)

-- 
Cheers,

Peter Donald

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CACiKNc7nSFd9PUzHQwtgai7EZriU3EOimzBtRgRro1TQ4jfObg%40mail.gmail.com.

Reply via email to