mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
640ccebb7d9669f1efbd20e86f6f84086c3d698d
16105 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
640ccebb7d |
[lint] treat React.use() the same as use() (#27769)
We should probably treat `React.use()` the same as `use()` to allow it within loops and conditionals. Ideally this would implement a test that `React` is imported or required from `'react'`, but we don't otherwise implement such a test. |
||
|
|
d7b45ec9b7 |
Bump @adobe/css-tools from 4.0.1 to 4.3.2 in /fixtures/flight (#27766)
Bumps [@adobe/css-tools](https://github.com/adobe/css-tools) from 4.0.1 to 4.3.2. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/adobe/css-tools/blob/main/History.md"><code>@adobe/css-tools</code>'s changelog</a>.</em></p> <blockquote> <h1>4.3.2 / 2023-11-28</h1> <ul> <li>Fix redos vulnerability with specific crafted css string - CVE-2023-48631</li> <li>Fix Problem parsing with :is() and nested :nth-child() <a href="https://redirect.github.com/adobe/css-tools/issues/211">#211</a></li> </ul> <h1>4.3.1 / 2023-03-14</h1> <ul> <li>Fix redos vulnerability with specific crafted css string - CVE-2023-26364</li> </ul> <h1>4.3.0 / 2023-03-07</h1> <ul> <li>Update build tools</li> <li>Update exports path and files</li> </ul> <h1>4.2.0 / 2023-02-21</h1> <ul> <li>Add <a href="https://github.com/container"><code>@container</code></a> support</li> <li>Add <a href="https://github.com/layer"><code>@layer</code></a> support</li> </ul> <h1>4.1.0 / 2023-01-25</h1> <ul> <li>Support ESM Modules</li> </ul> <h1>4.0.2 / 2023-01-12</h1> <ul> <li><a href="https://redirect.github.com/adobe/css-tools/issues/71">#71</a> : <a href="https://github.com/import"><code>@import</code></a> does not work if url contains ';'</li> <li><a href="https://redirect.github.com/adobe/css-tools/issues/77">#77</a> : Regression in selector parsing: Attribute selectors not parsed correctly</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/adobe/css-tools/commits">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/facebook/react/network/alerts). </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
108fd8cab0 |
Add sideEffects flag to react-is for tree shaking (#27701)
## Summary This PR: - Adds the `"sideEffects": false` flag to the `react-is` package, to enable proper tree-shaking ## How did you test this change? React-Redux v9 beta switches its artifacts from separate JS files to pre-bundled artifacts. While testing builds locally, I noticed that our use of `react-is` was no longer getting tree-shaken from Vite builds, despite `react-is` only being used by our `connect` API and `connect` itself getting shaken out of the final bundle. Hand-adding `"sideEffects": false` to the `react-is` package locally convinced Vite (+Rollup) to properly tree-shake `react-is` out of the bundle when it wasn't being used. I'd love to see this published as v18.2.1 as soon as this PR is merged - we're hoping to release React-Redux v9 in the next few weeks! |
||
|
|
dc40571b3e |
Update .prettierrc.js (#27732)
jsxBracketSameLine deprecated in v2.4.0 of Prettier, replaced by
bracketSameLine.
https://prettier.io/docs/en/options.html#deprecated-jsx-brackets
<!--
Thanks for submitting a pull request!
We appreciate you spending the time to work on these changes. Please
provide enough information so that others can review your pull request.
The three fields below are mandatory.
Before submitting a pull request, please make sure the following is
done:
1. Fork [the repository](https://github.com/facebook/react) and create
your branch from `main`.
2. Run `yarn` in the repository root.
3. If you've fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch
TestName` is helpful in development.
5. Run `yarn test --prod` to test in the production environment. It
supports the same options as `yarn test`.
6. If you need a debugger, run `yarn test --debug --watch TestName`,
open `chrome://inspect`, and press "Inspect".
7. Format your code with
[prettier](https://github.com/prettier/prettier) (`yarn prettier`).
8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only
check changed files.
9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
10. If you haven't already, complete the CLA.
Learn more about contributing:
https://reactjs.org/docs/how-to-contribute.html
-->
## Summary
<!--
Explain the **motivation** for making this change. What existing problem
does the pull request solve?
-->
I've always wanted to contribute to open source, even if it's in the
smallest way possible. Resolves deprecated feature with currently used
version of Prettier (2.4+). Those doing things like using React as a
reference for their ".prettierrc" files will be using the non-deprecated
versions.
## How did you test this change?
Modified line 969 of App.js to push </h1> to line 971, saved the file,
then ran "yarn prettier" and formatting returned it to original position
confirming that jsxBracketSameLine acts in the same fashion to
bracketSameLine, but also is no longer deprecated that has additional
features which may be useful in the future to the project.
<!--
Demonstrate the code is solid. Example: The exact commands you ran and
their output, screenshots / videos if the pull request changes the user
interface.
How exactly did you verify that your PR solves the issue you wanted to
solve?
If you leave this empty, your PR will very likely be closed.
-->
λ yarn prettier
yarn run v1.22.19
$ node ./scripts/prettier/index.js write-changed
> git merge-base HEAD main
> git diff --name-only --diff-filter=ACMRTUB
|
||
|
|
5dd35968be |
fix: select console error to not suggest to set readonly to true (#27740)
fix #27657 added test in the `ReactDOMSELECT-test.js` to not allow regession to happen in future. After changes this is what the error message looks like https://github.com/facebook/react/assets/72331432/53dcbe2a-70d2-43d2-a52d-a4fc389fdfbf |
||
|
|
3e97c00deb |
Rename fork ReactSharedInternals -> ReactSharedInternalsClient (#27767)
## Summary Follow up from #27717 based on feedback to rename the fork module itself ## How did you test this change? - `yarn build` - `yarn test packages/scheduler/src/__tests__/SchedulerUMDBundle-test.internal.js` Co-authored-by: Jack Pope <jackpope@meta.com> |
||
|
|
b8be034f07 |
[lint] move use lint to non-experimental (#27768)
`use` is being stabilized, so let's make sure the lint is updated for the next release. |
||
|
|
60ad3693a5 |
Update README.md with react.dev links (#27765)
## Summary Update legacy reactjs.org links and update to the corresponding ones on react.dev ## How did you test this change? Verify all links go to the expected pages |
||
|
|
87cb0bf182 |
React DevTools 4.28.5 -> 5.0.0 (#27759)
### Breaking * refactor[devtools]: highlight an array of elements for native ([hoxyq](https://github.com/hoxyq) in [#27734](https://github.com/facebook/react/pull/27734)) ### Features * feat[devtools]: display Forget badge for the relevant components ([hoxyq](https://github.com/hoxyq) in [#27709](https://github.com/facebook/react/pull/27709)) ### Other * Added windows powershell syntax to build scripts ([PrathamLalwani](https://github.com/PrathamLalwani) in [#27692](https://github.com/facebook/react/pull/27692)) * refactor[react-devtools-shared]: minor parsing improvements and modifications ([hoxyq](https://github.com/hoxyq) in [#27661](https://github.com/facebook/react/pull/27661)) |
||
|
|
c17a27ef49 |
FB-specific builds of Flight Server, Flight Client, and React Shared Subset (#27579)
This PR adds a new FB-specific configuration of Flight. We also need to bundle a version of ReactSharedSubset that will be used for running Flight on the server. This initial implementation does not support server actions yet. The FB-Flight still uses the text protocol on the server (the flag `enableBinaryFlight` is set to false). It looks like we need some changes in Hermes to properly support this binary format. |
||
|
|
6c7b41da3d |
feat[devtools]: display Forget badge for the relevant components (#27709)
Adds `Forget` badge to all relevant components. Changes: - If component is compiled with Forget and using a built-in `useMemoCache` hook, it will have a `Forget` badge next to its display name in: - components tree - inspected element view - owners list - Such badges are indexable, so Forget components can be searched using search bar. Fixes: - Displaying the badges for owners list inside the inspected component view Implementation: - React DevTools backend is responsible for identifying if component is compiled with Forget, based on `fiber.updateQueue.memoCache`. It will wrap component's display name with `Forget(...)` prefix before passing operations to the frontend. On the frontend side, we will parse the display name and strip Forget prefix, marking the corresponding element by setting `compiledWithForget` field. Almost the same logic is currently used for HOC display names. |
||
|
|
fbc9b68d61 |
refactor[devtools]: highlight an array of elements for native (#27734)
We are currently just pass the first element, which diverges from the implementation for web. This is especially bad if you are inspecting something like a list, where host fiber can represent multiple elements. This part runs on the backend of React DevTools, so it should not affect cases for React Native when frontend version can be more up-to-date than backend's. I will double-check it before merging. Once version of `react-devtools-core` is updated in React Native, this should be supported, I will work on that later. |
||
|
|
a3172e933c |
Add dynamic disableModulePatternComponents flag for native-fb (#27739)
Makes `disableModulePatternComponents` a flag to allow us a slow rollout for RN internally. |
||
|
|
bbb9cb116d |
Update fork for ReactSharedInternalsClient export (#27717)
## Summary After changes in https://github.com/facebook/react/pull/27436, UMD builds no longer expose Scheduler from ReactSharedInternals. This module is forked in rollup for UMD builds and the path no longer matches. This PR updates the path name to match the new module: ReactSharedInternalsClient. ## How did you test this change? - `yarn build` - Inspect `react.development.js` UMD build, observe `Scheduler: Scheduler` is set in `ReactSharedInternals`, matching [18.2.0](https://unpkg.com/react@18.2.0/umd/react.development.js) - ran attribute-behavior fixture app - Observe no more error `Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'unstable_cancelCallback')` Co-authored-by: Jack Pope <jackpope@meta.com> |
||
|
|
1a65d036ef |
[cleanup] remove enableHostSingletons feature flag (#27583)
The flag is enabled everywhere, I think we can remove it now. |
||
|
|
0de5b11485 |
Bump @babel/traverse from 7.14.2 to 7.23.3 in /fixtures/ssr2 (#27713)
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.14.2 to 7.23.3. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/babel/babel/releases"><code>@babel/traverse</code>'s releases</a>.</em></p> <blockquote> <h2>v7.23.3 (2023-11-09)</h2> <h4>🐛 Bug Fix</h4> <ul> <li><code>babel-plugin-transform-typescript</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/16071">#16071</a> Strip type-only TS namespaces (<a href="https://github.com/colinaaa"><code>@colinaaa</code></a>)</li> </ul> </li> <li><code>babel-generator</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/16078">#16078</a> Fix indentation when generating comments with <code>concise: true</code> (<a href="https://github.com/liuxingbaoyu"><code>@liuxingbaoyu</code></a>)</li> </ul> </li> <li><code>babel-compat-data</code>, <code>babel-plugin-bugfix-v8-static-class-fields-redefine-readonly</code>, <code>babel-preset-env</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/14295">#14295</a> Add a bugfix plugin for <a href="https://crbug.com/v8/12421">https://crbug.com/v8/12421</a> (<a href="https://github.com/nicolo-ribaudo"><code>@nicolo-ribaudo</code></a>)</li> </ul> </li> <li><code>babel-plugin-transform-object-super</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/15948">#15948</a> fix: <code>super.x</code> in a loop (<a href="https://github.com/liuxingbaoyu"><code>@liuxingbaoyu</code></a>)</li> </ul> </li> <li><code>babel-helper-module-transforms</code>, <code>babel-plugin-transform-modules-amd</code>, <code>babel-plugin-transform-modules-commonjs</code>, <code>babel-plugin-transform-modules-umd</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/16015">#16015</a> fix: handle <code>__proto__</code> exports name in CJS/AMD/UMD (<a href="https://github.com/magic-akari"><code>@magic-akari</code></a>)</li> </ul> </li> </ul> <h4>📝 Documentation</h4> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/16044">#16044</a> docs: Update links in <code>@babel/eslint-parser</code> README (<a href="https://github.com/aryehb"><code>@aryehb</code></a>)</li> </ul> <h4>🏠 Internal</h4> <ul> <li><code>babel-core</code>, <code>babel-preset-env</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/15988">#15988</a> Refactor handling of modules plugins in <code>preset-env</code> (<a href="https://github.com/nicolo-ribaudo"><code>@nicolo-ribaudo</code></a>)</li> </ul> </li> </ul> <h4>🏃♀️ Performance</h4> <ul> <li><code>babel-generator</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/16061">#16061</a> perf: Improve <code>@babel/generator</code> performance (<a href="https://github.com/liuxingbaoyu"><code>@liuxingbaoyu</code></a>)</li> </ul> </li> <li><code>babel-traverse</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/16060">#16060</a> Avoid dynamic dispatch when calling wrapCheck (<a href="https://github.com/yepitschunked"><code>@yepitschunked</code></a>)</li> </ul> </li> </ul> <h4>🔬 Output optimization</h4> <ul> <li><code>babel-plugin-transform-computed-properties</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/6652">#6652</a> Optimize computed properties output (byte-wise) (<a href="https://github.com/Andarist"><code>@Andarist</code></a>)</li> </ul> </li> </ul> <h4>Committers: 9</h4> <ul> <li>Babel Bot (<a href="https://github.com/babel-bot"><code>@babel-bot</code></a>)</li> <li>Colin (<a href="https://github.com/colinaaa"><code>@colinaaa</code></a>)</li> <li>Huáng Jùnliàng (<a href="https://github.com/JLHwung"><code>@JLHwung</code></a>)</li> <li>Mateusz Burzyński (<a href="https://github.com/Andarist"><code>@Andarist</code></a>)</li> <li>Nicolò Ribaudo (<a href="https://github.com/nicolo-ribaudo"><code>@nicolo-ribaudo</code></a>)</li> <li><a href="https://github.com/aryehb"><code>@aryehb</code></a></li> <li><a href="https://github.com/liuxingbaoyu"><code>@liuxingbaoyu</code></a></li> <li><a href="https://github.com/magic-akari"><code>@magic-akari</code></a></li> <li><a href="https://github.com/yepitschunked"><code>@yepitschunked</code></a></li> </ul> <h2>v7.23.2 (2023-10-11)</h2> <p><strong>NOTE</strong>: This release also re-publishes <code>@babel/core</code>, even if it does not appear in the linked release commit.</p> <p>Thanks <a href="https://github.com/jimmydief"><code>@jimmydief</code></a> for your first PR!</p> <h4>🐛 Bug Fix</h4> <ul> <li><code>babel-traverse</code></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/babel/babel/blob/main/CHANGELOG.md"><code>@babel/traverse</code>'s changelog</a>.</em></p> <blockquote> <h2>v7.23.3 (2023-11-09)</h2> <h4>🐛 Bug Fix</h4> <ul> <li><code>babel-plugin-transform-typescript</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/16071">#16071</a> Strip type-only TS namespaces (<a href="https://github.com/colinaaa"><code>@colinaaa</code></a>)</li> </ul> </li> <li><code>babel-generator</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/16078">#16078</a> Fix indentation when generating comments with <code>concise: true</code> (<a href="https://github.com/liuxingbaoyu"><code>@liuxingbaoyu</code></a>)</li> </ul> </li> <li><code>babel-compat-data</code>, <code>babel-plugin-bugfix-v8-static-class-fields-redefine-readonly</code>, <code>babel-preset-env</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/14295">#14295</a> Add a bugfix plugin for <a href="https://crbug.com/v8/12421">https://crbug.com/v8/12421</a> (<a href="https://github.com/nicolo-ribaudo"><code>@nicolo-ribaudo</code></a>)</li> </ul> </li> <li><code>babel-plugin-transform-object-super</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/15948">#15948</a> fix: <code>super.x</code> in a loop (<a href="https://github.com/liuxingbaoyu"><code>@liuxingbaoyu</code></a>)</li> </ul> </li> <li><code>babel-helper-module-transforms</code>, <code>babel-plugin-transform-modules-amd</code>, <code>babel-plugin-transform-modules-commonjs</code>, <code>babel-plugin-transform-modules-umd</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/16015">#16015</a> fix: handle <code>__proto__</code> exports name in CJS/AMD/UMD (<a href="https://github.com/magic-akari"><code>@magic-akari</code></a>)</li> </ul> </li> </ul> <h4>📝 Documentation</h4> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/16044">#16044</a> docs: Update links in <code>@babel/eslint-parser</code> README (<a href="https://github.com/aryehb"><code>@aryehb</code></a>)</li> </ul> <h4>🏠 Internal</h4> <ul> <li><code>babel-core</code>, <code>babel-preset-env</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/15988">#15988</a> Refactor handling of modules plugins in <code>preset-env</code> (<a href="https://github.com/nicolo-ribaudo"><code>@nicolo-ribaudo</code></a>)</li> </ul> </li> </ul> <h4>🏃♀️ Performance</h4> <ul> <li><code>babel-generator</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/16061">#16061</a> perf: Improve <code>@babel/generator</code> performance (<a href="https://github.com/liuxingbaoyu"><code>@liuxingbaoyu</code></a>)</li> </ul> </li> <li><code>babel-traverse</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/16060">#16060</a> Avoid dynamic dispatch when calling wrapCheck (<a href="https://github.com/yepitschunked"><code>@yepitschunked</code></a>)</li> </ul> </li> </ul> <h4>🔬 Output optimization</h4> <ul> <li><code>babel-plugin-transform-computed-properties</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/6652">#6652</a> Optimize computed properties output (byte-wise) (<a href="https://github.com/Andarist"><code>@Andarist</code></a>)</li> </ul> </li> </ul> <h2>v7.23.2 (2023-10-11)</h2> <h4>🐛 Bug Fix</h4> <ul> <li><code>babel-traverse</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/16033">#16033</a> Only evaluate own String/Number/Math methods (<a href="https://github.com/nicolo-ribaudo"><code>@nicolo-ribaudo</code></a>)</li> </ul> </li> <li><code>babel-preset-typescript</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/16022">#16022</a> Rewrite <code>.tsx</code> extension when using <code>rewriteImportExtensions</code> (<a href="https://github.com/jimmydief"><code>@jimmydief</code></a>)</li> </ul> </li> <li><code>babel-helpers</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/16017">#16017</a> Fix: fallback to typeof when toString is applied to incompatible object (<a href="https://github.com/JLHwung"><code>@JLHwung</code></a>)</li> </ul> </li> <li><code>babel-helpers</code>, <code>babel-plugin-transform-modules-commonjs</code>, <code>babel-runtime-corejs2</code>, <code>babel-runtime-corejs3</code>, <code>babel-runtime</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/16025">#16025</a> Avoid override mistake in namespace imports (<a href="https://github.com/nicolo-ribaudo"><code>@nicolo-ribaudo</code></a>)</li> </ul> </li> </ul> <h2>v7.23.0 (2023-09-25)</h2> <h4>🚀 New Feature</h4> <ul> <li><code>babel-plugin-proposal-import-wasm-source</code>, <code>babel-plugin-syntax-import-source</code>, <code>babel-plugin-transform-dynamic-import</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/15870">#15870</a> Support transforming <code>import source</code> for wasm (<a href="https://github.com/nicolo-ribaudo"><code>@nicolo-ribaudo</code></a>)</li> </ul> </li> <li><code>babel-helper-module-transforms</code>, <code>babel-helpers</code>, <code>babel-plugin-proposal-import-defer</code>, <code>babel-plugin-syntax-import-defer</code>, <code>babel-plugin-transform-modules-commonjs</code>, <code>babel-runtime-corejs2</code>, <code>babel-runtime-corejs3</code>, <code>babel-runtime</code>, <code>babel-standalone</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/15878">#15878</a> Implement <code>import defer</code> proposal transform support (<a href="https://github.com/nicolo-ribaudo"><code>@nicolo-ribaudo</code></a>)</li> </ul> </li> <li><code>babel-generator</code>, <code>babel-parser</code>, <code>babel-types</code> <ul> <li><a href="https://redirect.github.com/babel/babel/pull/15845">#15845</a> Implement <code>import defer</code> parsing support (<a href="https://github.com/nicolo-ribaudo"><code>@nicolo-ribaudo</code></a>)</li> </ul> </li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
||
|
|
2c338b16fd |
Added windows powershell syntax to build scripts (#27692)
## Summary I had to change the commands to be windows specific so that it doesn't cause any crashes ## How did you test this change? I successfully built the different types of devtools extenstions on my personal computer. In future may need to add a github action with windows config to test these errors #27193 |
||
|
|
ee68446ff1 |
[Fizz] handle errors in onHeaders (#27712)
`onHeaders` can throw however for now we can assume that headers are optimistic values since the only things we produce for them are preload links. This is a pragmatic decision because React could concievably have headers in the future which were not optimistic and thus non-optional however it is hard to imagine what these headers might be in practice. If we need to change this behavior to be fatal in the future it would be a breaking change. This commit adds error logging when `onHeaders` throws and ensures the request can continue to render successfully. |
||
|
|
aec521a96d |
fix[devtools/useMemoCache]: implement a working copy of useMemoCache (#27659)
In https://github.com/facebook/react/pull/27472 I've removed broken `useMemoCache` implementation and replaced it with a stub. It actually produces errors when trying to inspect components, which are compiled with Forget. The main difference from the implementation in https://github.com/facebook/react/pull/26696 is that we are using corresponding `Fiber` here, which has patched `updateQueue` with `memoCache`. Previously we would check it on a hook object, which doesn't have `updateQueue`. Tested on pages, which are using Forget and by inspecting elements, which are transpiled with Forget. |
||
|
|
593ecee66a |
Add a feature flag to enable expiration of retry lanes (#27694)
An attempt to see if we can bring back expiration of retry lanes to avoid cases resolving Suspense can be starved by frequent updates. In the past, this caused increase browser crashes, but a lot of time has passed since then. Just trying if we can re-enable this. Old PR that reverted adding the timeout: https://github.com/facebook/react/pull/21300 |
||
|
|
07cc4a0002 |
[Flight] Bound server references should be able to be bound again (#27695)
Wasn't consistent. Probably should use a shared helper maybe. |
||
|
|
432b9f1d97 |
Upgrade Flow to 0.221.0 (#27689)
Upgrades Flow and dependencies ``` yarn add -W flow-bin flow-remove-types hermes-parser hermes-eslint ``` |
||
|
|
6b3834a45b |
Guard against unmounted components when accessing public instances on Fabric (#27687)
## Summary This fixes an error in `getPublicInstanceFromInstanceHandle` where we throw an error when trying to access the public instance from the fiber of an unmounted component. This shouldn't throw but return `null` instead. ## How did you test this change? Updated unit tests. Before: <img width="969" alt="Screenshot 2023-11-10 at 15 26 14" src="https://github.com/facebook/react/assets/117921/ea161616-2775-4fab-8d74-da4bef48d09a"> After: <img width="1148" alt="Screenshot 2023-11-10 at 15 28 37" src="https://github.com/facebook/react/assets/117921/db18b918-b6b6-4925-9cfc-3b4b2f3ab92d"> |
||
|
|
6a7f3aa858 |
[FeatureFlags] Enable useMemoCache for ReactTestRenderer (#27677)
## Summary
Forget compiled code currently cannot be tested with ReactTestRender as
`useMemoCache` is not being set on the dispatcher. This PR ensures that
projects can execute unit tests with Forget compilation in the test
build pipeline.
```js
// source code
function Component(props) {
// ...
}
// transformed code, which also should be evaluated in unit tests
function Component(props) {
const $ = useMemoCache(...);
// ...
}
```
This PR enables the `enableUseMemoCacheHook` feature flag for all bundle
variations of ReactTestRenderer. Forget *should* be the only caller of
useMemoCache, so this should be a reversible change (in the event we
need to change the implementation or api of the hook).
## How did you test this change?
* Check that generated ReactTestRenderer bundles contain `useMemoCache`.
* Synced to Meta and checked that unit tests that use Forget +
@testing-library/react pass.
I did not add new tests to check that useMemoCache can be called when
using the test renderer as `useMemoCache` is not yet stable. Happy to
add a test case here if that would be helpful to reviewers though (I'm
guessing that would go in
`packages/react-test-renderer/src/__tests__/ReactTestRenderer-test.js` )
|
||
|
|
c4c87e049b |
Small cleanup in ReactFiberCompleteWork (#27681)
These are all functionally equivalent changes. - remove double negation and more explicit naming of `hadNoMutationsEffects` - use docblock syntax that's consumed by Flow - remove useless cast |
||
|
|
0e352ea01c |
[Fizz] Fix for failing id overwrites for postpone (#27684)
When we postpone during a render we inject a new segment synchronously which we postpone. That gets assigned an ID so we can refer to it immediately in the postponed state. When we do that, the parent segment may complete later even though it's also synchronous. If that ends up not having any content in it, it'll inline into the child and that will override the child's segment id which is not correct since it was already assigned one. To fix this, we simply opt-out of the optimization in that case which is unfortunate because we'll generate many more unnecessary empty segments. So we should come up with a new strategy for segment id assignment but this fixes the bug. Co-authored-by: Josh Story <story@hey.com> |
||
|
|
78c71bc545 |
refactor[ci/build]: dont generate sourcemaps for BROWSER_SCRIPT bundles (#27665)
Instead of https://github.com/facebook/react/pull/27664, we can just
exclude `unstable_server-external-runtime.js` from having sourcemaps for
now.
We should consider removing manual copying of this artifact in
|
||
|
|
c47c306a7a |
refactor[ci/build]: preserve header format in artifacts (#27671)
In order to make Haste work with React's artifacts, It is important to
keep headers in this format:
```
/**
* ...
...
* ...
*/
```
For optimization purposes, Closure compiler will actually modify these
headers by removing * prefixes, which is expected.
We should pass sources to the compiler without license headers, with
these changes the current flow will be:
1. Apply top-level definitions. For UMD-bundles, for example, or
DEV-only bundles (e. g. `if (__DEV__) { ...`)
2. Apply licence headers for artifacts with sourcemaps: oss-production
and oss-profiling bundles, they don't need to preserve the header format
to comply with Haste. We need to apply these headers before passing
sources to Closure, so it can build correct mappings for sourcemaps.
3. Pass these sources to closure compiler for minification and
sourcemaps building.
4. Apply licence headers for artifacts without sourcemaps: dev bundles,
fb bundles. This way the header style will be preserved and not changed
by Closure.
|
||
|
|
7bdd7cc2d8 |
Upgrade Flow to 0.220.1 (#27680)
Upgrade Flow to latest using ``` yarn add -W flow-bin flow-remove-types hermes-parser hermes-eslint ``` This also updates `createFlowConfigs.js` to get the Flow version from `package.json` to avoid needing to bump the version there in the future. |
||
|
|
7468903294 |
[Static][Fizz] bootstrap scripts should only emit once (#27674)
I introduced a bug in a recent change to how bootstrap scripts are handled. Rather than clearing out the bootstrap script state from ResumableState on completion of the prerender I did it during the flushing phase which comes later after the postponed state has likely been serialized. We should freeze these objects in dev so this is not possible to do easily in test (nor in actual code in real systems). This fixes the bug by eliminating the bootstrap config during getPostponedState which is before the state can be serialized. |
||
|
|
7508dcd5cc |
[Static][Fizz] Carry forward bootstrap config to resume if postponing in the shell (#27672)
Previously it was possible to postpone in the shell during a prerender and then during a resume the bootstrap scripts would not be emitted leading to no hydration on the client. This change moves the bootstrap configuration to `ResumableState` where it can be serialized after postponing if it wasn't flushed as part of the static shell. |
||
|
|
88b00dec47 |
Update stack diffing algorithm in describeNativeComponentFrame (#27132)
## Summary
There's a bug with the existing stack comparison algorithm in
`describeNativeComponentFrame` — specifically how it attempts to find a
common root frame between the control and sample stacks. This PR
attempts to fix that bug by injecting a frame that can have a guaranteed
string in it for us to search for in both stacks to find a common root.
## Brief Background/How it works now
Right now `describeNativeComponentFrame` does the following to leverage
native browser/VM stack frames to get details (e.g. script path, row and
col #s) for a single component:
1. Throwing and catching a control error in the function
2. Calling the component which should eventually throw an error (most of
the time), that we'll catch as our sample error.
3. Diffing the stacks in the control and sample errors to find the line
which should represent our component call.
## What's broken
To account for potential stack trace truncation, the stack diffing
algorithm first attempts to find a common "root" frame by inspecting the
earliest frame of the sample stack and searching for an identical frame
in the control stack starting from the bottom. However, there are a
couple of scenarios which I've hit that cause the above approach to not
work correctly.
First, it's possible that for render passes of extremely large component
trees to have a lot of repeating internal react function calls, which
can result in an incorrect common or "root" frame found. Here's a small
example from a stack trace using React Fizz for SSR.
Our control frame can look like this:
```
Error:
at Fake (...)
at construct (native)
at describeNativeComponentFrame (...)
at describeClassComponentFrame (...)
at getStackByComponentStackNode (...)
at getCurrentStackInDEV (...)
at renderNodeDestructive (...)
at renderElement (...)
at renderNodeDestructiveImpl (...) // <-- Actual common root frame with the sample stack
at renderNodeDestructive (...)
at renderElement (...)
at renderNodeDestructiveImpl (...) // <-- Incorrectly chosen common root frame
at renderNodeDestructive (...)
```
And our sample stack can look like this:
```
Error:
at set (...)
at PureComponent (...)
at call (native)
at apply (native)
at ErrorBoundary (...)
at construct (native)
at describeNativeComponentFrame (...)
at describeClassComponentFrame (...)
at getStackByComponentStackNode (...)
at getCurrentStackInDEV (...)
at renderNodeDestructive (...)
at renderElement (...)
at renderNodeDestructiveImpl (...) // <-- Root frame that's common in the control stack
```
Here you can see that the earliest trace in the sample stack, the
`renderNodeDestructiveImpl` call, can exactly match with multiple
`renderNodeDestructiveImpl` calls in the control stack (including file
path and line + col #s). Currently the algorithm will chose the
earliest/last frame with the `renderNodeDestructiveImpl` call (which is
the second last frame in our control stack), which is incorrect. The
actual matching frame in the control stack is the latest or first frame
(when traversing from the top) with the `renderNodeDestructiveImpl`
call. This leads to the rest of the stack diffing associating an
incorrect frame (`at getStackByComponentStackNode (...)`) for the
component.
Another issue with this approach is that it assumes all VMs will
truncate stack traces at the *bottom*, [which isn't the case for the
Hermes
VM](
|
||
|
|
52d542ad6d |
Enable enableUnifiedSyncLane (#27646)
<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please provide enough information so that others can review your pull request. The three fields below are mandatory. Before submitting a pull request, please make sure the following is done: 1. Fork [the repository](https://github.com/facebook/react) and create your branch from `main`. 2. Run `yarn` in the repository root. 3. If you've fixed a bug or added code that should be tested, add tests! 4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development. 5. Run `yarn test --prod` to test in the production environment. It supports the same options as `yarn test`. 6. If you need a debugger, run `yarn test --debug --watch TestName`, open `chrome://inspect`, and press "Inspect". 7. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`). 8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files. 9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`). 10. If you haven't already, complete the CLA. Learn more about contributing: https://reactjs.org/docs/how-to-contribute.html --> ## Summary <!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? --> The flag has been tested internally on WWW, should be good to set to true for OSS. Added a dynamic flag for fb RN. ## How did you test this change? <!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. How exactly did you verify that your PR solves the issue you wanted to solve? If you leave this empty, your PR will very likely be closed. --> yarn test |
||
|
|
2c8a139a59 |
Generate sourcemaps for production build artifacts (#26446)
<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please provide enough information so that others can review your pull request. The three fields below are mandatory. Before submitting a pull request, please make sure the following is done: 1. Fork [the repository](https://github.com/facebook/react) and create your branch from `main`. 2. Run `yarn` in the repository root. 3. If you've fixed a bug or added code that should be tested, add tests! 4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development. 5. Run `yarn test --prod` to test in the production environment. It supports the same options as `yarn test`. 6. If you need a debugger, run `yarn test --debug --watch TestName`, open `chrome://inspect`, and press "Inspect". 7. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`). 8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files. 9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`). 10. If you haven't already, complete the CLA. Learn more about contributing: https://reactjs.org/docs/how-to-contribute.html --> ## Summary This PR updates the Rollup build pipeline to generate sourcemaps for production build artifacts like `react-dom.production.min.js`. It requires the Rollup v3 changes that were just merged in #26442 . Sourcemaps are currently _only_ generated for build artifacts that are _truly_ "production" - no sourcemaps will be generated for development, profiling, UMD, or `shouldStayReadable` artifacts. The generated sourcemaps contain the bundled source contents right before that chunk was minified by Closure, and _not_ the original source files like `react-reconciler/src/*`. This better reflects the actual code that is running as part of the bundle, with all the feature flags and transformations that were applied to the source files to generate that bundle. The sourcemaps _do_ still show comments and original function names, thus improving debuggability for production usage. Fixes #20186 . <!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? --> This allows React users to actually debug a readable version of the React bundle in production scenarios. It also allows other tools like [Replay](https://replay.io) to do a better job inspecting the React source when stepping through. ## How did you test this change? - Generated numerous sourcemaps with various combinations of the React bundle selections - Viewed those sourcemaps in https://evanw.github.io/source-map-visualization/ and confirmed via the visualization that the generated mappings appear to be correct I've attached a set of production files + their sourcemaps here: [react-sourcemap-examples.zip](https://github.com/facebook/react/files/11023466/react-sourcemap-examples.zip) You can drag JS+sourcemap file pairs into https://evanw.github.io/source-map-visualization/ for viewing. Examples: - `react.production.min.js`:  - `react-dom.production.min.js`:  - `use-sync-external-store/with-selector.production.min.js`:  <!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. How exactly did you verify that your PR solves the issue you wanted to solve? If you leave this empty, your PR will very likely be closed. --> |
||
|
|
2983249dd2 |
[Fizz] implement onHeaders and headersLengthHint options (#27641)
Adds a new option to `react-dom/server` entrypoints.
`onHeaders: (headers: Headers) => void` (non node envs)
`onHeaders: (headers: { Link?: string }) => void` (node envs)
When any `renderTo...` or `prerender...` function is called and this
option is provided the supplied function will be called sometime on or
before completion of the render with some preload link headers.
When provided during a `renderTo...` the callback will usually be called
after the first pass at work. The idea here is we want to get a set of
headers to start the browser loading well before the shell is ready. We
don't wait for the shell because if we did we may as well send the
preloads as tags in the HTML.
When provided during a `prerender...` the callback will be called after
the entire prerender is complete. The idea here is we are not responding
to a live request and it is preferable to capture as much as possible
for preloading as Headers in case the prerender was unable to finish the
shell.
Currently the following resources are always preloaded as headers when
the option is provided
1. prefetchDNS and preconnects
2. font preloads
3. high priority image preloads
Additionally if we are providing headers when the shell is incomplete
(regardless of whether it is render or prerender) we will also include
any stylesheet Resources (ones with a precedence prop)
There is a second option `maxHeadersLength?: number` which allows you to
specify the maximum length of the header content in unicode code units.
This is what you get when you read the length property of a string in
javascript. It's improtant to note that this is not the same as the
utf-8 byte length when these headers are serialized in a Response. The
utf8 representation may be the same size, or larger but it will never be
smaller.
If you do not supply a `maxHeadersLength` we defaul to `2000`. This was
chosen as half the value of the max headers length supported by commonly
known web servers and CDNs. many browser and web server can support
significantly more headers than this so you can use this option to
increase the headers limit. You can also of course use it to be even
more conservative. Again it is important to keep in mind there is no
direct translation between the max length and the bytelength and so if
you want to stay under a certain byte length you need to be potentially
more aggressive in the maxHeadersLength you choose.
Conceptually `onHeaders` could be called more than once as new headers
are discovered however if we haven't started flushing yet but since most
APIs for the server including the web standard Response only allow you
to set headers once the current implementation will only call it one
time
|
||
|
|
c897260cff |
refactor[react-devtools-shared]: minor parsing improvements and modifications (#27661)
Had these stashed for some time, it includes: - Some refactoring to remove unnecessary `FlowFixMe`s and type castings via `any`. - Optimized version of parsing component names. We encode string names to utf8 and then pass it serialized from backend to frontend in a single array of numbers. Previously we would call `slice` to get the corresponding encoded string as a subarray and then parse each character. New implementation skips `slice` step and just receives `left` and `right` ranges for the string to parse. - Early `break` instead of `continue` when Store receives unexpected operation, like removing an element from the Store, which is not registered yet. |
||
|
|
ce2bc58a9f |
[activity] rename unstable_Offscreen to unstable_Activity (#27640)
`Activity` is the current candidate name. This PR starts the rename work by renaming the exported unstable component name. NOTE: downstream consumers need to rename the import when updating to this commit. |
||
|
|
a17467e7e2 |
SchedulerPostTask: Reuse original TaskController (#27595)
## Summary It's not clear to me why we currently create a new TaskController in `runTask` – ultimately, we use the same signal and priority from the original created in `unstable_scheduleCallback` ## How did you test this change? ``` yarn test SchedulerPostTask ``` |
||
|
|
faa65778b7 | Bump browserify-sign from 4.0.4 to 4.2.2 in /fixtures/expiration (#27600) | ||
|
|
9ddfe614f2 | Bump browserify-sign from 4.0.4 to 4.2.2 in /fixtures/packaging/brunch/prod (#27598) | ||
|
|
6bfc0e032a |
Support Flow as expressions in ESLint rules (#27590)
Support Flow `as` expressions in ESLint rules, e.g. `<expr> as <type>`. This is the same syntax as TypeScript as expressions. I just looked for any place referencing `TSAsExpression` (the TS node) or `TypeCastExpression` (the previous Flow syntax) and added a case for `AsExpression` as well. |
||
|
|
3eaa0c3871 |
Bump browserify-sign from 4.0.4 to 4.2.2 in /fixtures/packaging/brunch/dev (#27606)
Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.0.4 to 4.2.2. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/browserify/browserify-sign/blob/main/CHANGELOG.md">browserify-sign's changelog</a>.</em></p> <blockquote> <h2><a href="https://github.com/browserify/browserify-sign/compare/v4.2.1...v4.2.2">v4.2.2</a> - 2023-10-25</h2> <h3>Fixed</h3> <ul> <li>[Tests] log when openssl doesn't support cipher <a href="https://redirect.github.com/browserify/browserify-sign/issues/37"><code>[#37](https://github.com/crypto-browserify/browserify-sign/issues/37)</code></a></li> </ul> <h3>Commits</h3> <ul> <li>Only apps should have lockfiles <a href=" |
||
|
|
0040951637 |
Bump browserify-sign from 4.2.1 to 4.2.2 in /fixtures/dom (#27608)
Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.2.1 to 4.2.2. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/browserify/browserify-sign/blob/main/CHANGELOG.md">browserify-sign's changelog</a>.</em></p> <blockquote> <h2><a href="https://github.com/browserify/browserify-sign/compare/v4.2.1...v4.2.2">v4.2.2</a> - 2023-10-25</h2> <h3>Fixed</h3> <ul> <li>[Tests] log when openssl doesn't support cipher <a href="https://redirect.github.com/browserify/browserify-sign/issues/37"><code>[#37](https://github.com/crypto-browserify/browserify-sign/issues/37)</code></a></li> </ul> <h3>Commits</h3> <ul> <li>Only apps should have lockfiles <a href=" |
||
|
|
d0fcd36af4 |
Bump browserify-sign from 4.0.4 to 4.2.2 in /fixtures/attribute-behavior (#27601)
Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.0.4 to 4.2.2. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/browserify/browserify-sign/blob/main/CHANGELOG.md">browserify-sign's changelog</a>.</em></p> <blockquote> <h2><a href="https://github.com/browserify/browserify-sign/compare/v4.2.1...v4.2.2">v4.2.2</a> - 2023-10-25</h2> <h3>Fixed</h3> <ul> <li>[Tests] log when openssl doesn't support cipher <a href="https://redirect.github.com/browserify/browserify-sign/issues/37"><code>[#37](https://github.com/crypto-browserify/browserify-sign/issues/37)</code></a></li> </ul> <h3>Commits</h3> <ul> <li>Only apps should have lockfiles <a href=" |
||
|
|
169d3350f0 |
Bump browserify-sign from 4.2.1 to 4.2.2 in /fixtures/ssr2 (#27616)
Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.2.1 to 4.2.2. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/browserify/browserify-sign/blob/main/CHANGELOG.md">browserify-sign's changelog</a>.</em></p> <blockquote> <h2><a href="https://github.com/browserify/browserify-sign/compare/v4.2.1...v4.2.2">v4.2.2</a> - 2023-10-25</h2> <h3>Fixed</h3> <ul> <li>[Tests] log when openssl doesn't support cipher <a href="https://redirect.github.com/browserify/browserify-sign/issues/37"><code>[#37](https://github.com/crypto-browserify/browserify-sign/issues/37)</code></a></li> </ul> <h3>Commits</h3> <ul> <li>Only apps should have lockfiles <a href=" |
||
|
|
a675e5751b |
Bump browserify-sign from 4.2.1 to 4.2.2 in /fixtures/concurrent/time-slicing (#27615)
Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.2.1 to 4.2.2. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/browserify/browserify-sign/blob/main/CHANGELOG.md">browserify-sign's changelog</a>.</em></p> <blockquote> <h2><a href="https://github.com/browserify/browserify-sign/compare/v4.2.1...v4.2.2">v4.2.2</a> - 2023-10-25</h2> <h3>Fixed</h3> <ul> <li>[Tests] log when openssl doesn't support cipher <a href="https://redirect.github.com/browserify/browserify-sign/issues/37"><code>[#37](https://github.com/crypto-browserify/browserify-sign/issues/37)</code></a></li> </ul> <h3>Commits</h3> <ul> <li>Only apps should have lockfiles <a href=" |
||
|
|
2bd946956d |
Bump browserify-sign from 4.2.1 to 4.2.2 in /fixtures/fizz (#27614)
Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.2.1 to 4.2.2. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/browserify/browserify-sign/blob/main/CHANGELOG.md">browserify-sign's changelog</a>.</em></p> <blockquote> <h2><a href="https://github.com/browserify/browserify-sign/compare/v4.2.1...v4.2.2">v4.2.2</a> - 2023-10-25</h2> <h3>Fixed</h3> <ul> <li>[Tests] log when openssl doesn't support cipher <a href="https://redirect.github.com/browserify/browserify-sign/issues/37"><code>[#37](https://github.com/crypto-browserify/browserify-sign/issues/37)</code></a></li> </ul> <h3>Commits</h3> <ul> <li>Only apps should have lockfiles <a href=" |
||
|
|
a79b55df74 |
Bump browserify-sign from 4.0.4 to 4.2.2 in /fixtures/packaging/browserify/prod (#27599)
Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.0.4 to 4.2.2. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/browserify/browserify-sign/blob/main/CHANGELOG.md">browserify-sign's changelog</a>.</em></p> <blockquote> <h2><a href="https://github.com/browserify/browserify-sign/compare/v4.2.1...v4.2.2">v4.2.2</a> - 2023-10-25</h2> <h3>Fixed</h3> <ul> <li>[Tests] log when openssl doesn't support cipher <a href="https://redirect.github.com/browserify/browserify-sign/issues/37"><code>[#37](https://github.com/crypto-browserify/browserify-sign/issues/37)</code></a></li> </ul> <h3>Commits</h3> <ul> <li>Only apps should have lockfiles <a href=" |
||
|
|
c988756f95 |
Bump browserify-sign from 4.0.4 to 4.2.2 in /fixtures/packaging/browserify/dev (#27597)
Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.0.4 to 4.2.2. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/browserify/browserify-sign/blob/main/CHANGELOG.md">browserify-sign's changelog</a>.</em></p> <blockquote> <h2><a href="https://github.com/browserify/browserify-sign/compare/v4.2.1...v4.2.2">v4.2.2</a> - 2023-10-25</h2> <h3>Fixed</h3> <ul> <li>[Tests] log when openssl doesn't support cipher <a href="https://redirect.github.com/browserify/browserify-sign/issues/37"><code>[#37](https://github.com/crypto-browserify/browserify-sign/issues/37)</code></a></li> </ul> <h3>Commits</h3> <ul> <li>Only apps should have lockfiles <a href=" |
||
|
|
d947c2f110 |
Allow useEffect(fn, undefined) in react-hooks/exhaustive-deps. (#27525)
## Summary There is a bug in the `react-hooks/exhaustive-deps` rule that forbids the dependencies argument from being `undefined`. It triggers the error that the dependency list is not an array literal. This makes sense in pre ES5 strict-mode environments as undefined could be redefined, but should not be a concern in today's JS environments. **Justification:** * The deps argument being undefined (for `useEffect` calls etc.) is a valid use case for hooks that should re-run on every render. * The deps argument being omitted is considered a valid use case by the `exhaustive-deps` rule already. * The TypeScript type definitions support passing `undefined` because hooks are typed as `useEffect(effect: EffectCallback, deps?: DependencyList): void;`. * Since omitting an argument and passing `undefined` are considered equivalent, this eslint rule should consider them as equivalent too. Further, I accidentally forgot passing a dependency array to `useEffect` in code that I shared on Twitter, and people started abusing me about it. I'd like to create an eslint rule for my projects that requires me to provide a dep argument in all cases (`undefined`, `[]` or the list of dependencies) so that I can avoid such problems in the future. This would also force me to always think about the dependencies instead of accidentally forgetting them and my hook running on each render. In an audit of my own codebase I had about 3% of hooks that I want to run on each render, and adding an explicit `undefined` seems reasonable in those situations. It could be argued this could be an option or part of the `exhaustive-deps` rule, but it's probably better to merge this PR, make a release and see if my custom eslint rule gains traction in the future. ## How did you test this change? * Added a test. * `yarn test ESLintRuleExhaustiveDeps-test` * Careful code inspection. |