Comments (10)
This feature planned for next version.
from ect.
Awesome. A batch compiler for ect templates and the output can be directly served to browser. It would be great if this can be integrated with Angular.js. Also cool thing would be to integrate with CodeKit so that it can auto compile the ect templates. I'd love to see this feature soon.
from ect.
Hey guys!
First of all, I would like to thank everyone, this is project is really impressive and helpful.
I've adapted the code so I can precompile the templates. If anyone is interest, please check my fork: https://github.com/eliseumds/ect
from ect.
Previously we used eco with spine.js and hem. I would love to replace eco with ect in the spine.js docs, example apps and and hem and all that but precomplilation would be a requirement. I will keep an eye out for this feature landing. looks like you guys are doing good work. Keep going!
from ect.
First version of command-line compiler released just now (with v0.5.0). It have a basic functionality for now, but will be improved in future.
from ect.
Hey All, What's the status of precompiling templates on the client side? I love ECT, but this is the only thing preventing me from integrating it. Currently the pre-complier outputs an anonymous function... how would one integrate the compiled output to be renderable by an ECT object instance?
I dug into the source a little bit... I was thinking maybe adding a method like:
renderer.register({ name:'foo', compiled:(function(){}) });
... this would add a record to the cache object internally
Then I would be able to:
renderer.render('foo',{});
I'll submit a patch if I end up writing it, but wanted to get your thoughts.
from ect.
If you need to serve all precompilied templates to client in one script/html (without ajax lazy load) you can use this syntax:
var renderer = new ECT({
root : {
foo: 'ectPrecompilledFuncitonHere',
bar: 'ectPrecompilledFuncitonHere'
}
});
After that you can use template foo
and bar
in your code.
from ect.
Solid, thanks... is that the string source or is it the function reference?
from ect.
This is a string as it outputted by ect command line tool.
from ect.
Unfortunately, I find this woefully inadequate. In my opinion ECT beats ECO all around, except for the fact that you're coupled to a server side implementation, and lazy loading the templates async.
My project has hundreds of templates - I doggedly control when those templates are loaded on the client. When a user visits a new page, I send down all the JS including the template code as one file. That way, the minimal code is loaded when the page first loads, but complete "page modules" are loaded lazily when they're needed.
It wouldn't make send to send the templates 1 file at a time on demand.
So that means that there needs to be a way to precompile them into a global namespace. Many templates already do this, ECO, EJS, Handlebars, Jade, etc. ECT not providing this is a real deal breaker.
from ect.
Related Issues (20)
- Bigpipe
- Is this active? HOT 3
- webstorm support HOT 1
- Missing TypeScript support
- variable in template
- Referencing issues within JS script
- http://ectjs.com/ offline HOT 2
- Not maintained anymore? HOT 1
- ExpressJS sample code
- Pay for documentation website hosting!
- Callbacks inside templates HOT 4
- multiple root folder HOT 2
- no tag or releases on GitHub?
- Template in HEAD pushes content to body
- ectjs with jxcore HOT 1
- Problem on bower install
- Comiler function forgetting compiled version of template HOT 6
- How do I get length of Object? HOT 1
- Additional data to parent using extend
- root folder is ignored HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ect.