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

The ScriptsMiddleware(s) should be replaced by endpoints #15629

Open
sebastienros opened this issue Mar 29, 2024 · 7 comments
Open

The ScriptsMiddleware(s) should be replaced by endpoints #15629

sebastienros opened this issue Mar 29, 2024 · 7 comments

Comments

@sebastienros
Copy link
Member

No need to create a middleware that is impacting the stack size to serve script files. We can register the endpoint routes directly and invoke a delegate.

These methods should also not do string concatenation to render the files. They could precompute the utf8 string (private static ReadOnlySpan<byte> => "value"u8;) and call WriteAsync() for each segment instead.

@Piedone
Copy link
Member

Piedone commented May 21, 2024

The endpoints in the Content module can serve as examples.

@DonaldDWebster
Copy link

Is this issue still open? I was thinking about picking it up as a first issue if so, I wanted to check first since I do not see any references to OrchardCore.Liquid.ScriptsMiddleWare

Forgive my ignorance and thank you for the help.

@hishamco
Copy link
Member

You can go for it

@Piedone
Copy link
Member

Piedone commented Sep 21, 2024

Yep, thank you! Be sure to check out https://docs.orchardcore.net/en/latest/guides/contributing/contributing-code/ first.

@DonaldDWebster
Copy link

My progress has been slow, I don't think I can complete it in a reasonable amount of time 😅. My sincere apologies.

@Piedone
Copy link
Member

Piedone commented Sep 21, 2024

Perhaps try to follow the pattern of #15294. This should be more or less copy-pasting to endpoints from the middlewares.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants