Skip to content
Merged
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
2 changes: 1 addition & 1 deletion @plotly/webpack-dash-dynamic-import/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function getFingerprint() {
const packageJson = JSON.parse(package);

const timestamp = Math.round(Date.now() / 1000);
const version = packageJson.version.replace(/[.]/g, '_');
const version = packageJson.version.replace(/[^\w-]/g, '_');

return `"v${version}m${timestamp}"`;
}
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased
### Fixed
- [#999](https://github.com/plotly/dash/pull/999) Fix fingerprint for component suites with `metadata` in version.
- [#983](https://github.com/plotly/dash/pull/983) Fix the assets loading issues when dashR application runner is handling with an app defined by string chunk.

## [1.5.1] - 2019-10-29
Expand Down
4 changes: 2 additions & 2 deletions dash/fingerprint.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import re

cache_regex = re.compile(r"^v[\w-]+m[0-9a-fA-F]+$")

version_clean = re.compile(r"[^\w-]")

def build_fingerprint(path, version, hash_value):
path_parts = path.split("/")
filename, extension = path_parts[-1].split(".", 1)

return "{}.v{}m{}.{}".format(
"/".join(path_parts[:-1] + [filename]),
str(version).replace(".", "_"),
re.sub(version_clean, "_", str(version)),
hash_value,
extension,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/devtools/test_props_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@


def test_dvpc001_prop_check_errors_with_path(dash_duo):
app = dash.Dash(__name__)
app = dash.Dash(__name__, eager_loading=True)

app.layout = html.Div([html.Div(id="content"), dcc.Location(id="location")])

Expand Down
6 changes: 6 additions & 0 deletions tests/unit/test_fingerprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
"version": "1.1.1-alpha.1",
"hash": "1234567890abcdef",
},
{
"path": "react@16.8.6.min.js",
"fingerprint": "react@16.v1_1_1-alpha_x_y_y_X_Y_Z_1_2_3_metadata_xx_yy_zz_XX_YY_ZZ_11_22_33_mmm1234567890abcdefABCDEF.8.6.min.js",
"version": "1.1.1-alpha.x.y.y.X.Y.Z.1.2.3+metadata.xx.yy.zz.XX.YY.ZZ.11.22.33.mm",
"hash": "1234567890abcdefABCDEF",
},
{"path": "dash.plotly.js", "fingerprint": "dash.v1m1.plotly.js"},
{"path": "dash.plotly.j_s", "fingerprint": "dash.v1m1.plotly.j_s"},
{"path": "dash.plotly.css", "fingerprint": "dash.v1m1.plotly.css"},
Expand Down