-
Notifications
You must be signed in to change notification settings - Fork 6
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
support async rendering #35
Comments
Looks good. Would you be up for creating a pull request for this? |
Seems quite messy to do as the API for, `compile -> renderAsync` doesn't
exist
…On Fri, 24 May 2019, 14:51 Forbes Lindesay, ***@***.***> wrote:
Looks good. Would you be up for creating a pull request for this?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#35?email_source=notifications&email_token=AADFATG5MIBKTQ3UI76RVGLPW7XFXA5CNFSM4HPOOKL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWFNKMQ#issuecomment-495637810>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADFATEB3DEW3INOVPVZ7VLPW7XFXANCNFSM4HPOOKLQ>
.
|
You could implement the |
That's not allowed as a result of compile |
No, I mean you can have a single function |
Hmm, this removes any benefit that users might get from precompiling their
templates though
…On Sat, 25 May 2019, 01:36 Forbes Lindesay, ***@***.***> wrote:
No, I mean you can have a single function renderAsync that does both
compile and render in one go. e.g.
https://github.com/jstransformers/jstransformer-rollup only implements
renderFileAsync.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#35?email_source=notifications&email_token=AADFATDFEQZLAXLETU5AGHLPXCCZ7A5CNFSM4HPOOKL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWGZ22I#issuecomment-495820137>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADFATF7GJYKAY7MUAHCMDTPXCCZ7ANCNFSM4HPOOKLQ>
.
|
I think I have a solution for this, but it snowballed into having to make another PR for test-jstranformer. jstransformers/test-jstransformer#50 I implemented compileAsync. This is enough (I think) to offer the asynchronous support that nunjucks offers. At least it works in my project. But it doesn't pass the tests. This is (again, I think) because the test is wrong. The test assumes that template.fn(locals) returns a string. Hence the test If that PR gets accepted, we can update to the latest test-jstransformer release in this repo, and then this PR #42 should pass testing. |
https://mozilla.github.io/nunjucks/api.html#asynchronous-support
The text was updated successfully, but these errors were encountered: