cincheo / jsweet

A Java to JavaScript transpiler.
http://www.jsweet.org
Other
1.46k stars 158 forks source link

nk-ui: new candy to create UI and comunicate with server #537

Closed naskarlab closed 4 years ago

naskarlab commented 5 years ago

Hi guys,

Firstly, I want to give the congratulations for implementation of the jsweet library.

Second, I created a candy that creates UI and communicates with server. When you have a moment, please take a look and let me know what you think.

https://github.com/naskarlab/nk-ui https://github.com/naskarlab/nk-ui-sample/

Thanks

renaudpawlak commented 5 years ago

I appreciate the nice work. Thanks for sharing! Not sure how people would get motivated to use it considering all the alternatives to program web applications ;) You may want to look at this project that shows how to interoperate between a Typescript frontend and a Java backend (just for inspiration maybe). That would be nice to have an online demonstrator of your sample application. If you allow it, we can reference it from JSweet's web site.

Edit: I forgot the link: https://github.com/amaris/javatsinterop

naskarlab commented 5 years ago

Thanks for your support, I think your analysis is very important.

I had many problems separating the frontend on TypeScript (react, vuejs and angular 1.x) and backend in Java. This model requires a strong API contract for what this approach to work, as well as a knowledge of the various technologies involved, the famous fullstack.

I believe that tools like JSweet, TeaVM, Kotlin JS, are a better approach.

What is interesting about jsweet is the possibility of a developer to code a complete feature with greater productivity and a high level of reuse of components in the same technology, in this case, Java.

Compile checker, refactoring tools, complete code, static analysis (SONAR) are productivity differentials in using JSweet with Java.

About the javatsinterop library, in nk-ui approach, a call from an API service is as simple as calling a class method, without annotations, processors, bindinds or dependencies, they are simple POJO and services classes.

I published the sample on heroku and jars on bintray maven repository.

https://nk-ui-sample.herokuapp.com/

https://bintray.com/rafaeluchoanaskar/naskarlab

You can see on gitpod too:

https://gitpod.io/#snapshot/f9ce1083-5a3f-40d6-92e2-af9038faaabb

renaudpawlak commented 5 years ago

Neat. Actually I always thought that the way to leverage JSweet was to build that sort of framework. Sometimes it is better to start from scratch rather than trying to integrate to existing technologies at all costs. I will reference your project from JSweet.org as soon as I find the time. Thanks!