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

Replace UNPKG w/ jsDelivr #3221

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
- [#3080](https://github.com/plotly/dash/pull/3080) Fix docstring generation for components using single-line or nonstandard-indent leading comments
- [#3103](https://github.com/plotly/dash/pull/3103) Fix Graph component becomes unresponsive if an invalid figure is passed
- [#3190](https://github.com/plotly/dash/pull/3190) Fix issue with cache key generation by adding option to include triggered inputs. Fixes [#3189](https://github.com/plotly/dash/issues/3189)
- [#3221](https://github.com/plotly/dash/issues/3221) Replace UNPKG with jsDelivr since UNPKG has not been actively maintained and has been down since `Mar 15, 2025`

## [2.18.2] - 2024-11-04

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
{
"relative_package_path": "dcc/async-{}.js".format(async_resource),
"external_url": (
"https://unpkg.com/dash-core-components@{}"
"https://cdn.jsdelivr.net/npm/dash-core-components@{}"
"/dash_core_components/async-{}.js"
).format(__version__, async_resource),
"namespace": "dash",
Expand All @@ -76,7 +76,7 @@
{
"relative_package_path": "dcc/async-{}.js.map".format(async_resource),
"external_url": (
"https://unpkg.com/dash-core-components@{}"
"https://cdn.jsdelivr.net/npm/dash-core-components@{}"
"/dash_core_components/async-{}.js.map"
).format(__version__, async_resource),
"namespace": "dash",
Expand All @@ -91,15 +91,15 @@
{
"relative_package_path": "dcc/{}.js".format(_this_module),
"external_url": (
"https://unpkg.com/dash-core-components@{}"
"https://cdn.jsdelivr.net/npm/dash-core-components@{}"
"/dash_core_components/dash_core_components.js"
).format(__version__),
"namespace": "dash",
},
{
"relative_package_path": "dcc/{}.js.map".format(_this_module),
"external_url": (
"https://unpkg.com/dash-core-components@{}"
"https://cdn.jsdelivr.net/npm/dash-core-components@{}"
"/dash_core_components/dash_core_components.js.map"
).format(__version__),
"namespace": "dash",
Expand All @@ -108,15 +108,15 @@
{
"relative_package_path": "dcc/{}-shared.js".format(_this_module),
"external_url": (
"https://unpkg.com/dash-core-components@{}"
"https://cdn.jsdelivr.net/npm/dash-core-components@{}"
"/dash_core_components/dash_core_components-shared.js"
).format(__version__),
"namespace": "dash",
},
{
"relative_package_path": "dcc/{}-shared.js.map".format(_this_module),
"external_url": (
"https://unpkg.com/dash-core-components@{}"
"https://cdn.jsdelivr.net/npm/dash-core-components@{}"
"/dash_core_components/dash_core_components-shared.js.map"
).format(__version__),
"namespace": "dash",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ def test_grva007_external_plotlyjs_prevents_lazy(is_eager, dash_dcc):
app = Dash(
__name__,
eager_loading=is_eager,
external_scripts=[f"https://unpkg.com/plotly.js-dist-min@{v}/plotly.min.js"],
external_scripts=[f"https://cdn.jsdelivr.net/npm/plotly.js-dist-min@{v}/plotly.min.js"],
)

app.layout = html.Div(id="div", children=[html.Button(id="btn")])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
{
"relative_package_path": "html/{}.min.js".format(_this_module),
"external_url": (
"https://unpkg.com/dash-html-components@{}"
"https://cdn.jsdelivr.net/npm/dash-html-components@{}"
"/dash_html_components/dash_html_components.min.js"
).format(__version__),
"namespace": "dash",
},
{
"relative_package_path": "html/{}.min.js.map".format(_this_module),
"external_url": (
"https://unpkg.com/dash-html-components@{}"
"https://cdn.jsdelivr.net/npm/dash-html-components@{}"
"/dash_html_components/dash_html_components.min.js.map"
).format(__version__),
"namespace": "dash",
Expand Down
8 changes: 4 additions & 4 deletions components/dash-table/dash_table_base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
{
"relative_package_path": "dash_table/async-{}.js".format(async_resource),
"external_url": (
"https://unpkg.com/dash-table@{}" "/dash_table/async-{}.js"
"https://cdn.jsdelivr.net/npm/dash-table@{}" "/dash_table/async-{}.js"
).format(__version__, async_resource),
"namespace": "dash",
"async": True,
Expand All @@ -58,7 +58,7 @@
async_resource
),
"external_url": (
"https://unpkg.com/dash-table@{}" "/dash_table/async-{}.js.map"
"https://cdn.jsdelivr.net/npm/dash-table@{}" "/dash_table/async-{}.js.map"
).format(__version__, async_resource),
"namespace": "dash",
"dynamic": True,
Expand All @@ -72,14 +72,14 @@
{
"relative_package_path": "dash_table/bundle.js",
"external_url": (
"https://unpkg.com/dash-table@{}/dash_table/bundle.js"
"https://cdn.jsdelivr.net/npm/dash-table@{}/dash_table/bundle.js"
).format(__version__),
"namespace": "dash",
},
{
"relative_package_path": "dash_table/bundle.js.map",
"external_url": (
"https://unpkg.com/dash-table@{}/dash_table/bundle.js.map"
"https://cdn.jsdelivr.net/npm/dash-table@{}/dash_table/bundle.js.map"
).format(__version__),
"namespace": "dash",
"dynamic": True,
Expand Down
4 changes: 2 additions & 2 deletions components/dash-table/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</head>
<body>
<div id='root'></div>
<script src='https://unpkg.com/[email protected]/umd/react.development.js'></script>
<script src='https://unpkg.com/[email protected]/umd/react-dom.development.js'></script>
<script src='https://cdn.jsdelivr.net/npm/[email protected]/umd/react.development.js'></script>
<script src='https://cdn.jsdelivr.net/npm/[email protected]/umd/react-dom.development.js'></script>

<script src="./demo.js"></script>
</body>
Expand Down
18 changes: 9 additions & 9 deletions dash/_dash_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ def _set_react_version(v_react, v_reactdom=None):
{
"external_url": {
"prod": [
"https://unpkg.com/@babel/[email protected]/dist/polyfill.min.js",
f"https://unpkg.com/react@{v_react}/umd/react.production.min.js",
f"https://unpkg.com/react-dom@{v_reactdom}/umd/react-dom.production.min.js",
"https://unpkg.com/[email protected]/prop-types.min.js",
"https://cdn.jsdelivr.net/npm/@babel/[email protected]/dist/polyfill.min.js",
f"https://cdn.jsdelivr.net/npm/react@{v_react}/umd/react.production.min.js",
f"https://cdn.jsdelivr.net/npm/react-dom@{v_reactdom}/umd/react-dom.production.min.js",
"https://cdn.jsdelivr.net/npm/[email protected]/prop-types.min.js",
],
"dev": [
"https://unpkg.com/@babel/[email protected]/dist/polyfill.min.js",
f"https://unpkg.com/react@{v_react}/umd/react.development.js",
f"https://unpkg.com/react-dom@{v_reactdom}/umd/react-dom.development.js",
"https://unpkg.com/[email protected]/prop-types.js",
"https://cdn.jsdelivr.net/npm/@babel/[email protected]/dist/polyfill.min.js",
f"https://cdn.jsdelivr.net/npm/react@{v_react}/umd/react.development.js",
f"https://cdn.jsdelivr.net/npm/react-dom@{v_reactdom}/umd/react-dom.development.js",
"https://cdn.jsdelivr.net/npm/[email protected]/prop-types.js",
],
},
"relative_package_path": {
Expand Down Expand Up @@ -64,7 +64,7 @@ def _set_react_version(v_react, v_reactdom=None):
{
"relative_package_path": "dash-renderer/build/dash_renderer.min.js",
"dev_package_path": "dash-renderer/build/dash_renderer.dev.js",
"external_url": "https://unpkg.com/[email protected]"
"external_url": "https://cdn.jsdelivr.net/npm/[email protected]"
"/build/dash_renderer.min.js",
"namespace": "dash",
},
Expand Down
18 changes: 9 additions & 9 deletions dash/dash-renderer/init.template
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ def _set_react_version(v_react, v_reactdom=None):
{
"external_url": {
"prod": [
"https://unpkg.com/@babel/polyfill@$polyfill/dist/polyfill.min.js",
f"https://unpkg.com/react@{v_react}/umd/react.production.min.js",
f"https://unpkg.com/react-dom@{v_reactdom}/umd/react-dom.production.min.js",
"https://unpkg.com/prop-types@$proptypes/prop-types.min.js",
"https://cdn.jsdelivr.net/npm/@babel/polyfill@$polyfill/dist/polyfill.min.js",
f"https://cdn.jsdelivr.net/npm/react@{v_react}/umd/react.production.min.js",
f"https://cdn.jsdelivr.net/npm/react-dom@{v_reactdom}/umd/react-dom.production.min.js",
"https://cdn.jsdelivr.net/npm/prop-types@$proptypes/prop-types.min.js",
],
"dev": [
"https://unpkg.com/@babel/polyfill@$polyfill/dist/polyfill.min.js",
f"https://unpkg.com/react@{v_react}/umd/react.development.js",
f"https://unpkg.com/react-dom@{v_reactdom}/umd/react-dom.development.js",
"https://unpkg.com/prop-types@$proptypes/prop-types.js",
"https://cdn.jsdelivr.net/npm/@babel/polyfill@$polyfill/dist/polyfill.min.js",
f"https://cdn.jsdelivr.net/npm/react@{v_react}/umd/react.development.js",
f"https://cdn.jsdelivr.net/npm/react-dom@{v_reactdom}/umd/react-dom.development.js",
"https://cdn.jsdelivr.net/npm/prop-types@$proptypes/prop-types.js",
],
},
"relative_package_path": {
Expand Down Expand Up @@ -64,7 +64,7 @@ _js_dist = [
{
"relative_package_path": "dash-renderer/build/dash_renderer.min.js",
"dev_package_path": "dash-renderer/build/dash_renderer.dev.js",
"external_url": "https://unpkg.com/dash-renderer@$version"
"external_url": "https://cdn.jsdelivr.net/npm/dash-renderer@$version"
"/build/dash_renderer.min.js",
"namespace": "dash",
},
Expand Down
2 changes: 1 addition & 1 deletion dash/development/build_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def bundles(self, build=None): # pylint:disable=too-many-locals
versions[f"extra_{name_squashed}_versions"] = f'"{extras_str}"'

for extra_version in extras:
url = f"https://unpkg.com/{name}@{extra_version}/umd/{filename}"
url = f"https://cdn.jsdelivr.net/npm/{name}@{extra_version}/umd/{filename}"
res = requests.get(url)
extra_target = f"{name}@{extra_version}.{ext}"
extra_path = self._concat(self.deps_folder, extra_target)
Expand Down