-
-
Notifications
You must be signed in to change notification settings - Fork 531
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
Add ComponentResourceHandler to server #3284
Conversation
ac91fdc
to
e810c97
Compare
Codecov Report
@@ Coverage Diff @@
## master #3284 +/- ##
==========================================
+ Coverage 83.29% 83.30% +0.01%
==========================================
Files 195 195
Lines 26166 26325 +159
==========================================
+ Hits 21795 21931 +136
- Misses 4371 4394 +23
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to show in the console logs what files are served?
Don't think so, the StaticFileHandler doesn't do so and failed requests are logged. |
This PR implements a so called
ComponentResourceHandler
that is always added to the server. TheComponentResourceHandler
resolves paths relative to some module, i.e. it resolves patterns like<endpoint>/<module>/<class>/<attribute>/<path_to_resource>
. Internally the resource handler then resolves the path to the module that was referenced, the class that was referenced and finally the attribute on that class. If and only if the requested resource is listed in that attribute will it resolve thepath_to_resource
and serve it. This means thatReactiveHTML
andTemplate
resources that reference local files can now be resolved correctly without having to be bundled into the Panel bundle itself.Fixes #3241
Fixes #1787
Partially addresses #2903