From 1d64c8a2584aed3e2fa3af688b7e1a8ec45e066a Mon Sep 17 00:00:00 2001 From: alexcjohnson Date: Tue, 15 Dec 2020 17:50:58 -0500 Subject: [PATCH 1/2] update extract-attributes script for latest MDN page structure and provide an error message if we see the page structure change in the future --- scripts/extract-attributes.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/extract-attributes.js b/scripts/extract-attributes.js index 4b9482db..8409d58f 100644 --- a/scripts/extract-attributes.js +++ b/scripts/extract-attributes.js @@ -55,7 +55,10 @@ const attributeMap = supportedAttributes.reduce((map, reactAttribute) => { * descriptions and supported elements. */ function extractAttributes($) { - const $table = $('#Attribute_list').next('table'); + const $table = $('#Attribute_list').parent().find('table'); + if($table.length !== 1) { + throw new Error('page structure changed at ' + htmlURL); + } const attributes = {}; $table.find('tbody tr').each((i, row) => { From 4aebb6aae8d52f2ce82ecc7281c39a43f2c149e0 Mon Sep 17 00:00:00 2001 From: alexcjohnson Date: Tue, 15 Dec 2020 17:57:37 -0500 Subject: [PATCH 2/2] description for setProps - to reduce warnings --- scripts/generate-components.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/generate-components.js b/scripts/generate-components.js index 0eecc1f0..d2e1a0da 100644 --- a/scripts/generate-components.js +++ b/scripts/generate-components.js @@ -192,6 +192,9 @@ function generatePropTypes(element, attributes) { component_name: PropTypes.string, }), + /** + * Dash-assigned callback that gets fired when the element is clicked. + */ 'setProps': PropTypes.func` }