Closed sebastiandedeyne closed 6 years ago
This would be so useful 👍
I desperately need it for CSS-in-JS support, where I now solve it by just letting Node.js render the complete HTML page (webstronauts/laravel-liftoff/resources/assets/js/entry-server.js).
I've created #19 to support this.
The magic
dispatch
function should accept a second argument to send up context.Implementation idea:
dispatch
returns a JSON-serialized object, with the html in one key, and context in another.This is a breaking change, and would change the return of
Engine::run()
from a string to an array or custom object.See spatie/laravel-server-side-rendering#18 for a real-world use case.