Skip to content

Commit a3a7859

Browse files
author
Marc-André Rivet
committed
- Merge branch 'iframe-sandbox-support' of github.com:plotly/dash into iframe-sandbox-support
- Update build artifacts # Conflicts: # dash-renderer/src/AccessDenied.react.js # dash-renderer/src/actions/index.js # tests/integration/renderer/test_iframe.py
2 parents c2d6dce + 8ee3588 commit a3a7859

File tree

16 files changed

+137
-22
lines changed

16 files changed

+137
-22
lines changed

@plotly/dash-component-plugins/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@plotly/dash-component-plugins",
3-
"version": "1.0.2",
3+
"version": "1.2.0",
44
"description": "Plugins for Dash Components",
55
"repository": {
66
"type": "git",
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const ON_CHANGE = '_dashprivate_historychange';
2+
3+
export default class History {
4+
static dispatchChangeEvent() {
5+
window.dispatchEvent(new CustomEvent(ON_CHANGE));
6+
}
7+
8+
static onChange(listener) {
9+
window.addEventListener(ON_CHANGE, listener);
10+
11+
return () => window.removeEventListener(ON_CHANGE, listener);
12+
}
13+
}

@plotly/dash-component-plugins/src/dynamicImport.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,11 @@ export const asyncDecorator = (target, promise) => {
2727
return state.get;
2828
};
2929

30+
export const inheritAsyncDecorator = (target, source) => {
31+
Object.defineProperty(target, '_dashprivate_isLazyComponentReady', {
32+
get: () => isReady(source)
33+
});
34+
}
35+
3036
export const isReady = target => target &&
3137
target._dashprivate_isLazyComponentReady;
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
import { asyncDecorator, isReady } from './dynamicImport';
1+
import { asyncDecorator, inheritAsyncDecorator, isReady } from './dynamicImport';
2+
import History from './History';
23

3-
export { asyncDecorator, isReady };
4+
export { asyncDecorator, inheritAsyncDecorator, isReady };
5+
export { History };

@plotly/webpack-dash-dynamic-import/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@plotly/webpack-dash-dynamic-import",
3-
"version": "1.1.4",
3+
"version": "1.1.5",
44
"description": "Webpack Plugin for Dynamic Import in Dash",
55
"repository": {
66
"type": "git",

@plotly/webpack-dash-dynamic-import/src/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,15 @@ var getCurrentScript = function() {
2020
if (!script) {
2121
/* Shim for IE11 and below */
2222
/* Do not take into account async scripts and inline scripts */
23-
var scripts = Array.from(document.getElementsByTagName('script')).filter(function(s) { return !s.async && !s.text && !s.textContent; });
23+
24+
var doc_scripts = document.getElementsByTagName('script');
25+
var scripts = [];
26+
27+
for (var i = 0; i < doc_scripts.length; i++) {
28+
scripts.push(doc_scripts[i]);
29+
}
30+
31+
scripts = scripts.filter(function(s) { return !s.async && !s.text && !s.textContent; });
2432
script = scripts.slice(-1)[0];
2533
}
2634

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
All notable changes to `dash` will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [1.9.0] - 2020-02-04
6+
### Fixed
7+
- [#1080](https://github.com/plotly/dash/pull/1080) Handle case where dash fails to load when used inside an iframe with a sandbox attribute that only has allow-scripts
8+
59
## [1.8.0] - 2020-01-14
610
### Added
711
- [#1073](https://github.com/plotly/dash/pull/1073) Two new functions to simplify usage handling URLs and pathnames: `app.get_relative_path` & `app.trim_relative_path`.

dash-renderer/dash_renderer/dash_renderer.dev.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30344,10 +30344,18 @@ function hydrateInitialOutputs() {
3034430344
dispatch(setAppLifecycle(Object(_reducers_constants__WEBPACK_IMPORTED_MODULE_3__["getAppState"])('HYDRATED')));
3034530345
};
3034630346
}
30347+
/* eslint-disable-next-line no-console */
30348+
30349+
var logWarningOnce = Object(ramda__WEBPACK_IMPORTED_MODULE_0__["once"])(console.warn);
3034730350
function getCSRFHeader() {
30348-
return {
30349-
'X-CSRFToken': cookie__WEBPACK_IMPORTED_MODULE_5___default.a.parse(document.cookie)._csrf_token
30350-
};
30351+
try {
30352+
return {
30353+
'X-CSRFToken': cookie__WEBPACK_IMPORTED_MODULE_5___default.a.parse(document.cookie)._csrf_token
30354+
};
30355+
} catch (e) {
30356+
logWarningOnce(e);
30357+
return {};
30358+
}
3035130359
}
3035230360

3035330361
function triggerDefaultState(dispatch, getState) {

dash-renderer/dash_renderer/dash_renderer.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dash-renderer/digest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"MD5 (dash_renderer.dev.js)":"561787639c4e4e6dfc2ed334f8b9c08e",
3-
"MD5 (dash_renderer.min.js)":"b89f7fc48aecc81250a3a002f0f0a5a0",
2+
"MD5 (dash_renderer.dev.js)":"cf7796e1ced87563812cea38d16ea281",
3+
"MD5 (dash_renderer.min.js)":"c6e5cda1b2572fee63e19b344258b512",
44
"MD5 ([email protected])":"ed6472b73ae010eee88282933a04c2a1",
55
"MD5 ([email protected])":"85947944e396a28895fad5f553eee36f",
66
"MD5 ([email protected])":"e3053393609bd2744010498629a43597",

0 commit comments

Comments
 (0)