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

Prerender with other languages #42

Open
dgp1130 opened this issue Sep 27, 2021 · 0 comments
Open

Prerender with other languages #42

dgp1130 opened this issue Sep 27, 2021 · 0 comments
Labels
feature New feature or request

Comments

@dgp1130
Copy link
Owner

dgp1130 commented Sep 27, 2021

So far, rules_prerender makes heavy use of NodeJS to run JavaScript at build-time, however this is not a strict requirement. While most of the tooling takes advantage of NodeJS, there's no reason that needs to extend to user code. It makes just as much sense to allow users to write Rust, Java, Python, C#, or whatever other language they want to use (Haskell anyone?).

The only caveat here is that the renderer does require NodeJS, since it provides a cleaner interface to emit files at the right path with PrerenderResource. However, we could make an alternative renderer for any given language and provide a comparable API. As long as users specify in prerender_component() and/or prerender_pages() what language/framework they are using for prerendering and stay consistent within generating a single page, they can mostly use whatever they want.

We could also consider a slightly less opinionated version of prerender_pages() which allows the user to generate their own binary target but still get all the benefits of bundling. I'm not sure how much value all this gives, but I'm sure eventually someone will want to do this in Rust. It should be possible and we can track interest in this issue.

@dgp1130 dgp1130 added the feature New feature or request label Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant