Skip to content
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

Update dependency react-error-boundary to v4 #38

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Mar 22, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
react-error-boundary ^3.1.0 -> ^4.0.0 age adoption passing confidence

Release Notes

bvaughn/react-error-boundary (react-error-boundary)

v4.0.13

Compare Source

Removed references to ESLint config kcd-scripts from package.json

v4.0.12

Compare Source

  • Support null fallback prop (#​169)

v4.0.11

Compare Source

  • Re-throw original error in the event that no fallback is specified (#​160)
  • Improved exported prop types def (#​152)
  • Bundle built with Preconstruct (#​144, #​149, 9b7b15b)

v4.0.10

Compare Source

  • Target Safari 12+ compatibility (by removing optional chaining operator and default parameters)

v4.0.9

Compare Source

v4.0.8

Compare Source

  • 144: Build release bundle with Preconstruct

v4.0.7

Compare Source

*Replaced post-processing "use client" insertion step with a custom Parcel plug-in. This should hopefully produce better source maps.

v4.0.6

Compare Source

  • Removed arrow function syntax to support older versions of Safari

v4.0.5

Compare Source

Move "use client" directive to top of the bundled file.

v4.0.4

Compare Source

README changes only

v4.0.3

Compare Source

  • withErrorBoundary forwards refs
  • Add "use client" directive

v4.0.2

Compare Source

Fix broken TypeScript definitions file (#​133, https://github.com/parcel-bundler/parcel/issues/8908)

v4.0.1

Compare Source

  • Render ErrorBoundaryContext around fallback UI as well, so the useErrorBoundary hook could be used within the fallback component to reset the boundary.

For example:

import { useErrorBoundary } from "react-error-boundary";

function ErrorFallback({ error }) {
  const { resetBoundary } = useErrorBoundary();

  return (
    <div role="alert">
      <p>Something went wrong:</p>
      <pre style={{ color: "red" }}>{error.message}</pre>
      <button onClick={resetBoundary}>Try again</button>
    </div>
  );
}

See this demo: https://codesandbox.io/s/nostalgic-browser-e9lpmf

v4.0.0

Compare Source

  • Replace useErrorHandler hook with useErrorBoundary; can be used to trigger an error boundary or dismiss one
  • Merge onReset and onResetKeys props; pass "details" object explaining the cause of the reset

Why did the useErrorHandler hook change?

The old hook had two design flaws, both related to the givenError parameter:

  1. All the hook did was throw this value. This seemed unnecessary, because if a component already has a reference to an error during render, it can just throw the value itself.
  • It would not properly re-throw null or undefined values. (Although an edge case, JavaScript enables throwing any values/types.)

If you were using the givenError functionality– you can now just throw the value directly instead.

// Before
function Greeting() {
  const [name, setName] = React.useState('')
  const {greeting, error} = useGreeting(name)
  useErrorHandler(error)
// After
function Greeting() {
  const [name, setName] = React.useState('')
  const {greeting, error} = useGreeting(name)
  if (error) {
    throw error;
  }

How can I use the new useErrorHandler hook?

Show the nearest error boundary from an event handler

React only handles errors thrown during render or during component lifecycle methods (e.g. effects and did-mount/did-update). Errors thrown in event handlers, or after async code has run, will not be caught.

This hook can be used to pass those errors to the nearest error boundary:

import { useErrorBoundary } from "react-error-boundary";

function Example() {
  const { showBoundary } = useErrorBoundary();

  useEffect(() => {
    fetchGreeting(name).then(
      response => {
        // Set data in state and re-render
      },
      error => {
        // Show error boundary
        showBoundary(error);
      }
    );
  });

  // Render ...
}

Dismiss the nearest error boundary

A fallback component can use this hook to request the nearest error boundary retry the render that original failed.

import { useErrorBoundary } from "react-error-boundary";

function ErrorFallback({ error }) {
  const { resetBoundary } = useErrorBoundary();

  return (
    <div role="alert">
      <p>Something went wrong:</p>
      <pre style={{ color: "red" }}>{error.message}</pre>
      <button onClick={resetBoundary}>Try again</button>
    </div>
  );
}

v3.1.4

Compare Source

Bug Fixes

v3.1.3

Compare Source

Bug Fixes

v3.1.2

Compare Source

Bug Fixes
  • TS: help typescript to find his way for the ErrorBoundaryProps union (#​90) (fb0b859)

v3.1.1

Compare Source

Bug Fixes

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
Copy link
Contributor Author

renovate bot commented Mar 22, 2023

⚠ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: package-lock.json
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @reach/alert@0.1.5
npm WARN Found: react@17.0.1
npm WARN node_modules/react
npm WARN   react@"^17.0.1" from the root project
npm WARN   13 more (@testing-library/react, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"^16.8.0" from @reach/alert@0.1.5
npm WARN node_modules/@reach/alert
npm WARN   @reach/alert@"^0.1.2" from toasted-notes@3.2.0
npm WARN   node_modules/toasted-notes
npm WARN 
npm WARN Conflicting peer dependency: react@16.14.0
npm WARN node_modules/react
npm WARN   peer react@"^16.8.0" from @reach/alert@0.1.5
npm WARN   node_modules/@reach/alert
npm WARN     @reach/alert@"^0.1.2" from toasted-notes@3.2.0
npm WARN     node_modules/toasted-notes
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @reach/alert@0.1.5
npm WARN Found: react-dom@17.0.1
npm WARN node_modules/react-dom
npm WARN   react-dom@"^17.0.1" from the root project
npm WARN   5 more (@testing-library/react, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react-dom@"^16.8.0" from @reach/alert@0.1.5
npm WARN node_modules/@reach/alert
npm WARN   @reach/alert@"^0.1.2" from toasted-notes@3.2.0
npm WARN   node_modules/toasted-notes
npm WARN 
npm WARN Conflicting peer dependency: react-dom@16.14.0
npm WARN node_modules/react-dom
npm WARN   peer react-dom@"^16.8.0" from @reach/alert@0.1.5
npm WARN   node_modules/@reach/alert
npm WARN     @reach/alert@"^0.1.2" from toasted-notes@3.2.0
npm WARN     node_modules/toasted-notes
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @reach/component-component@0.1.3
npm WARN Found: react@17.0.1
npm WARN node_modules/react
npm WARN   react@"^17.0.1" from the root project
npm WARN   13 more (@testing-library/react, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"^16.4.0" from @reach/component-component@0.1.3
npm WARN node_modules/@reach/component-component
npm WARN   @reach/component-component@"^0.1.3" from @reach/alert@0.1.5
npm WARN   node_modules/@reach/alert
npm WARN 
npm WARN Conflicting peer dependency: react@16.14.0
npm WARN node_modules/react
npm WARN   peer react@"^16.4.0" from @reach/component-component@0.1.3
npm WARN   node_modules/@reach/component-component
npm WARN     @reach/component-component@"^0.1.3" from @reach/alert@0.1.5
npm WARN     node_modules/@reach/alert
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @reach/component-component@0.1.3
npm WARN Found: react-dom@17.0.1
npm WARN node_modules/react-dom
npm WARN   react-dom@"^17.0.1" from the root project
npm WARN   5 more (@testing-library/react, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react-dom@"^16.4.0" from @reach/component-component@0.1.3
npm WARN node_modules/@reach/component-component
npm WARN   @reach/component-component@"^0.1.3" from @reach/alert@0.1.5
npm WARN   node_modules/@reach/alert
npm WARN 
npm WARN Conflicting peer dependency: react-dom@16.14.0
npm WARN node_modules/react-dom
npm WARN   peer react-dom@"^16.4.0" from @reach/component-component@0.1.3
npm WARN   node_modules/@reach/component-component
npm WARN     @reach/component-component@"^0.1.3" from @reach/alert@0.1.5
npm WARN     node_modules/@reach/alert
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @reach/visually-hidden@0.1.4
npm WARN Found: react@17.0.1
npm WARN node_modules/react
npm WARN   react@"^17.0.1" from the root project
npm WARN   13 more (@testing-library/react, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"^16.8.0" from @reach/visually-hidden@0.1.4
npm WARN node_modules/@reach/visually-hidden
npm WARN   @reach/visually-hidden@"^0.1.4" from @reach/alert@0.1.5
npm WARN   node_modules/@reach/alert
npm WARN 
npm WARN Conflicting peer dependency: react@16.14.0
npm WARN node_modules/react
npm WARN   peer react@"^16.8.0" from @reach/visually-hidden@0.1.4
npm WARN   node_modules/@reach/visually-hidden
npm WARN     @reach/visually-hidden@"^0.1.4" from @reach/alert@0.1.5
npm WARN     node_modules/@reach/alert
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @reach/visually-hidden@0.1.4
npm WARN Found: react-dom@17.0.1
npm WARN node_modules/react-dom
npm WARN   react-dom@"^17.0.1" from the root project
npm WARN   5 more (@testing-library/react, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react-dom@"^16.8.0" from @reach/visually-hidden@0.1.4
npm WARN node_modules/@reach/visually-hidden
npm WARN   @reach/visually-hidden@"^0.1.4" from @reach/alert@0.1.5
npm WARN   node_modules/@reach/alert
npm WARN 
npm WARN Conflicting peer dependency: react-dom@16.14.0
npm WARN node_modules/react-dom
npm WARN   peer react-dom@"^16.8.0" from @reach/visually-hidden@0.1.4
npm WARN   node_modules/@reach/visually-hidden
npm WARN     @reach/visually-hidden@"^0.1.4" from @reach/alert@0.1.5
npm WARN     node_modules/@reach/alert
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: airbnb-prop-types@2.16.0
npm WARN Found: react@17.0.1
npm WARN node_modules/react
npm WARN   react@"^17.0.1" from the root project
npm WARN   13 more (@testing-library/react, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"^0.14 || ^15.0.0 || ^16.0.0-alpha" from airbnb-prop-types@2.16.0
npm WARN node_modules/airbnb-prop-types
npm WARN   airbnb-prop-types@"^2.16.0" from enzyme-adapter-utils@1.14.0
npm WARN   node_modules/enzyme-adapter-utils
npm WARN 
npm WARN Conflicting peer dependency: react@16.14.0
npm WARN node_modules/react
npm WARN   peer react@"^0.14 || ^15.0.0 || ^16.0.0-alpha" from airbnb-prop-types@2.16.0
npm WARN   node_modules/airbnb-prop-types
npm WARN     airbnb-prop-types@"^2.16.0" from enzyme-adapter-utils@1.14.0
npm WARN     node_modules/enzyme-adapter-utils
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: connected-react-router@6.0.0
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"^17.0.1" from the root project
npm ERR!   peer react@"*" from @testing-library/react@11.2.2
npm ERR!   node_modules/@testing-library/react
npm ERR!     @testing-library/react@"^11.1.0" from the root project
npm ERR!   12 more (@wojtekmaj/enzyme-adapter-react-17, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.4.0" from connected-react-router@6.0.0
npm ERR! node_modules/connected-react-router
npm ERR!   connected-react-router@"^6.0.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: react@16.14.0
npm ERR! node_modules/react
npm ERR!   peer react@"^16.4.0" from connected-react-router@6.0.0
npm ERR!   node_modules/connected-react-router
npm ERR!     connected-react-router@"^6.0.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /tmp/worker/98d46e/eac2a5/cache/others/npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /tmp/worker/98d46e/eac2a5/cache/others/npm/_logs/2023-03-22T13_32_44_564Z-debug-0.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

0 participants