Giter Club home page Giter Club logo

Comments (3)

kitten avatar kitten commented on May 26, 2024 2

Reopening since I believe I'm wrong and started working on this 😅

As more libraries implement Suspense APIs I can now see that a lot of them make use of suspending on fetching data that will ultimately reject. Furthermore I don't think it's completely unbelievable for some of these errors to be cached and subsequently thrown again on the client-side, which may also mean that people will rely on some Suspense logic inside of error boundaries' fallbacks.

from react-ssr-prepass.

kitten avatar kitten commented on May 26, 2024

That's a good shout. The problem with that is that currently react-ssr-prepass isn't really set up to bail and reenter the element tree at a higher level.

So that'd require quite some big changes. I'd imagine that the lowest effort fix would be to track the closest error boundary, so one at a time and to fall back on that if necessary.

Another alternative would be to not interrupt rendering at all on any kind of errors.

from react-ssr-prepass.

kitten avatar kitten commented on May 26, 2024

I've thought about this a little more and I don't think we'll implement this for two reasons:

  • react-ssr-prepass is only a prepass so you can await on it and catch the error and ignore it, because it's mostly meant to just fetch suspense data and assume that data has been fetched afterwards, not for full rendering.
  • react-ssr-prepass is more or less temporary until React implements all aspects of Suspense fetching on the server-side, so our hope is it'll eventually go away, which is why this is another reason of it not being a full renderer.

Lastly, I think it's safe to assume that you can catch the error from prepass and resume rendering in react-dom/server regardless of what has happened.

from react-ssr-prepass.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.