Skip to content
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

Supporting async-only jstransformers; fixes #166 #167

Merged

Conversation

howarddierking
Copy link
Contributor

The core of this PR is to switch from calling jstransformer's renderFile function to instead calling renderFileAsync. Because of the sync fallback support in jstransformer (https://github.com/jstransformers/jstransformer/blob/69fd94c47500fe4d4c8d9f1ac2918c2a55075db0/index.js#L345), calling the async function should work for both async and sync template engines.

The only additional change in this PR is to move code unrelated to the async operations out of the scope of the promise code.

I looked for a place to add tests to verify, but all of the test fixtures in the repository were more granular than this specific change. All current tests pass, though.

@howarddierking
Copy link
Contributor Author

Addresses #166

@ismay ismay merged commit a17c50a into metalsmith:master Nov 1, 2018
@ismay
Copy link
Contributor

ismay commented Nov 1, 2018

Published in 2.3.0, thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants