question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Promise based support for Template.prototype.evaluate

See original GitHub issue

I was hoping to make a mincer plugin for Rollup, however their API is promise based. Could you support this in Template.prototype.evaluate?

Right now, if I specify a Promise based function for evaluate, when Mincer invokes evaluate, it won’t wait for the Promise to resolve.

Also see this Stackoverflow question: http://stackoverflow.com/questions/21424867/run-an-asynchronous-stream-based-function-synchronously-in-node-js

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
puzrincommented, Apr 28, 2017

If you decide to dig nodeca bundler or create your own, pay attention to macros implementation and related things. The most painful problem is that you can have only sync helpers in html templates, but may wish async imlementations of plugins. If helper’s dependencies (asset’s url for example) are not ready, you can’t silently build those after helper invoked.

Solution is to throw error “unfulfiled dependencies”, build missed ones and rerun build of resource that caused error. At least, that worked with my use cases. That’s the main logical collision you should care if you decide to create complicated assets bundler.

0reactions
umaarcommented, Apr 28, 2017

Fair enough, I admire the effort you’ve put into, for example, plugins, it’s interesting to see. Thanks for explaining!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Promise - JavaScript - MDN Web Docs
Creates a new Promise object. The constructor is primarily used to wrap functions that do not already support promises. Static methods. Promise.
Read more >
Prototype Testing: A Step by Step Guide (2022) | Blog
The first step of any prototype testing and evaluation is collecting and analyzing the user data and information. Here, the users or the...
Read more >
Evaluating Prototypes - Tamarack Institute
A process to help innovators make ideas tangible, learn by doing, and quickly test whether they hold promise for further de- velopment. A...
Read more >
Test & Demonstrate | Adaptive Acquisition Framework - DAU
Rapid Prototyping Test and Evaluation (T&E) ... The fundamental purpose of T&E is to enable the DoD to acquire systems that support the...
Read more >
Understanding Template Literals in JavaScript - DigitalOcean
In this context, interpolation refers to the evaluation of a placeholder as a dynamic part of a string. The use of single- or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found