-
-
Notifications
You must be signed in to change notification settings - Fork 238
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
Promise support in scope.get #65
Comments
If |
submitting a PR here is going to be difficult. in my fork i've converted to es6, changed project structure on disk, and changed the eslint/code style requirements and made many, many backwards incompat changes that brings liquidjs more in line with shopify/liquid, but definitely breaks backwards compat. i'd love to get these changes merged here, but i'm not sure about how best to proceed. none of them are compartmentalized, so i can submit a PR, but it'd probably be an all-or-nothing situation.
in my fork after implementing promises, i think it might be possible to have multiple blocks in a partial rendering state at the same time. like i said, i've never experienced this, but it feels like it is possible. |
FYI - i plan to refactor into async/await once IE Edge ships chromium. that might be a good time to figure out how to merge, if you're interested. |
Since it'll introduce many micro-tasks (maybe slower) to support this feature, I' d rather make it pending until we get benchmark ready. I opened a issue #105 to get it rolling. |
# [7.6.0](v7.5.1...v7.6.0) (2019-03-10) ### Features * promise support for drops, working on [#65](#65) ([4a8088d](4a8088d))
# [8.0.0](v7.5.1...v8.0.0) (2019-03-10) ### Code Refactoring * use camelCase for JavaScript APIs ([64e0c87](64e0c87)) ### Features * promise support for drops, working on [#65](#65) ([4a8088d](4a8088d)) ### BREAKING CHANGES * Options and method names in JavaScript API are now renamed to cammelCase, for a complete list see #109
It's supported on 8.0.0. Refer to this test case |
The ruby implementation of liquid supports async/lazy data access so that data can be loaded on-demand.
This is described here in the rust version of of liquid: cobalt-org/liquid-rust#118 (comment)
scope.get
should work with promises so that I could do {{ some_async_product.price }} and have the product data load via API call that returns a promise.This would be a big, breaking change, but I've implemented it in our fork and it was definitely not easy, but at this point it is working well. (I do worry about race conditions with scope.push/pop, though it hasn't been a problem yet.)
The text was updated successfully, but these errors were encountered: