Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

twing-loader is not compatible with Twing@4 #21

Closed
ericmorand opened this issue Jan 13, 2020 · 2 comments
Closed

twing-loader is not compatible with Twing@4 #21

ericmorand opened this issue Jan 13, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@ericmorand
Copy link
Member

Related to NightlyCommit/twing#473

twing-loader is currently not supporting Twing@4 because of async support. Since async support is there to stay, it's time to upgrade twing-loader to a new major version that supports Twing@4.

@ericmorand ericmorand added the enhancement New feature or request label Jan 13, 2020
@ericmorand ericmorand added this to the 4.0.0 milestone Jan 13, 2020
@hason
Copy link

hason commented Mar 10, 2020

@ericmorand Is there a plan to solve this task?

ericmorand pushed a commit to ericmorand/twing-loader that referenced this issue Apr 8, 2021
@ericmorand ericmorand self-assigned this Apr 8, 2021
ericmorand pushed a commit to ericmorand/twing-loader that referenced this issue Apr 8, 2021
ericmorand pushed a commit to ericmorand/twing-loader that referenced this issue Apr 8, 2021
ericmorand added a commit that referenced this issue Apr 8, 2021
@ericmorand
Copy link
Member Author

I fixed the issue in v4.

The major change here is that, Twing rendering being asynchronous, requiring a Twig template using twing-loader returns a Promise:

const template = require('foo.twig');

template({
    foo: 'bar'
}).then((output) => {
    // do something with the output
});

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants