Skip to content

Commit f587137

Browse files
authored
Merge pull request #437 from rstudio/url_deps
2 parents 5ad2a60 + 93b3428 commit f587137

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010

1111
### New features
1212

13+
* Added support for URL based HTMLDependencies. `{htmltools}` (v0.1.5.9001) added support for URL based HTMLDependencies in rstudio/py-htmltools#53. (#437)
1314

1415
### Bug fixes
1516

shiny/_app.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -338,14 +338,15 @@ def _register_web_dependency(self, dep: HTMLDependency) -> None:
338338
# (Some HTMLDependencies only carry head content, and have no source on disk.)
339339
if dep.source:
340340
paths = dep.source_path_map(lib_prefix=self.lib_prefix)
341-
self._dependency_handler.routes.insert(
342-
0,
343-
starlette.routing.Mount(
344-
"/" + paths["href"],
345-
StaticFiles(directory=paths["source"]),
346-
name=dep.name + "-" + str(dep.version),
347-
),
348-
)
341+
if paths["source"] != "":
342+
self._dependency_handler.routes.insert(
343+
0,
344+
starlette.routing.Mount(
345+
"/" + paths["href"],
346+
StaticFiles(directory=paths["source"]),
347+
name=dep.name + "-" + str(dep.version),
348+
),
349+
)
349350

350351
self._registered_dependencies[dep.name] = dep
351352

0 commit comments

Comments
 (0)