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

Static assets for deployment in GitHub Pages #1

Open
storopoli opened this issue Feb 25, 2024 · 4 comments
Open

Static assets for deployment in GitHub Pages #1

storopoli opened this issue Feb 25, 2024 · 4 comments

Comments

@storopoli
Copy link

storopoli commented Feb 25, 2024

Right now (as far as I understood) we can only have the website available by running with cargo run --release.

I would love to have an index.html with an assets folder that I can deliver to the static GitHub Pages.

@edezhic
Copy link
Owner

edezhic commented Feb 26, 2024

I've been thinking about supporting static scenario and I'm interested in it, but I haven't found a good way to implement it yet. Easiest solution could have been to make requests to the server on the registered routes and collect responses into files, but axum, library that prest uses for routing, doesn't expose these routes anywhere afaik.

@jonititan
Copy link

jonititan commented May 2, 2024

Those examples that use pwa would seem to be suitable for this type of deployment? Since if they are running in a service worker in wasm they can be started and loaded from index.html would be the first thing served by github pages? Basically the same way Jupyterlite is loaded.

From reading the internals I thought that was one of the end aims of the project? Not just pwa but also permitting advanced rust internals and interactivity in an otherwise statically served site.

Edited to add:
That's what the example that inspired you does as well. Rust wasm service worker

@edezhic
Copy link
Owner

edezhic commented May 2, 2024

@jonititan That's a fair point that I haven't thought about much. While enabling rust power on the client side is one of the goals, static deployments aren't that important to me, at least right now.

One of the reasons is that wasm isn't well supported in browsers and service workers are still buggy even in pure js, so going all-in in this direction is premature. I hope that it will change in the near future but realistically it will likely take at least a year to get stable SWs, browser api access directly from wasm and other features required for nice DX with rust on the client side.

Another reason is that I'm focused more on the server side for now. I'm hoping to achieve the deployment simplicity of a managed wordpress service but with prest on any linux vps. 5$/month doesn't seem like a big deal if you won't have to worry about devops things and could serve thousands of users across any number of apps.

Overall I think getting to almost-zero-setup server+DB just makes more sense right now. While I believe rust has a lot of potential on the client side, and I think of prest as one of the projects that shows it, unfortunately this ecosystem isn't ripe yet to compete with JS's DX, so I'd rather focus on features that can already be more convenient than existing tooling

@jonititan
Copy link

That's completely understandable. Thanks for explaining your reasoning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants