Skip to content

Remove special casing of toString values when enableTrustedTypesIntegration #17774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 8, 2020

Conversation

sebmarkbage
Copy link
Collaborator

@sebmarkbage sebmarkbage commented Jan 4, 2020

As far as I can tell, we only toString in user space because of IE8/9. I tested in IE10 and IE11 and it doesn't seem to be an issue there.

We don't really support IE8/9 anymore and by the time this flag is on, it should be fine to stop supporting IE8/9. Arguably it's already ok to break it since we've done so with other IE8/9 things.

As far as I can tell, the toString call was added here:

facebook@caae627#diff-5574f655d491348f422bca600ff6711dR887

It was never really needed. Subsequently when we added Trusted Types,
this needed to be changed to a special call but we really should just
always let it pass through.
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 4, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ac96bc5:

Sandbox Source
hopeful-hoover-bjh0b Configuration

@sizebot
Copy link

sizebot commented Jan 4, 2020

Details of bundled changes.

Comparing: f749045...ac96bc5

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom-server.browser.production.min.js 0.0% -0.0% 19.92 KB 19.92 KB 7.39 KB 7.39 KB NODE_PROD
react-dom-test-utils.development.js 0.0% -0.0% 52.76 KB 52.76 KB 14.99 KB 14.99 KB NODE_DEV
react-dom.production.min.js -0.0% 0.0% 115.35 KB 115.35 KB 37.18 KB 37.18 KB UMD_PROD
react-dom.profiling.min.js -0.0% 0.0% 118.98 KB 118.98 KB 38.36 KB 38.36 KB UMD_PROFILING
react-dom.development.js -0.2% -0.2% 945.45 KB 943.94 KB 213.45 KB 213.07 KB NODE_DEV
react-dom.production.min.js -0.0% 0.0% 115.42 KB 115.41 KB 36.54 KB 36.54 KB NODE_PROD
react-dom.profiling.min.js -0.0% 0.0% 119.18 KB 119.18 KB 37.66 KB 37.66 KB NODE_PROFILING
react-dom-server.browser.development.js 0.0% -0.0% 137.69 KB 137.69 KB 36.61 KB 36.61 KB UMD_DEV
react-dom-server.browser.production.min.js 0.0% -0.0% 19.99 KB 19.99 KB 7.4 KB 7.4 KB UMD_PROD
react-dom-unstable-fizz.browser.development.js 0.0% -0.1% 3.7 KB 3.7 KB 1.5 KB 1.49 KB NODE_DEV
react-dom-test-utils.development.js 0.0% -0.0% 54.48 KB 54.48 KB 15.31 KB 15.31 KB UMD_DEV
react-dom-test-utils.production.min.js 0.0% 0.0% 11.17 KB 11.17 KB 4.14 KB 4.14 KB UMD_PROD
react-dom-server.browser.development.js 0.0% -0.0% 133.62 KB 133.62 KB 35.58 KB 35.58 KB NODE_DEV
react-dom-test-utils.production.min.js 0.0% 0.0% 10.94 KB 10.94 KB 4.08 KB 4.08 KB NODE_PROD
react-dom-server.node.development.js 0.0% -0.0% 134.73 KB 134.73 KB 35.81 KB 35.81 KB NODE_DEV
react-dom.development.js -0.2% -0.2% 951.39 KB 949.87 KB 215.13 KB 214.79 KB UMD_DEV

ReactDOM: size: -0.0%, gzip: 0.0%

Size changes (stable)

Generated by 🚫 dangerJS against ac96bc5

@sizebot
Copy link

sizebot commented Jan 4, 2020

Details of bundled changes.

Comparing: f749045...ac96bc5

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.profiling.min.js -0.0% 0.0% 123.16 KB 123.16 KB 38.74 KB 38.74 KB NODE_PROFILING
react-dom-server.browser.development.js 0.0% -0.0% 137.71 KB 137.71 KB 36.61 KB 36.61 KB UMD_DEV
react-dom-unstable-fizz.browser.development.js 0.0% -0.1% 3.71 KB 3.71 KB 1.5 KB 1.5 KB NODE_DEV
react-dom-test-utils.production.min.js 0.0% 0.0% 10.95 KB 10.95 KB 4.09 KB 4.09 KB NODE_PROD
react-dom.development.js -0.2% -0.2% 951.41 KB 949.89 KB 215.16 KB 214.81 KB UMD_DEV
react-dom.production.min.js -0.0% -0.0% 119.19 KB 119.18 KB 38.29 KB 38.29 KB UMD_PROD
react-dom.profiling.min.js -0.0% -0.0% 122.93 KB 122.92 KB 39.52 KB 39.52 KB UMD_PROFILING
react-dom.development.js -0.2% -0.2% 945.47 KB 943.96 KB 213.48 KB 213.1 KB NODE_DEV
react-dom.production.min.js -0.0% 0.0% 119.28 KB 119.28 KB 37.61 KB 37.61 KB NODE_PROD
react-dom-server.browser.development.js 0.0% -0.0% 133.65 KB 133.65 KB 35.58 KB 35.58 KB NODE_DEV
ReactDOM-dev.js -0.2% -0.2% 973.35 KB 971.78 KB 216.46 KB 216.05 KB FB_WWW_DEV
ReactDOM-prod.js -0.1% -0.1% 394.15 KB 393.68 KB 72.19 KB 72.08 KB FB_WWW_PROD
ReactDOM-profiling.js -0.1% -0.2% 405.44 KB 404.98 KB 74.35 KB 74.24 KB FB_WWW_PROFILING
react-dom-unstable-native-dependencies.production.min.js 0.0% -0.0% 10.23 KB 10.23 KB 3.48 KB 3.47 KB UMD_PROD
react-dom-unstable-native-dependencies.development.js 0.0% -0.0% 60.61 KB 60.61 KB 16 KB 16 KB NODE_DEV
ReactDOMServer-dev.js 0.0% -0.0% 139.36 KB 139.36 KB 35.43 KB 35.43 KB FB_WWW_DEV

Size changes (experimental)

Generated by 🚫 dangerJS against ac96bc5

@sebmarkbage
Copy link
Collaborator Author

I also removed the fancy typed abstractions. They actually provide more harm than they help. It makes it seem like you should go through them to get to a string or string like object but often you should just special case it at every callsite. Like this one: https://github.com/facebook/react/pull/17322/files#r362947154

The abstractions makes it seem like it can be used in other places but it's really only useful in one place and so we should inline it in that one place.

…ration

As far as I can tell, we only toString in user space because of IE8/9.

We don't really support IE8/9 anymore and by the time this flag is on,
we should be able to deprecate it.

Unless this is also an issue in IE11. I haven't tested yet.
@gaearon
Copy link
Collaborator

gaearon commented Jan 4, 2020

I think we do support IE9 when Map/Set/rAF polyfills are on. I don't think we added anything that would have broken it yet. But breaking it in 17 makes sense to me.

@necolas necolas added the React Core Team Opened by a member of the React Core Team label Jan 8, 2020
@gaearon gaearon mentioned this pull request Jan 8, 2020
@sebmarkbage sebmarkbage merged commit 18875b2 into facebook:master Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants