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

Replace EmbedIO with GenHTTP #862

Open
wants to merge 6 commits into
base: development
Choose a base branch
from
Open

Conversation

RobertBeekman
Copy link
Member

@RobertBeekman RobertBeekman commented Feb 13, 2025

This PR replaces the EmbedIO library with GenHTTP.
While we didn't have any specific issues with EmbedIO it is no long being developed and pretty much abandoned.

GenHTTP offers similar functionality while being a bit more modular, EmbedIO offered a lot of stuff we weren't using.
We now also got rid of the Swan.Lite library included with EmbedIO which added a lot of annoying extension methods on very broad things like object

This is very much a breaking change for plugins implementing their own controllers. However, any plugins that use the plugin endpoint API are unaffected by this change. I did drop support for DataModelJsonPluginEndPoint, it was already marked as obsolete and while it probably would've worked with GenHTTP I didn't want to waste time on it.

Oh, and it's about 30% faster at some rudimentary benchmarks I ran.

[Route(HttpVerbs.Any, "/status")]
public void GetStatus()
[ResourceMethod(RequestMethod.Post, "bring-to-foreground")]
public void BringToForeground(IRequest request)

Choose a reason for hiding this comment

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

I think your logic could be simplified with a [FromBody] string? route argument.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hey, I did try this, but it seems routes may not be omitted even if declared nullable?

{
    "status": 400,
    "message": "Argument 'route' is expected to be read from the request body but the request does not contain any payload"
}

Choose a reason for hiding this comment

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

Hm, I would consider this a bug. Sorry, will fix this in the next version.

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.

2 participants