-
-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Offer a renderSync method? #48
Comments
Maybe not possible in current code base. We know async methods cannot be converted to sync. So we made intensive discussion over whether to support async in #3 . Nevertheless, supporting sync render methods without regression would be great. Welcome to propose a solution for this issue. |
Render could be implemented syncly, while the only reason to be async is Async Tags. Especially |
Interesting! To be frank I think I’d be happy with throwing an error if the template has an async tag and rendering is in sync mode. |
I worked around this in my upstream code so it isn’t necessary for me any more! It may be useful for someone else in the future but I would consider it low priority. In fact, other libs might tend towards what you’ve done instead 😎 Thanks for the discussion! |
Now we use TypeScript and I'll try make it support both async and sync calls, maybe generate additional code during rollup build. |
# [9.0.0](v8.5.3...v9.0.0) (2019-08-26) ### Bug Fixes * break/continue omitting output before them, [#123](#123) ([ae45c46](ae45c46)) * reactjs demo during yarn install, fixes [#145](#145) ([b65df44](b65df44)) ### Code Refactoring * return value of Tag#render is no longer used ([8028f82](8028f82)) ### Features * renderSync, parseAndRenderSync and renderFileSync, see [#48](#48) ([7fb01ad](7fb01ad)) ### Performance Improvements * target to es6, fixes [#137](#137) ([3b9fc7e](3b9fc7e)) ### BREAKING CHANGES * Tag#render now returns void, use emitter argument to write rendered html. * ship to Node.js 8, the dist/liquid.cjs.js (main) nolonger supports Node.js 6, other bundles are also provided via dist/liquid.esm.js, dist/liquid.js (ES5 umd) and liquid.min.js (minified ES5 umd) * remove default export, now should be used like import {Liquid} from 'liquidjs'
|
Ok I did a simple test of @harttle how to |
By default, it's implemented as sync xhr which is absolutely bad practice. see: Line 47 in f661cd8
A customed, platform-related |
Most templating engines offer synchronous render methods (ejs, mustache, handlebars, haml, pug, nunjucks, etc).
Does one exist for liquidjs? If not, could one be added?
(love this library btw—thank you)
The text was updated successfully, but these errors were encountered: