-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UMD dist file? #2
Comments
That would possible, although obviously not recommended in production due to the additional computation required to internalize the input. Agree it would be nice to be able to run everything in a browser, though, esp. for testing and tinkering. My argument against this was that precompiling templates as per the supplied examples is fairly trivial to do / modify, but if there's enough interest (not enough atm to justify the effort) I can provide a browser version at some point |
I'd be interested in this. |
+100 please! )
It's a known issue with UglifyJS browserify/browserify#1832. May I ask how do you use the lib in runtime? |
Unfortunately atm I am a bit swamped with things to look into this. The versions I use are slightly different from the one in this repo for some reason, so it's a bit tricky to "port" the browser version here. However, as you can see the dependencies are not that special - and there in principle no reason why a browserified version of this could not work with minor tweaks. iIRC html-minifier was a bit of a PITA for some reason so you may want to disable that temporarily to get things going. |
thanks. As I removed usage of |
just removing "auto registration emmiters" in
|
That makes sense, since you're not using fs any longer. Let me know how it works - and bear in mind that full in-browser transpile+compile may get prohibitively slow for production (but still pretty fun, tho :))
… On 21 May 2018, at 20:48, Sergei Dorogin ***@***.***> wrote:
just removing "auto registration emmiters" in transpiler\index.js makes the lib to be just Handlebars - it behaves as w/o backend specified. So I had to add explicit import of idom backend:
var emitter = require('./backends/idom');
TemplateTranspiler.registerBackend('idom', emitter);
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Thanks for your interest. And thanks for the lib by the way. It looks like very interesting piece of software. Previously with Handlebars I loaded all template via my requireJS-plugin that compiles templates on the fly. At the same time for production they were compiled in build-time and plugins detected that and did nothing. So all other code isn't dependent on the fact whether templates are compiled or not. I want to keep this approach. Unfortunately I have lots of block helpers which returns html strings and all they won't work any more. So I'm far away from something working. But it seems that the lib itself works - I can see compiled js code with IncrementalDOM calls. If you wonder what kind of helpers I have here's some details.
that means the view should take a object from property |
Hi. Given a HB template containg only html (no helpers at all)
then that
I never got a result from
it fails on first
in
|
Are you sure you are correctly invoking the template function? It should be something like
|
Thanks, definitely I'm not.
is becoming:
but let me ask what's about the second argument for HB-template function - |
have a look at the examples perhaps that can help clarifying things a bit |
thanks it's helpful, I should look there at start. fn: TemplateDelegate;
inverse: TemplateDelegate;
hash: any;
data?: any;
that
So I would suggest to pack context and options into
that would mean -
ibars would call:
and then:
|
Incremental DOM wants a function and a context. But that does not mean you cannot pass options to the template, you just need to do it in a slightly different way - like curry them etc. Example
|
Yeah, I've just discovered that as well, but unfortunately it's not enough as template function returned by
In the |
I use it all the time i guarantee it works - you may just need to try out a few patterns that suit your needs |
Did you use
That
I also have a question about migrating code like |
I read the last part of the readme but it would be nice if this can be used by browsers via UMD.
The text was updated successfully, but these errors were encountered: