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

Fix #231 and add Revise tests #232

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

frankier
Copy link
Contributor

@frankier frankier commented Nov 5, 2024

Fixes #231

This fixes the problem which is that a error when Revise is used together with a middleware vector which isn't Any[] (note that a single element array will always be typed).

I've also added some tests which ended up being a bit simpler than I thought.

@frankier frankier changed the title Revise fix and tests Fix #231 and add Revise tests Nov 5, 2024
@@ -132,6 +132,7 @@ function serve(ctx::Context;
if ctx.mod === nothing
@warn "You are trying to use the `revise` option without @oxidise. Code in the `Main` module, which likely includes your routes, will not be tracked and revised."
end
middleware = convert(Vector{Any}, middleware)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather than performing a type conversion on the entire array, could we try setting the middleware keyword type to Vector{Function}. This should be generic enough to handle any weird edge cases

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

Successfully merging this pull request may close these issues.

Incompatibility between revise and middleware arguments in serve?
2 participants