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

Closed
sebastienros opened this issue Mar 29, 2024 · 9 comments · Fixed by #17373
Closed

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

sebastienros opened this issue Mar 29, 2024 · 9 comments · Fixed by #17373

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.

DonaldDWebster pushed a commit to DonaldDWebster/OrchardCore that referenced this issue Oct 13, 2024
DonaldDWebster added a commit to DonaldDWebster/OrchardCore that referenced this issue Oct 13, 2024
DonaldDWebster added a commit to DonaldDWebster/OrchardCore that referenced this issue Oct 18, 2024
DonaldDWebster added a commit to DonaldDWebster/OrchardCore that referenced this issue Oct 18, 2024
@jbytes1027
Copy link
Contributor

@DonaldDWebster are you still planning on working on this? I'm happy to finish this for you.

@DonaldDWebster
Copy link

@DonaldDWebster are you still planning on working on this? I'm happy to finish this for you.

Please feel free to pick it up

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