Open kibertoad opened 8 years ago
That's not really a goal of Rocker. Rocker is designed to be efficient, compiler-checked, and lightning fast. A Rocker template is compile to a normal Java class, thus the template must exist on the classpath when its finally used.
You're free to use the rocker-compiler in your project to get it to spit out a .java file, then use Rocker's hot reloading feature to load it as it changes. That would essentially work like you're asking for, but you'd need to wire up the String -> parser -> generator -> hot reload. However, I wouldn't recommend that for production use since reloading classes on-the-fly is not normally something you want to do in production.
If you are looking for extremely dynamic templates, reload on the fly, you probably should use a different template framework. You essentially trade dynamic for performance -- and Rocker is 100% focused on performance.
On Wed, Sep 28, 2016 at 3:38 PM, Igor Savin notifications@github.com wrote:
Currently Rocker only supports working with templates on a classpath; you cannot just pass him a template String, map of variables and say "Render this for me".
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/fizzed/rocker/issues/39, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjwAoBIbRBLDEyOPGh3nD83CeC1q7IXks5qusIugaJpZM4KJOYk .
Thank you for detailed explanation. Maybe it would be useful to include similar explanation in the official documentation to explain what Rocker is and what is not intended to be and used for?
Since rocker-compiler is called "compiler", so does it really compiles templates into bytecode? or it's actually a "transpiler"?
It's hard to 100% classify it as a compiler vs. transpiler. I'd say its currently more of a transpiler than a compiler. It parses templates into a working AST/model, generates .java files for them, but also can invoke the java compiler to get those into bytecode.
On Fri, Oct 14, 2016 at 5:25 AM, Rocks Wang notifications@github.com wrote:
Since rocker-compiler is called "compiler", so does it really compiles templates into bytecode? or it's actually a "transpiler"?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/fizzed/rocker/issues/39#issuecomment-253751720, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjwAtp7cO-z4riYHGofxaSZHvclap3Cks5qz0p9gaJpZM4KJOYk .
Currently Rocker only supports working with templates on a classpath; you cannot just pass him a template String, map of variables and say "Render this for me".