Mux.jl
Mux.jl copied to clipboard
Road to v1
This is an issue to collect ideas on what needs to be done to get this package to v1.
Here are some of my ideas:
- [ ] add docstrings and a small manual #28
- [ ] document what is in the stable API and what is not (is stuff in
src/examplescovered by stability guarantee?)- At the moment, we expect both Mux and users to make changes to the request and response dicts and don't provide any guidance about what keys are reserved for Mux and which the user can freely use.
- [x] support HTTPS #25
- [ ] more test coverage
- [ ] we don't test examples/files.jl (the only security-relevant code ;)
- [ ] or that
@appallows hot reloading
- [ ] make
wait(serve(app))respond to SIGINT better- I can't kill a server started with
julia myserver.jlwith ctrl-c - Providing serve_sync is probably best.
- I can't kill a server started with
- [ ] make sure
dosyntax works in the places we would expect it to- e.g. both
page(app, path)andpage(path, app)are defined, so we can use it there, though it's a little bit weird that we have both
- e.g. both
- [ ] provide the original
HTTP.Requestin thereqdict? - [ ] allow apps to return an
HTTP.Responsesomehow?- Why? #152
- [ ] nicer stacktraces #87
- in the common case that
@appgets a tuple, we could make the macro save the identity and names of each somewhere and the error catcher could re-write the stacktrace with that info?
- in the common case that
- [ ] maybe some more routing options/branches? (#38, #41, #54)
- It's pretty easy to do yourself, but there are a few issues looking for helper functions something like these:
- e.g.
branch(req -> predicate(req[:uri]), app) - e.g.
branch(req -> predicate(req[:cookies]), app) - e.g.
branch(req -> predicate(req[:headers]), app) - e.g.
branch(req -> req[:uri].scheme == scheme, app)
- e.g.
- Maybe we can just document this better.
- It's pretty easy to do yourself, but there are a few issues looking for helper functions something like these:
- [ ] check performance? (#92)
- mux should be viable for small, low-latency queries too, if possible
- [ ] multiprocessing or multithreading support
- it would be sad if you find you need better performance and it turns out Mux has some show-stoppers that mean you have to re-write in another framework.
- [ ] Decide if relative paths should be relative to the script file, or the working directory, or disallowed #26
- current behaviour is that relative paths are accepted but only allow access to the root directory listing and not any of its content, which is not useful.
- we can do it with
root = isabspath(root) ? root : normpath(@__DIR__, root) - Here be security dragons if
rootis provided by the user, but there's no particular reason to let it be (check AssetRegistry integration).
- [ ] return an
IObody fromfresp? HTTP.Response now supports this, we'd just need to returnDict(:body => open(f)) - [x] decide if
files()should URL decode the given path by default #105 - [ ] Drop
pkgfilesandassetserverout ofMux.defaults?
Please add your ideas, too!
Related: #41 (GSoC 2017 ideas)
v1 was released without discussion, so any breaking changes can now be in Mux 2.0, I guess.