Closed CrowdHailer closed 5 years ago
Thanks to @lasseebert and his work to remove EExHTML
as a dependency (#171) we can drop a 1.0
for EExHTML as a requirement for Raxx 1.0
Nearly ready for a 1.0 release :tada:
Try the release candidate from hex using, {:raxx, "~> 1.0.0-rc.3", override: true}
My opinions on all that remains is.
raw_path
as it is now.I took a quick look through the project and recent changes and There don't seem to be any real blockers for 1.0.
Random notes:
raw_path
as it is now.One thing that I think might be worth addressing before 1.0: Configuring extra statuses using config/Application.get_env
- I don't think there's much value to it, it's the only instance where Raxx depends on the config and I can imagine situations where it leads to some stupid problems. I think I'd be in favour of removing the extra_statuses
altogether before 1.0 to not carry it on as baggage.
Thanks for the comments.
I don't think we can remove extra_statuses
without implementing the replacement. We use it and it hasn't caused any problems for us. but that's all I have. I don't think it's the best solution I'm just also not sure it's worth stopping 1.0 for it??
What I meant with extra statuses is that we could allow for arbitrary {status_code_integer(), status_name_string}
tuple in the %Raxx.Response{}
status field (and any functions that take the status as an atom or integer).
This way the user could still send arbitrary statuses, but without the need for a global config. It wouldn't be difficult to use either, in your user code you could just define def unprocessable_entity(), do: {422, "Unprocessable Entity"}
and use it wherever needed.
I think this would be a clean solution, requiring minimal code changes and making Raxx independent of Mix.Config. Plus I think that the assumption that everything in the user app would like to share the extra statuses might not always be correct.
I like the proposal.
But does it need to be a thing before 1.0?
Raxx.request()
currently takes atom | integer
after it would take atom | integer | {integer, binary
That could be added at 1.1?
My reply from 2 days ago didn't send :/
There's a couple of reasons why I'd like to get that in before 1.0:
Alright I'm sold.
I do think that when this gets implemented it should go as a 0.19.x
release. And exists for a bit in the wild. I will at least get feedback from using it in my own projects
It is worth noting that HTTP/2 does have reason phrases and HTTP/1.1 can have responses with no reason phrase and you can already pass any integer to Raxx.response
So any status code is already supported by just passing an integer when making the response. I wonder what plug/phoenix/cowboy does
Going on the points above I have added this test. https://github.com/CrowdHailer/raxx/pull/172/commits/f01963748f52796b063c441a3de9f3b97d9b6a5c
In my opinion that shows that we can handle any status code. if you want words then define a function that returns an integer and use as follows
def my_status(), do: 299
Raxx.response(my_status()
I don't think there is any need to support custom status wording.
Here's the commit on the next branch https://github.com/CrowdHailer/raxx/pull/172/commits/dd2ee03e54e785d5dac31bce98e7a0b7e45bd8a6
This is the follow up to #118, it was decided at least one more breaking release should be done before 1.0
Checklist
Raxx.response({422, "Unprocessable Entity"})
Add a new field to response struct, that is optional. Ace will have to send "Unknown" if it is not set. or nothing in HTTP/2 land which is fineOptional Checklist
raw_path
field on a request Have only path and that should contain the raw binary. Then introduceRaxx.segments(request)
to return the split path~~