Im interested in creating a web toolkit (similar to GWT but modernized) based on TeaVM. The core features of this toolkit should be
1) ability to create components with the compiled javascript and associated css inside the final app bundle (no separate style sheet needs to be added to use the component)
2) an RPC mechanism
3) a template library similar to GWT's UIBinder.
I looked into using TeaVM meta programming to implement 1): I was trying to read a css file a compile time and inject the string into the emitted javascript. But I was not successful. For the above features, having the compiler read files and do something with the contents is necessary. Can someone on this forum offer me guidance?
Im interested in creating a web toolkit (similar to GWT but modernized) based on TeaVM. The core features of this toolkit should beHi. Fortunately, you don't need to create it from scratch. You can borrow ideas or even fork my attempt to do such framework: https://github.com/konsoletyper/teavm-flavour1) ability to create components with the compiled javascript and associated css inside the final app bundle (no separate style sheet needs to be added to use the component)What is "a component"? And if you want to bundle CSS with a component, how would one re-use your components in their site with their own style/color theme/etc?
2) an RPC mechanismRPC (or at least how it was implemented in GWT) is a bad idea. Everybody is using something like REST/JAX-RS or Swagger/OpenAPI. Or if you want RPC, then gRPC would be a solution. So it should be something standart, not GWT-style thing that is only limited to some particular framework.
3) a template library similar to GWT's UIBinder.GWT's UIBinder is also a bad idea. Look how the same thing done in React, Angular, Vue or Svelte. Compared to them UIBinder is inapt to solve any practical task that occur as you want to write anything more complex than Hello, world.
I looked into using TeaVM meta programming to implement 1): I was trying to read a css file a compile time and inject the string into the emitted javascript. But I was not successful. For the above features, having the compiler read files and do something with the contents is necessary. Can someone on this forum offer me guidance?I'm afraid that reading an external file is out of compilation scope.You can try to use `Metaprogramming.getClassLoader` and read a resource, but with something "external" there's nothing ready-to-use, you have to invent it yourself. And what exactly do you mean by "I was not successful"?
2) an RPC mechanismRPC (or at least how it was implemented in GWT) is a bad idea. Everybody is using something like REST/JAX-RS or Swagger/OpenAPI. Or if you want RPC, then gRPC would be a solution. So it should be something standart, not GWT-style thing that is only limited to some particular framework.gRPC is a possibility. So is having a good client implementation of object mapper. But just REST and JSON can be cumbersome and its use is more to serve as an generic API for arbitrary web/iOS/android clients. Being able to make REST calls is always supported, but RPC is a powerful mechanism when there is tight, monolithic shared client-server code. For example, I am implementing a page-layout editor, and want the ability to print the created document to PDF. On the client, canvas is used. For Printing on the server, Java2d is used. But the drawing code is the same Java code on both the client and the server. With RPC I just pass the Document object to the remote print method and it just works. No need to serialize to a JSON string, and ultimately if I did this would fundamentally be RPC and not REST. I think the term "REST" gets misused alot in the frontend industry.
3) a template library similar to GWT's UIBinder.GWT's UIBinder is also a bad idea. Look how the same thing done in React, Angular, Vue or Svelte. Compared to them UIBinder is inapt to solve any practical task that occur as you want to write anything more complex than Hello, world.I disagree. Its just a declarative XML, as are other UI format frameworks XAML and indeed html itself. I think youre referring to complaints that GWT is widget based and does not easily let you just use HTML/CSS. But there is no reason a UIBinder cannot be similar to how the javascript frameworks do it. The main thing is allows the "binding" of UI elements to objects.
I looked into using TeaVM meta programming to implement 1): I was trying to read a css file a compile time and inject the string into the emitted javascript. But I was not successful. For the above features, having the compiler read files and do something with the contents is necessary. Can someone on this forum offer me guidance?I'm afraid that reading an external file is out of compilation scope.You can try to use `Metaprogramming.getClassLoader` and read a resource, but with something "external" there's nothing ready-to-use, you have to invent it yourself. And what exactly do you mean by "I was not successful"?I was hoping that there was a way to tell the compiler to read a string called "cssString" from a file and then emit code like "injectStyle( cssString)"
I am willing to hire someone to help implement these, if people on this forum who have worked on the TeaVM compiler are interested.
2) an RPC mechanismRPC (or at least how it was implemented in GWT) is a bad idea. Everybody is using something like REST/JAX-RS or Swagger/OpenAPI. Or if you want RPC, then gRPC would be a solution. So it should be something standart, not GWT-style thing that is only limited to some particular framework.gRPC is a possibility. So is having a good client implementation of object mapper. But just REST and JSON can be cumbersome and its use is more to serve as an generic API for arbitrary web/iOS/android clients. Being able to make REST calls is always supported, but RPC is a powerful mechanism when there is tight, monolithic shared client-server code. For example, I am implementing a page-layout editor, and want the ability to print the created document to PDF. On the client, canvas is used. For Printing on the server, Java2d is used. But the drawing code is the same Java code on both the client and the server. With RPC I just pass the Document object to the remote print method and it just works. No need to serialize to a JSON string, and ultimately if I did this would fundamentally be RPC and not REST. I think the term "REST" gets misused alot in the frontend industry.With Swagger and JAX-RS you just call a method as well. So there's simply no need to create something non-standard.3) a template library similar to GWT's UIBinder.GWT's UIBinder is also a bad idea. Look how the same thing done in React, Angular, Vue or Svelte. Compared to them UIBinder is inapt to solve any practical task that occur as you want to write anything more complex than Hello, world.I disagree. Its just a declarative XML, as are other UI format frameworks XAML and indeed html itself. I think youre referring to complaints that GWT is widget based and does not easily let you just use HTML/CSS. But there is no reason a UIBinder cannot be similar to how the javascript frameworks do it. The main thing is allows the "binding" of UI elements to objects.No, UIBinder is only limited to binding properties of views to object's properties. As a developer I would expect that such tool can do something that a template engline would do, e.g. bind a list and make template engine repeat part of markup for every object in list, support conditions, etc.
I looked into using TeaVM meta programming to implement 1): I was trying to read a css file a compile time and inject the string into the emitted javascript. But I was not successful. For the above features, having the compiler read files and do something with the contents is necessary. Can someone on this forum offer me guidance?I'm afraid that reading an external file is out of compilation scope.You can try to use `Metaprogramming.getClassLoader` and read a resource, but with something "external" there's nothing ready-to-use, you have to invent it yourself. And what exactly do you mean by "I was not successful"?I was hoping that there was a way to tell the compiler to read a string called "cssString" from a file and then emit code like "injectStyle( cssString)"From which file?
I am willing to hire someone to help implement these, if people on this forum who have worked on the TeaVM compiler are interested.
Nope, I'm not interested at all--
You received this message because you are subscribed to a topic in the Google Groups "TeaVM" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/teavm/Y8J87YBdrbY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to teavm+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/teavm/01556d7a-cef2-4fa4-bef0-7d22fcb2e129n%40googlegroups.com.
To unsubscribe from this group and all its topics, send an email to teavm+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/teavm/01556d7a-cef2-4fa4-bef0-7d22fcb2e129n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "TeaVM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to teavm+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/teavm/0f2f7003-7351-4c32-8824-e5dddce29a55n%40googlegroups.com.
I looked into using TeaVM meta programming to implement 1): I was trying to read a css file a compile time and inject the string into the emitted javascript. But I was not successful. For the above features, having the compiler read files and do something with the contents is necessary. Can someone on this forum offer me guidance?
I'm afraid that reading an external file is out of compilation scope.You can try to use `Metaprogramming.getClassLoader` and read a resource, but with something "external" there's nothing ready-to-use, you have to invent it yourself. And what exactly do you mean by "I was not successful"?
I was hoping that there was a way to tell the compiler to read a string called "cssString" from a file and then emit code like "injectStyle( cssString)"
From which file?
Any file in the project.
Which file? Can you define exactly what you mean
by 'read a string called "cssString" from a file'? What file you
are going to use, how are you going encode a string, how are you
going to extract a string, what is 'a string' in the first
place?
Also, I still don't understand the whole idea with keeping CSS right
with component code. Imagine I write a component which Alice and Bob
want to use in their web applications, each having own style. In case of
CSS file coming right with component itself they are tied to the style I
supplied with my component, right? In case I don't have any pre-existing
CSS, it's easy: they just take my component and write CSS that matches
styles of their apps.
--
You received this message because you are subscribed to the Google Groups "TeaVM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to teavm+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/teavm/1745273b-a63c-42e4-a98f-ffc0de6e44c0n%40googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/teavm/CABiRg%2BTYnS9Hrg_q8udv92DfC1oW%2Bbrdb-17oZ5zPgX3U7Vm1A%40mail.gmail.com.
Hi ScraM,
How production-ready is your version of Flavour? Alexey mentioned that Flavour may not officially exist anymore, and I agree with his point about using SVN instead of Git — it is a bit unusual. I actually tried to create a GitHub mirror but wasn't successful.
Additionally, I noticed it's still using Java 8 and an older version of TeaVM. Is there a particular reason it hasn’t been updated to the latest TeaVM?
P.S. I'm genuinely interested in using Flavour for real projects, but I'm cautious about the risk of it breaking during development. Have any specific projects been successfully built with Flavour? What were the biggest challenges encountered?