diff --git a/.circleci/config.yml b/.circleci/config.yml index 5c56769d..25b1440c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,15 @@ version: 2 jobs: + percy-finalize: + docker: + - image: percyio/agent + auth: + username: dashautomation + password: $DASH_PAT_DOCKERHUB + steps: + - run: percy finalize --all + python-2.7: &test-template docker: - image: circleci/python:2.7-stretch-node-browsers @@ -9,7 +18,7 @@ jobs: password: $DASH_PAT_DOCKERHUB environment: PYTHON_VERSION: py27 - PERCY_ENABLE: 1 + PERCY_ENABLE: 0 working_directory: ~/repo @@ -76,7 +85,8 @@ jobs: password: $DASH_PAT_DOCKERHUB environment: PYTHON_VERSION: py37 - PERCY_ENABLE: 0 + PERCY_ENABLE: 1 + PERCY_PARALLEL_TOTAL: -1 workflows: version: 2 @@ -85,3 +95,6 @@ workflows: - python-2.7 - python-3.6 - python-3.7 + - percy-finalize: + requires: + - python-3.7 diff --git a/CHANGELOG.md b/CHANGELOG.md index d32256bf..9a250adc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## UNRELEASED +### Fixed +- [#178](https://github.com/plotly/dash-html-components/pull/178) - Fix [#161](https://github.com/plotly/dash-html-components/issues/161) `data` property, and fix [#129](https://github.com/plotly/dash-html-components/issues/129) obsolete, deprecated, and discouraged elements. No elements were removed, but comments were added to the documentation about these elements detailing their limitations. + ## [1.1.2] - 2021-01-19 ### Fixed - [#169](https://github.com/plotly/dash-html-components/pull/169) - part of fixing dash import bug https://github.com/plotly/dash/issues/1143 diff --git a/package.json b/package.json index 9bc338a0..76bb724c 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "postbuild": "es-check es5 dash_html_components/*.js", "build:watch": "watch 'npm run build' src", "test:import": "python -m unittest tests.test_dash_import", - "test:py": "python -m unittest tests.test_dash_html_components tests.test_integration", + "test:py": "pytest --nopercyfinalize --headless tests/test_dash_html_components.py tests/test_integration.py", "test": "run-s -c test:py test:import lint" }, "author": "Chris Parmer ", diff --git a/scripts/extract-attributes.js b/scripts/extract-attributes.js index ec4e1a85..997a34b8 100644 --- a/scripts/extract-attributes.js +++ b/scripts/extract-attributes.js @@ -10,14 +10,13 @@ const dataPath = './data/attributes.json'; const htmlPath = './data/attributes.html'; // From https://facebook.github.io/react/docs/tags-and-attributes.html#supported-attributes -// less the `data` attribute, -// the special `className` and `htmlFor` props, +// less the special `className` and `htmlFor` props, // and `httpEquiv` + `acceptCharset` which are already correctly camelCased. const supportedAttributes = ['accept', 'accessKey', 'action', 'allowFullScreen', 'allowTransparency', 'alt', 'async', 'autoComplete', 'autoFocus', 'autoPlay', 'capture', 'cellPadding', 'cellSpacing', 'challenge', 'charSet', 'checked', 'cite', 'classID', 'colSpan', 'cols', 'content', -'contentEditable', 'contextMenu', 'controls', 'coords', 'crossOrigin', +'contentEditable', 'contextMenu', 'controls', 'coords', 'crossOrigin', 'data', 'dateTime', 'default', 'defer', 'dir', 'disabled', 'download', 'draggable', 'encType', 'form', 'formAction', 'formEncType', 'formMethod', 'formNoValidate', 'formTarget', 'frameBorder', 'headers', 'height', 'hidden', 'high', 'href', @@ -82,7 +81,7 @@ function extractAttributes($) { .toString(); // Skip `data-*` attributes - if (htmlAttribute.indexOf('data') === 0) { + if (htmlAttribute.indexOf('data-') === 0) { return; } diff --git a/scripts/extract-elements.js b/scripts/extract-elements.js index d7a5f4f8..9292f5a9 100644 --- a/scripts/extract-elements.js +++ b/scripts/extract-elements.js @@ -20,11 +20,18 @@ function extractElements($) { 'svg', 'math', // obsolete, non-standard, or deprecated tags 'image', 'dir', 'tt', 'applet', 'noembed', 'bgsound', 'menu', 'menuitem', - 'noframes' + 'noframes', + // experimental, don't add yet + 'portal' ]; // `
` is for some reason missing from the reference tables. + // `` and `element` are obsolete and has been removed from the + // reference table, but we had them in the past so we should wait for a + // major to remove const addElements = [ 'base', + 'command', + 'element', 'section', 'h1', 'h2', @@ -64,6 +71,7 @@ request(refUrl, (error, response, html) => { if (elements.length !== expectedElCount) { throw new Error( 'Unexpected number of elements extracted from ' + refUrl + + ' - Found ' + elements.length + ' but expected ' + expectedElCount + ' Check the output and edit expectedElCount if this is intended.' ); } diff --git a/scripts/generate-components.js b/scripts/generate-components.js index d2e1a0da..e2f1a77e 100644 --- a/scripts/generate-components.js +++ b/scripts/generate-components.js @@ -198,16 +198,68 @@ function generatePropTypes(element, attributes) { 'setProps': PropTypes.func` } +const obsoleteDoc = element => ` + * OBSOLETE: <${element}> is included for completeness, but should be avoided + * as it is not supported by any modern browsers.`; + +const customDocs = { + basefont: ` + * OBSOLETE: is included for completeness, but should be avoided + * as it is only supported by Internet Explorer.`, + blink: obsoleteDoc('blink'), + command: obsoleteDoc('command'), + element: obsoleteDoc('element'), + isindex: obsoleteDoc('isindex'), + keygen: ` + * DEPRECATED: is included for completeness, but should be avoided + * as it is not supported by all browsers and may be removed at any time from + * those that do support it.`, + listing: obsoleteDoc('listing') + ' Use
 or  instead.',
+    marquee: `
+ * DEPRECATED:  is included for completeness, but should be avoided
+ * as browsers may remove it at any time.`,
+    meta: `
+ * CAUTION:  is included for completeness, but generally will not behave
+ * as expected since  tags should be static HTML content in the  of
+ * the document. Dash components are dynamic  content.`,
+    multicol: obsoleteDoc('multicol'),
+    nextid: obsoleteDoc('nextid'),
+    output: `
+ * CAUTION:  is included for completeness, but its typical usage
+ * requires the oninput attribute of the enclosing 
element, which + * is not accessible to Dash.`, + script: ` + * CAUTION: