Conversation
- generator functions for style, proptypes, py2js prop mapping
| "webpack-cli": "^2.1.3", | ||
| "webpack-dev-server": "^3.1.5", | ||
| "webpack-preprocessor": "^0.1.11" | ||
| "webpack-preprocessor": "^0.1.12" |
There was a problem hiding this comment.
Previous version of the preprocessor was having issues with very large files. This one does not..
| 'writingMode', | ||
| 'zIndex', | ||
| 'zoom' | ||
| ]; |
There was a problem hiding this comment.
This list is not quite comprehensive but it's definitely more than the previous one..
There was a problem hiding this comment.
This file generates the various usages of the props -- just too easy to make a mistake modifying them manually
|
|
||
| snakes.forEach(([snake, camel]) => map.set(snake, camel)); | ||
| kebabs.forEach(([kebab, camel]) => map.set(kebab, camel)); | ||
| camels.forEach(([camel]) => map.set(camel, camel)); |
There was a problem hiding this comment.
Map the camel cased props above to kebab and snake
| stream1.write('\n]);') | ||
|
|
||
| stream1.end(); | ||
| }); |
There was a problem hiding this comment.
The camel/kebab/snake to camel mapping for react style
| stream2.write('}') | ||
|
|
||
| stream2.end(); | ||
| }); |
There was a problem hiding this comment.
The style interface for TS
| stream3.write('\n') | ||
|
|
||
| stream3.end(); | ||
| }); No newline at end of file |
There was a problem hiding this comment.
proptypes fragment for table.js / props definition
| verticalAlign: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), | ||
| zIndex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]) | ||
| }), | ||
| style_table: PropTypes.object, |
There was a problem hiding this comment.
Precise typing is too costly for the styles, will sanitize the props internally instead
(the build with all the explicit props increased by over 150%)
…itional-props # Conflicts: # dash_table/bundle.js # dash_table/demo.js
valentijnnieman
left a comment
There was a problem hiding this comment.
Looks good to me, but would love to know what @chriddyp thinks!
chriddyp
left a comment
There was a problem hiding this comment.
Fine by me. We'll have a way to display front-end errors to Dash devs soon, so we can just do validation there.
We also don't do any style validation for the rest of our components, so this isn't making it worse than anything else we provide.
This PR is about adding support for the missing style CSS properties. Doing so increases the number of props for the various style objects from ~150 to ~750 and makes the size of the bundle explode (~330 -> ~730kB) if the dash typing remains as tight. Hence, reducing the amount of typing done at dash-level in favor of continued full sanitation in TS -- if/when a communication channel for errors and warnings becomes available between the FE components and the dash server, mismtaches could be communicated as warnings through that channel.
Not bumping up version as this only refines the work done in RC6.