-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Request: A web server command that serves code and documentation #4244
Comments
So basically something like https://github.com/denoland/deno_website2 but written in Deno? I agree this would great to have. I don't know about all of these features (GraphQL sounds like a bit much) but certainly we should have a program in std that can serve up a directory of code that deno can link to. I'd file this one under long term goals. |
I wouldn't imagine Deno should have a built-in production-ready server (e.g. with HTTP2 push). But it should absolutely have something like That said, I'd love the Deno module server (which currently runs https://deno.land/x) to be written in Deno and have more awesome features. EDIT: random note, where did the idea of transpiling Wasm to asm.js come from? 🤔 |
I listed all these features because I think Deno was to be a swiss army knife for JavaScript developers (since it has so many features already). Another reason is that it is better that Deno sets up a standard (with clear specs) about how Deno libraries should be served for everything else.
It may be a bit more complex than simple REST API, but I think it fits a module registry. For example: I sometimes want to list all contributors from all direct/indirect dependencies, doing so with npm registry would require me to send request back and forth, wasting precious time and bandwidth, a query language like GraphQL would allow me to do so in one request. Of course, we cannot implement all these features immediately in day 1, so a clear roadmap and specs is necessary. |
It came from my desire to rewrite the Internet in Rust /jk But actually, I think it would be nice if library server can provide compatible fallbacks for older browsers, that of course must include WASM too. |
Still sounds a bit over ambitious to me even for |
Outside of scope for Deno CLI. I agree with @kitsonk that it seems better suited to be a community project. |
Rationale
At first glance, serving deno libraries appear simple: Just put the whole thing on GitHub or GitHub Pages. But when other factors come around (such as semantic versioning, fallback for browser compatibility, caching, CDN, etc.), things appear to be much more complicated.
Suggestion
I wish deno provides a cli command (such as
deno serve
) and an API (such asDeno.serveCode()
) that does all those things in a standard and painless fashion.The server should have the following features:
Use HTTP/2 push to send all dependencies when a JavaScript module is requested.Add all JavaScript modules to preload header. HTTP/2 push is sloppy when it comes to caching.immutable
for specific version.The text was updated successfully, but these errors were encountered: