`Engine.render()` and `Engine.renderSync()` take generator as its first argument
See original GitHub issueWhen Page
is a generator, Engine.render()
and Engine.renderSync()
take generator as its first argument, and returns generator which yields Data
.
I don’t feel this intuitive. They would better to take an iterated content and data as its argument, and returns string
.
Also, Engine.render()
can return generator, on the other hand, Engine.renderSync()
cannot. I don’t think the typing here is correct.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
React as a Generator engine · Issue #407
When the template declares that it's using React as its template engine, the Generator will render files using React instead of Nunjucks.
Read more >liquidjs | Yarn - Package Manager
A simple, expressive and safe Shopify / Github Pages compatible template engine in pure JavaScript. The purpose of this repo is to provide...
Read more >nDisplay Synchronization with NVIDIA
Synchronization across multiple nDisplay cluster nodes (PCs) is essential to avoid tearing between LED seams and to ensure the camera does not capture...
Read more >Carbone - API reference
Carbone JS API. CarboneJS is an open source document generator, it provides: The NodeJS engine generates any documents from a template and a...
Read more >Integrating Hexo and Jupyter to Build a Data Science Blog
When I first created this blog almost a year ago, I decided to use Hugo as ... as italics before the MathJax engine...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Anyway, now I know the current interface of
Engine.render()
andEngine.renderSync()
is designed as intended. You can close the issue. Thanks for clarifying!I understand the reason why the returning type have to be unknown. Then what needed may be a fine document for creating Engine interface. I had to learn it by reading the standard plugins in this repository, and it seems I had much more to know about it.
As for my JSX engine, Nano JSX already uses
Component#toString
for rendering it, so I wasn’t able to override it for Lume. And you cannot export the result of function components, or even call them by yourself. Nano JSX requiredocument
variable in global scope to render them. This variable is defined by default in browsers as you know, and while rendering on deno, Nano JSX will define it insideNano.renderSSR()
. I don’t want to render the components twice while rendering layouts, but I have no idea better than that.