|
1 | 1 | # 3.0.0 |
2 | 2 |
|
3 | | -### New |
| 3 | +## New |
4 | 4 |
|
5 | 5 | - React 18 support |
6 | 6 | - List of implemented features is here: https://github.com/japgolly/scalajs-react/issues/1057 |
|
27 | 27 |
|
28 | 28 | - `Renderable` typeclass for anything that React can render |
29 | 29 |
|
30 | | -### Other Changes |
| 30 | +## Other Changes |
31 | 31 |
|
32 | 32 | - Allow calling `useCallback*` with sync functions that return a value. |
33 | 33 |
|
|
41 | 41 | - `TriStateCheckbox` no longer uses `Reusability.shouldComponentUpdate`, therefore |
42 | 42 | the fourth argument to its props is no longer wrapped in `Reusable`. |
43 | 43 |
|
44 | | -### Deprecated |
| 44 | +## Deprecated |
45 | 45 |
|
46 | 46 | - Anything deprecated by React 18 is now deprecated in Scala |
47 | 47 |
|
|
51 | 51 |
|
52 | 52 | - `ReactTestUtils` is now `LegacyReactTestUtils` and deprecated |
53 | 53 |
|
54 | | -### Upgrades |
| 54 | +## Upgrades |
55 | 55 |
|
56 | 56 | - Cats 2.13.0 |
57 | 57 | - CatsEffect 3.6.3 |
|
62 | 62 | - ScalaJsDom 2.8.1 |
63 | 63 | - Sourcecode 0.4.4 |
64 | 64 |
|
65 | | -### Migration |
| 65 | +## Migration |
66 | 66 |
|
67 | | -- Run this to switch from `{ => Legacy}ReactTestUtils`, and if you were on the betas `ReactTestUtils{2 => }`: |
| 67 | +### `jsDependencies` |
68 | 68 |
|
69 | | - ```sh |
70 | | - find . -type f -name '*.scala' -exec perl -pi -e ' |
71 | | - s/\bReactTestUtils\b/LegacyReactTestUtils/g; |
72 | | - s/\bReactTestUtils2\b/ReactTestUtils/g; |
73 | | - ' {} + |
74 | | - ``` |
| 69 | +To upgrade when using `jsDependencies`, make your sbt config look like this (comments for clarity) |
75 | 70 |
|
76 | | -- To upgrade when using `jsDependencies`, make your sbt config look like this (comments for clarity) |
| 71 | +```scala |
| 72 | +// Required for React 18.3.1 |
| 73 | +dependencyOverrides += "org.webjars.npm" % "scheduler" % "0.22.0", |
77 | 74 |
|
78 | | - ```scala |
79 | | - // Required for React 18.0.0 |
80 | | - dependencyOverrides += "org.webjars.npm" % "scheduler" % "0.22.0", |
81 | | -
|
82 | | - jsDependencies ++= Seq( |
83 | | -
|
84 | | - // Polyfill required for React 18.0.0 |
85 | | - "org.webjars.npm" % "fast-text-encoding" % "1.0.3" / "text.js" minified "text.min.js" |
86 | | -
|
87 | | - "org.webjars.npm" % "react" % "18.0.0" |
88 | | - / "umd/react.development.js" |
89 | | - minified "umd/react.production.min.js" |
90 | | - dependsOn "text.js" // <-- Load the fast-text-encoding polyfill before loading React itself |
91 | | - commonJSName "React", |
92 | | -
|
93 | | - "org.webjars.npm" % "react-dom" % "18.0.0" |
94 | | - / "umd/react-dom.development.js" |
95 | | - minified "umd/react-dom.production.min.js" |
96 | | - dependsOn "umd/react.development.js" |
97 | | - commonJSName "ReactDOM", |
98 | | -
|
99 | | - "org.webjars.npm" % "react-dom" % "18.0.0" |
100 | | - / "umd/react-dom-server.browser.development.js" |
101 | | - minified "umd/react-dom-server.browser.production.min.js" |
102 | | - dependsOn "umd/react-dom.development.js" |
103 | | - commonJSName "ReactDOMServer", |
104 | | - ), |
105 | | - ``` |
| 75 | +jsDependencies ++= Seq( |
| 76 | + |
| 77 | + // Polyfill required for React 18.3.1 |
| 78 | + "org.webjars.npm" % "fast-text-encoding" % "1.0.6" / "1.0.6/text.min.js" minified "text.min.js" |
| 79 | + |
| 80 | + "org.webjars.npm" % "react" % "18.3.1" |
| 81 | + / "umd/react.development.js" |
| 82 | + minified "umd/react.production.min.js" |
| 83 | + dependsOn "text.js" // <-- Load the fast-text-encoding polyfill before loading React itself |
| 84 | + commonJSName "React", |
| 85 | + |
| 86 | + "org.webjars.npm" % "react-dom" % "18.3.1" |
| 87 | + / "umd/react-dom.development.js" |
| 88 | + minified "umd/react-dom.production.min.js" |
| 89 | + dependsOn "umd/react.development.js" |
| 90 | + commonJSName "ReactDOM", |
| 91 | + |
| 92 | + "org.webjars.npm" % "react-dom" % "18.3.1" |
| 93 | + / "umd/react-dom-server.browser.development.js" |
| 94 | + minified "umd/react-dom-server.browser.production.min.js" |
| 95 | + dependsOn "umd/react-dom.development.js" |
| 96 | + commonJSName "ReactDOMServer", |
| 97 | +), |
| 98 | +``` |
| 99 | + |
| 100 | +### `ReactTestUtils` |
| 101 | + |
| 102 | +Run this to switch from `{ => Legacy}ReactTestUtils`, and if you were on the betas `ReactTestUtils{2 => }`: |
| 103 | + |
| 104 | +```sh |
| 105 | +find . -type f -name '*.scala' -exec perl -pi -e ' |
| 106 | + s/\bReactTestUtils\b/LegacyReactTestUtils/g; |
| 107 | + s/\bReactTestUtils2\b/ReactTestUtils/g; |
| 108 | +' {} + |
| 109 | +``` |
0 commit comments