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

[ui5-tooling-modules-middleware] Exclude requests with regex #1082

Closed
menof36go opened this issue Sep 20, 2024 · 2 comments · Fixed by #1085
Closed

[ui5-tooling-modules-middleware] Exclude requests with regex #1082

menof36go opened this issue Sep 20, 2024 · 2 comments · Fixed by #1085

Comments

@menof36go
Copy link
Contributor

Is your feature request related to a problem? Please describe.
The middleware is really slow, because getResource and resolveModule are called for every request to /resources/.
In my case profiling and network monitor show that even simple requests to /resources/sap/... take more than 20x as long as without the middleware (~450ms per file compared to ~15ms per file without).

Describe the solution you'd like
Regex to skip middleware execution early, preferably right after the initial match for /resources/.
Similar to how shouldSkipTransform is implemented currently, I would love to just provide a bunch of glob patterns that are excluded, something akin to:

  excludes:
      - "sap/**"
      - "my/namespace/**"

I have tried this manually and had the desired result with immense speedup.

Describe alternatives you've considered

Additional context
I dont know if this has any side effects or if there is maybe some other option that can be configured already

@petermuessig
Copy link
Member

Good idea! I try to also continuously improve the performance of the middleware since it is critical for development - but this seems to be an easy and pragmatic idea to exclude resources you know about. Maybe we can also define a kind of a default...

@petermuessig
Copy link
Member

@menof36go I found a better solution, fix is coming with the PR #1085

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