From cc73a837d95c6f2516628f88095ba7f63c723daa Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Sat, 6 Jan 2024 13:43:14 +0100 Subject: [PATCH 1/6] Ensure Apple Silicon support in attribute-behavior fixture --- fixtures/attribute-behavior/package.json | 3 + fixtures/attribute-behavior/yarn.lock | 170 ++++------------------- 2 files changed, 33 insertions(+), 140 deletions(-) diff --git a/fixtures/attribute-behavior/package.json b/fixtures/attribute-behavior/package.json index 1bd16d5655dc0..67464ada094b4 100644 --- a/fixtures/attribute-behavior/package.json +++ b/fixtures/attribute-behavior/package.json @@ -10,6 +10,9 @@ "react-scripts": "1.0.11", "react-virtualized": "^9.9.0" }, + "resolutions": { + "fsevents": "1.2.13" + }, "scripts": { "predev": "cp ../../build/oss-experimental/react/umd/react.development.js public/ && cp ../../build/oss-experimental/react-dom/umd/react-dom.development.js public/ && cp ../../build/oss-experimental/react-dom/umd/react-dom-server-legacy.browser.development.js public/", diff --git a/fixtures/attribute-behavior/yarn.lock b/fixtures/attribute-behavior/yarn.lock index 4359d28cc39d3..7529b7a098a9c 100644 --- a/fixtures/attribute-behavior/yarn.lock +++ b/fixtures/attribute-behavior/yarn.lock @@ -6,10 +6,6 @@ abab@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.3.tgz#b81de5f7274ec4e756d797cd834f303642724e5d" -abbrev@1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.0.tgz#d0554c2256636e2f56e7c2e5ad183f859428d81f" - accepts@~1.3.3: version "1.3.4" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.4.tgz#86246758c7dd6d21a6474ff084a4740ec05eb21f" @@ -144,17 +140,6 @@ append-transform@^0.4.0: dependencies: default-require-extensions "^1.0.0" -aproba@^1.0.3: - version "1.1.2" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.1.2.tgz#45c6629094de4e96f693ef7eab74ae079c240fc1" - -are-we-there-yet@~1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz#bb5dca382bb94f05e15194373d16fd3ba1ca110d" - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" - argparse@^1.0.7: version "1.0.9" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" @@ -1036,11 +1021,12 @@ binary-extensions@^1.0.0: version "1.10.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.10.0.tgz#9aeb9a6c5e88638aad171e167f5900abe24835d0" -block-stream@*: - version "0.0.9" - resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" +bindings@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" + integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== dependencies: - inherits "~2.0.0" + file-uri-to-path "1.0.0" bluebird@^3.4.7: version "3.5.0" @@ -1536,10 +1522,6 @@ console-browserify@^1.1.0: dependencies: date-now "^0.1.4" -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - constants-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" @@ -1887,10 +1869,6 @@ delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - depd@1.1.1, depd@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359" @@ -2583,6 +2561,11 @@ file-saver@^1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/file-saver/-/file-saver-1.3.3.tgz#cdd4c44d3aa264eac2f68ec165bc791c34af1232" +file-uri-to-path@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" + integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== + filename-regex@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" @@ -2722,29 +2705,13 @@ fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" -fsevents@1.1.2, fsevents@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.2.tgz#3282b713fb3ad80ede0e9fcf4611b5aa6fc033f4" +fsevents@1.1.2, fsevents@1.2.13, fsevents@^1.0.0: + version "1.2.13" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.13.tgz#f325cb0455592428bcf11b383370ef70e3bfcc38" + integrity sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw== dependencies: - nan "^2.3.0" - node-pre-gyp "^0.6.36" - -fstream-ignore@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105" - dependencies: - fstream "^1.0.0" - inherits "2" - minimatch "^3.0.0" - -fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2: - version "1.0.11" - resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" - dependencies: - graceful-fs "^4.1.2" - inherits "~2.0.0" - mkdirp ">=0.5 0" - rimraf "2" + bindings "^1.5.0" + nan "^2.12.1" function-bind@^1.0.2, function-bind@^1.1.0: version "1.1.0" @@ -2754,19 +2721,6 @@ functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - get-caller-file@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" @@ -2935,10 +2889,6 @@ has-flag@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" -has-unicode@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - has@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" @@ -3159,7 +3109,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: +inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" @@ -4190,7 +4140,7 @@ minimatch@3.0.3: dependencies: brace-expansion "^1.0.0" -minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: +minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: @@ -4208,7 +4158,7 @@ minimist@~0.0.1: version "0.0.10" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" -mkdirp@0.5.1, mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: +mkdirp@0.5.1, mkdirp@0.5.x, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: @@ -4233,9 +4183,10 @@ mute-stream@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" -nan@^2.3.0: - version "2.6.2" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.6.2.tgz#e4ff34e6c95fdfb5aecc08de6596f43605a7db45" +nan@^2.12.1: + version "2.18.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.18.0.tgz#26a6faae7ffbeb293a39660e88a76b82e30b7554" + integrity sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w== natural-compare@^1.4.0: version "1.4.0" @@ -4313,31 +4264,10 @@ node-notifier@^5.0.2: shellwords "^0.1.0" which "^1.2.12" -node-pre-gyp@^0.6.36: - version "0.6.36" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.36.tgz#db604112cb74e0d477554e9b505b17abddfab786" - dependencies: - mkdirp "^0.5.1" - nopt "^4.0.1" - npmlog "^4.0.2" - rc "^1.1.7" - request "^2.81.0" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^2.2.1" - tar-pack "^3.4.0" - node-status-codes@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/node-status-codes/-/node-status-codes-1.0.0.tgz#5ae5541d024645d32a58fcddc9ceecea7ae3ac2f" -nopt@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" - dependencies: - abbrev "1" - osenv "^0.1.4" - normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: version "2.4.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" @@ -4372,15 +4302,6 @@ npm-run-path@^2.0.0: dependencies: path-key "^2.0.0" -npmlog@^4.0.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - nth-check@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.1.tgz#9929acdf628fc2c41098deab82ac580cf149aae4" @@ -4436,7 +4357,7 @@ on-headers@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.1.tgz#928f5d0f470d49342651ea6794b0857c100693f7" -once@^1.3.0, once@^1.3.3, once@^1.4.0: +once@^1.3.0, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: @@ -4511,7 +4432,7 @@ os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" -osenv@^0.1.0, osenv@^0.1.4: +osenv@^0.1.0: version "0.1.4" resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.4.tgz#42fe6d5953df06c8064be6f176c3d05aaaa34644" dependencies: @@ -5146,7 +5067,7 @@ range-parser@^1.0.3, range-parser@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" -rc@^1.0.1, rc@^1.1.6, rc@^1.1.7: +rc@^1.0.1, rc@^1.1.6: version "1.2.1" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.1.tgz#2e03e8e42ee450b8cb3dce65be1bf8974e1dfd95" dependencies: @@ -5308,7 +5229,7 @@ readable-stream@1.0: isarray "0.0.1" string_decoder "~0.10.x" -readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.2.2, readable-stream@^2.2.6, readable-stream@^2.2.9: +readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.2.2, readable-stream@^2.2.6, readable-stream@^2.2.9: version "2.3.3" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c" dependencies: @@ -5470,7 +5391,7 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" -request@^2.79.0, request@^2.81.0: +request@^2.79.0: version "2.81.0" resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" dependencies: @@ -5554,7 +5475,7 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.6.1: +rimraf@^2.2.8, rimraf@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" dependencies: @@ -5680,7 +5601,7 @@ serviceworker-cache-polyfill@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/serviceworker-cache-polyfill/-/serviceworker-cache-polyfill-4.0.0.tgz#de19ee73bef21ab3c0740a37b33db62464babdeb" -set-blocking@^2.0.0, set-blocking@~2.0.0: +set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -6048,27 +5969,6 @@ tapable@^0.2.7: version "0.2.8" resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.8.tgz#99372a5c999bf2df160afc0d74bed4f47948cd22" -tar-pack@^3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.4.0.tgz#23be2d7f671a8339376cbdb0b8fe3fdebf317984" - dependencies: - debug "^2.2.0" - fstream "^1.0.10" - fstream-ignore "^1.0.5" - once "^1.3.3" - readable-stream "^2.1.4" - rimraf "^2.5.1" - tar "^2.2.1" - uid-number "^0.0.6" - -tar@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" - dependencies: - block-stream "*" - fstream "^1.0.2" - inherits "2" - test-exclude@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.1.tgz#4d84964b0966b0087ecc334a2ce002d3d9341e26" @@ -6223,10 +6123,6 @@ uglifyjs-webpack-plugin@^0.4.6: uglify-js "^2.8.29" webpack-sources "^1.0.1" -uid-number@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" - uniq@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" @@ -6523,12 +6419,6 @@ which@^1.2.12, which@^1.2.14, which@^1.2.9: dependencies: isexe "^2.0.0" -wide-align@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.2.tgz#571e0f1b0604636ebc0dfc21b0339bbe31341710" - dependencies: - string-width "^1.0.2" - widest-line@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-1.0.0.tgz#0c09c85c2a94683d0d7eaf8ee097d564bf0e105c" From 033fce19a2e7c98300f3b99b6806f0b3e7a720ee Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Sat, 6 Jan 2024 17:13:49 +0100 Subject: [PATCH 2/6] Use modern rendering APIs for attribute-behavior fixture --- fixtures/attribute-behavior/.gitignore | 2 +- .../AttributeTableSnapshot.md | 40 +++++------ fixtures/attribute-behavior/package.json | 2 +- fixtures/attribute-behavior/src/App.js | 68 ++++++++++++++----- 4 files changed, 72 insertions(+), 40 deletions(-) diff --git a/fixtures/attribute-behavior/.gitignore b/fixtures/attribute-behavior/.gitignore index 9190def2d174c..49c5a75db9401 100644 --- a/fixtures/attribute-behavior/.gitignore +++ b/fixtures/attribute-behavior/.gitignore @@ -10,7 +10,7 @@ /build /public/react.development.js /public/react-dom.development.js -/public/react-dom-server-legacy.browser.development.js +/public/react-dom-server.browser.development.js # misc .DS_Store diff --git a/fixtures/attribute-behavior/AttributeTableSnapshot.md b/fixtures/attribute-behavior/AttributeTableSnapshot.md index 89e126ba234cf..d69d96564f907 100644 --- a/fixtures/attribute-behavior/AttributeTableSnapshot.md +++ b/fixtures/attribute-behavior/AttributeTableSnapshot.md @@ -294,7 +294,7 @@ | `action=(string 'on')`| (changed)| `"http://localhost:3000/on"` | | `action=(string 'off')`| (changed)| `"http://localhost:3000/off"` | | `action=(symbol)`| (initial, warning)| `"http://localhost:3000/"` | -| `action=(function)`| (initial, warning)| `"http://localhost:3000/"` | +| `action=(function)`| (changed, ssr error, ssr mismatch)| `"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')"` | | `action=(null)`| (initial)| `"http://localhost:3000/"` | | `action=(undefined)`| (initial)| `"http://localhost:3000/"` | @@ -2568,8 +2568,8 @@ | `defaultChecked=(string 'false')`| (changed)| `` | | `defaultChecked=(string 'on')`| (changed)| `` | | `defaultChecked=(string 'off')`| (changed)| `` | -| `defaultChecked=(symbol)`| (changed, ssr mismatch)| `` | -| `defaultChecked=(function)`| (changed, ssr mismatch)| `` | +| `defaultChecked=(symbol)`| (initial)| `` | +| `defaultChecked=(function)`| (initial)| `` | | `defaultChecked=(null)`| (initial)| `` | | `defaultChecked=(undefined)`| (initial)| `` | @@ -4176,25 +4176,25 @@ ## `formAction` (on `` inside `
`) | Test Case | Flags | Result | | --- | --- | --- | -| `formAction=(string)`| (changed)| `"https://reactjs.com/"` | -| `formAction=(empty string)`| (initial)| `"http://localhost:3000/"` | -| `formAction=(array with string)`| (changed)| `"https://reactjs.com/"` | -| `formAction=(empty array)`| (initial)| `"http://localhost:3000/"` | -| `formAction=(object)`| (changed)| `"http://localhost:3000/result%20of%20toString()"` | -| `formAction=(numeric string)`| (changed)| `"http://localhost:3000/42"` | -| `formAction=(-1)`| (changed)| `"http://localhost:3000/-1"` | -| `formAction=(0)`| (changed)| `"http://localhost:3000/0"` | -| `formAction=(integer)`| (changed)| `"http://localhost:3000/1"` | +| `formAction=(string)`| (changed, warning)| `"https://reactjs.com/"` | +| `formAction=(empty string)`| (initial, warning)| `"http://localhost:3000/"` | +| `formAction=(array with string)`| (changed, warning)| `"https://reactjs.com/"` | +| `formAction=(empty array)`| (initial, warning)| `"http://localhost:3000/"` | +| `formAction=(object)`| (changed, warning)| `"http://localhost:3000/result%20of%20toString()"` | +| `formAction=(numeric string)`| (changed, warning)| `"http://localhost:3000/42"` | +| `formAction=(-1)`| (changed, warning)| `"http://localhost:3000/-1"` | +| `formAction=(0)`| (changed, warning)| `"http://localhost:3000/0"` | +| `formAction=(integer)`| (changed, warning)| `"http://localhost:3000/1"` | | `formAction=(NaN)`| (changed, warning)| `"http://localhost:3000/NaN"` | -| `formAction=(float)`| (changed)| `"http://localhost:3000/99.99"` | +| `formAction=(float)`| (changed, warning)| `"http://localhost:3000/99.99"` | | `formAction=(true)`| (initial, warning)| `"http://localhost:3000/"` | | `formAction=(false)`| (initial, warning)| `"http://localhost:3000/"` | -| `formAction=(string 'true')`| (changed)| `"http://localhost:3000/true"` | -| `formAction=(string 'false')`| (changed)| `"http://localhost:3000/false"` | -| `formAction=(string 'on')`| (changed)| `"http://localhost:3000/on"` | -| `formAction=(string 'off')`| (changed)| `"http://localhost:3000/off"` | +| `formAction=(string 'true')`| (changed, warning)| `"http://localhost:3000/true"` | +| `formAction=(string 'false')`| (changed, warning)| `"http://localhost:3000/false"` | +| `formAction=(string 'on')`| (changed, warning)| `"http://localhost:3000/on"` | +| `formAction=(string 'off')`| (changed, warning)| `"http://localhost:3000/off"` | | `formAction=(symbol)`| (initial, warning)| `"http://localhost:3000/"` | -| `formAction=(function)`| (initial, warning)| `"http://localhost:3000/"` | +| `formAction=(function)`| (changed, warning, ssr error, ssr mismatch)| `"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')"` | | `formAction=(null)`| (initial)| `"http://localhost:3000/"` | | `formAction=(undefined)`| (initial)| `"http://localhost:3000/"` | @@ -5052,7 +5052,7 @@ | Test Case | Flags | Result | | --- | --- | --- | | `href=(string)`| (changed)| `"https://reactjs.com/"` | -| `href=(empty string)`| (changed)| `"http://localhost:3000/"` | +| `href=(empty string)`| (initial, warning)| `` | | `href=(array with string)`| (changed)| `"https://reactjs.com/"` | | `href=(empty array)`| (changed)| `"http://localhost:3000/"` | | `href=(object)`| (changed)| `"http://localhost:3000/result%20of%20toString()"` | @@ -9877,7 +9877,7 @@ | Test Case | Flags | Result | | --- | --- | --- | | `src=(string)`| (changed)| `"https://reactjs.com/"` | -| `src=(empty string)`| (changed)| `"http://localhost:3000/"` | +| `src=(empty string)`| (initial, warning)| `` | | `src=(array with string)`| (changed)| `"https://reactjs.com/"` | | `src=(empty array)`| (changed)| `"http://localhost:3000/"` | | `src=(object)`| (changed)| `"http://localhost:3000/result%20of%20toString()"` | diff --git a/fixtures/attribute-behavior/package.json b/fixtures/attribute-behavior/package.json index 67464ada094b4..345fd34a8d9fe 100644 --- a/fixtures/attribute-behavior/package.json +++ b/fixtures/attribute-behavior/package.json @@ -15,7 +15,7 @@ }, "scripts": { "predev": - "cp ../../build/oss-experimental/react/umd/react.development.js public/ && cp ../../build/oss-experimental/react-dom/umd/react-dom.development.js public/ && cp ../../build/oss-experimental/react-dom/umd/react-dom-server-legacy.browser.development.js public/", + "cp ../../build/oss-experimental/react/umd/react.development.js public/ && cp ../../build/oss-experimental/react-dom/umd/react-dom.development.js public/ && cp ../../build/oss-experimental/react-dom/umd/react-dom-server.browser.development.js public/", "dev": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test --env=jsdom", diff --git a/fixtures/attribute-behavior/src/App.js b/fixtures/attribute-behavior/src/App.js index db77eba907c5a..ad6e863e1fa00 100644 --- a/fixtures/attribute-behavior/src/App.js +++ b/fixtures/attribute-behavior/src/App.js @@ -213,13 +213,32 @@ function getCanonicalizedValue(value) { let _didWarn = false; function warn(str) { - if (str.includes('ReactDOM.render is no longer supported')) { - return; - } _didWarn = true; } + +/** + * @param {import('react-dom/server')} serverRenderer + */ +async function renderToString(serverRenderer, element) { + let didError = false; + const stream = await serverRenderer.renderToReadableStream(element, { + onError(error) { + didError = true; + console.error(error); + }, + }); + await stream.allReady; + + if (didError) { + throw new Error('The above error occurred while rendering to string.'); + } + + const response = new Response(stream); + return response.text(); +} + const UNKNOWN_HTML_TAGS = new Set(['keygen', 'time', 'command']); -function getRenderedAttributeValue( +async function getRenderedAttributeValue( react, renderer, serverRenderer, @@ -283,12 +302,21 @@ function getRenderedAttributeValue( _didWarn = false; try { let container = createContainer(); - renderer.render(react.createElement(tagName, baseProps), container); + renderer.flushSync(() => { + renderer + .createRoot(container) + .render(react.createElement(tagName, baseProps)); + }); defaultValue = read(container.lastChild); canonicalDefaultValue = getCanonicalizedValue(defaultValue); container = createContainer(); - renderer.render(react.createElement(tagName, props), container); + + renderer.flushSync(() => { + renderer + .createRoot(container) + .render(react.createElement(tagName, props)); + }); result = read(container.lastChild); canonicalResult = getCanonicalizedValue(result); didWarn = _didWarn; @@ -305,19 +333,22 @@ function getRenderedAttributeValue( try { let container; if (containerTagName === 'document') { - const html = serverRenderer.renderToString( + const html = await renderToString( + serverRenderer, react.createElement(tagName, props) ); container = createContainer(); container.innerHTML = html; } else if (containerTagName === 'head') { - const html = serverRenderer.renderToString( + const html = await renderToString( + serverRenderer, react.createElement(tagName, props) ); container = createContainer(); container.innerHTML = html; } else { - const html = serverRenderer.renderToString( + const html = await renderToString( + serverRenderer, react.createElement( containerTagName, null, @@ -326,7 +357,8 @@ function getRenderedAttributeValue( ); const outerContainer = document.createElement('div'); outerContainer.innerHTML = html; - container = outerContainer.firstChild; + // Float may prepend `` + container = outerContainer.lastChild; } if ( @@ -396,8 +428,8 @@ function getRenderedAttributeValue( }; } -function prepareState(initGlobals) { - function getRenderedAttributeValues(attribute, type) { +async function prepareState(initGlobals) { + async function getRenderedAttributeValues(attribute, type) { const { ReactStable, ReactDOMStable, @@ -406,14 +438,14 @@ function prepareState(initGlobals) { ReactDOMNext, ReactDOMServerNext, } = initGlobals(attribute, type); - const reactStableValue = getRenderedAttributeValue( + const reactStableValue = await getRenderedAttributeValue( ReactStable, ReactDOMStable, ReactDOMServerStable, attribute, type ); - const reactNextValue = getRenderedAttributeValue( + const reactNextValue = await getRenderedAttributeValue( ReactNext, ReactDOMNext, ReactDOMServerNext, @@ -451,7 +483,7 @@ function prepareState(initGlobals) { let hasSameBehaviorForAll = true; let rowPatternHash = ''; for (let type of types) { - const result = getRenderedAttributeValues(attribute, type); + const result = await getRenderedAttributeValues(attribute, type); results.set(type.name, result); if (!result.hasSameBehavior) { hasSameBehaviorForAll = false; @@ -772,10 +804,10 @@ class App extends React.Component { ReactDOMStable: 'https://unpkg.com/react-dom@latest/umd/react-dom.development.js', ReactDOMServerStable: - 'https://unpkg.com/react-dom@latest/umd/react-dom-server-legacy.browser.development.js', + 'https://unpkg.com/react-dom@latest/umd/react-dom-server.browser.development.js', ReactNext: '/react.development.js', ReactDOMNext: '/react-dom.development.js', - ReactDOMServerNext: '/react-dom-server-legacy.browser.development.js', + ReactDOMServerNext: '/react-dom-server.browser.development.js', }; const codePromises = Object.values(sources).map(src => fetch(src).then(res => res.text()) @@ -820,7 +852,7 @@ class App extends React.Component { return globals; } - const {table, rowPatternHashes} = prepareState(initGlobals); + const {table, rowPatternHashes} = await prepareState(initGlobals); document.title = 'Ready'; this.setState({ From c9b859ade4d22aa103bb2f07a1117ebcec917e48 Mon Sep 17 00:00:00 2001 From: eps1lon Date: Sun, 17 Jul 2022 18:17:47 +0200 Subject: [PATCH 3/6] Test `aria-hidden` --- .../AttributeTableSnapshot.md | 25 +++++++++++++++++++ fixtures/attribute-behavior/src/attributes.js | 1 + 2 files changed, 26 insertions(+) diff --git a/fixtures/attribute-behavior/AttributeTableSnapshot.md b/fixtures/attribute-behavior/AttributeTableSnapshot.md index d69d96564f907..e474971cad57f 100644 --- a/fixtures/attribute-behavior/AttributeTableSnapshot.md +++ b/fixtures/attribute-behavior/AttributeTableSnapshot.md @@ -648,6 +648,31 @@ | `aria-=(null)`| (initial, warning)| `` | | `aria-=(undefined)`| (initial, warning)| `` | +## `aria-hidden` (on `
` inside `
`) +| Test Case | Flags | Result | +| --- | --- | --- | +| `aria-hidden=(string)`| (changed)| `"a string"` | +| `aria-hidden=(empty string)`| (changed)| `` | +| `aria-hidden=(array with string)`| (changed)| `"string"` | +| `aria-hidden=(empty array)`| (changed)| `` | +| `aria-hidden=(object)`| (changed)| `"result of toString()"` | +| `aria-hidden=(numeric string)`| (changed)| `"42"` | +| `aria-hidden=(-1)`| (changed)| `"-1"` | +| `aria-hidden=(0)`| (changed)| `"0"` | +| `aria-hidden=(integer)`| (changed)| `"1"` | +| `aria-hidden=(NaN)`| (changed)| `"NaN"` | +| `aria-hidden=(float)`| (changed)| `"99.99"` | +| `aria-hidden=(true)`| (changed)| `"true"` | +| `aria-hidden=(false)`| (changed)| `"false"` | +| `aria-hidden=(string 'true')`| (changed)| `"true"` | +| `aria-hidden=(string 'false')`| (changed)| `"false"` | +| `aria-hidden=(string 'on')`| (changed)| `"on"` | +| `aria-hidden=(string 'off')`| (changed)| `"off"` | +| `aria-hidden=(symbol)`| (initial)| `` | +| `aria-hidden=(function)`| (initial)| `` | +| `aria-hidden=(null)`| (initial)| `` | +| `aria-hidden=(undefined)`| (initial)| `` | + ## `aria-invalidattribute` (on `
` inside `
`) | Test Case | Flags | Result | | --- | --- | --- | diff --git a/fixtures/attribute-behavior/src/attributes.js b/fixtures/attribute-behavior/src/attributes.js index afd902d61d4c3..652f30ed072a9 100644 --- a/fixtures/attribute-behavior/src/attributes.js +++ b/fixtures/attribute-behavior/src/attributes.js @@ -119,6 +119,7 @@ const attributes = [ }, {name: 'aria', read: getAttribute('aria')}, {name: 'aria-', read: getAttribute('aria-')}, + {name: 'aria-hidden', read: getProperty('ariaHidden')}, {name: 'aria-invalidattribute', read: getAttribute('aria-invalidattribute')}, {name: 'as', tagName: 'link'}, { From 1aba5a257f6fbf579066d0475a0eb388716dfe7e Mon Sep 17 00:00:00 2001 From: eps1lon Date: Sun, 17 Jul 2022 17:59:16 +0200 Subject: [PATCH 4/6] Test `inputMode` with defined value --- .../AttributeTableSnapshot.md | 42 +++++++++---------- fixtures/attribute-behavior/src/attributes.js | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/fixtures/attribute-behavior/AttributeTableSnapshot.md b/fixtures/attribute-behavior/AttributeTableSnapshot.md index e474971cad57f..085d67d34f134 100644 --- a/fixtures/attribute-behavior/AttributeTableSnapshot.md +++ b/fixtures/attribute-behavior/AttributeTableSnapshot.md @@ -5526,27 +5526,27 @@ ## `inputMode` (on `` inside `
`) | Test Case | Flags | Result | | --- | --- | --- | -| `inputMode=(string)`| (changed)| `"a string"` | -| `inputMode=(empty string)`| (changed)| `` | -| `inputMode=(array with string)`| (changed)| `"string"` | -| `inputMode=(empty array)`| (changed)| `` | -| `inputMode=(object)`| (changed)| `"result of toString()"` | -| `inputMode=(numeric string)`| (changed)| `"42"` | -| `inputMode=(-1)`| (changed)| `"-1"` | -| `inputMode=(0)`| (changed)| `"0"` | -| `inputMode=(integer)`| (changed)| `"1"` | -| `inputMode=(NaN)`| (changed, warning)| `"NaN"` | -| `inputMode=(float)`| (changed)| `"99.99"` | -| `inputMode=(true)`| (initial, warning)| `` | -| `inputMode=(false)`| (initial, warning)| `` | -| `inputMode=(string 'true')`| (changed)| `"true"` | -| `inputMode=(string 'false')`| (changed)| `"false"` | -| `inputMode=(string 'on')`| (changed)| `"on"` | -| `inputMode=(string 'off')`| (changed)| `"off"` | -| `inputMode=(symbol)`| (initial, warning)| `` | -| `inputMode=(function)`| (initial, warning)| `` | -| `inputMode=(null)`| (initial)| `` | -| `inputMode=(undefined)`| (initial)| `` | +| `inputMode=(string)`| (initial)| `` | +| `inputMode=(empty string)`| (initial)| `` | +| `inputMode=(array with string)`| (initial)| `` | +| `inputMode=(empty array)`| (initial)| `` | +| `inputMode=(object)`| (initial)| `` | +| `inputMode=(numeric string)`| (initial)| `` | +| `inputMode=(-1)`| (initial)| `` | +| `inputMode=(0)`| (initial)| `` | +| `inputMode=(integer)`| (initial)| `` | +| `inputMode=(NaN)`| (initial, warning)| `` | +| `inputMode=(float)`| (initial)| `` | +| `inputMode=(true)`| (initial, warning)| `` | +| `inputMode=(false)`| (initial, warning)| `` | +| `inputMode=(string 'true')`| (initial)| `` | +| `inputMode=(string 'false')`| (initial)| `` | +| `inputMode=(string 'on')`| (initial)| `` | +| `inputMode=(string 'off')`| (initial)| `` | +| `inputMode=(symbol)`| (initial, warning)| `` | +| `inputMode=(function)`| (initial, warning)| `` | +| `inputMode=(null)`| (initial)| `` | +| `inputMode=(undefined)`| (initial)| `` | ## `integrity` (on `