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.

`Engine.render()` and `Engine.renderSync()` take generator as its first argument

See original GitHub issue

When 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:closed
  • Created 2 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
aiottercommented, Feb 13, 2022

Anyway, now I know the current interface of Engine.render() and Engine.renderSync() is designed as intended. You can close the issue. Thanks for clarifying!

0reactions
aiottercommented, Feb 13, 2022

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 require document 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 inside Nano.renderSSR(). I don’t want to render the components twice while rendering layouts, but I have no idea better than that.

Read more comments on GitHub >

github_iconTop 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 >

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