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

[Flight] Instrument the Console in the RSC Environment and Replay Logs on the Client #28384

Merged
merged 6 commits into from
Feb 21, 2024

Commits on Feb 20, 2024

  1. Configuration menu
    Copy the full SHA
    970b241 View commit details
    Browse the repository at this point in the history
  2. Add flag

    sebmarkbage committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    33e1cbf View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4d8861e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a5f5528 View commit details
    Browse the repository at this point in the history
  5. Serialize console arguments using a special model serializer

    This allows complex objects to be logged and inspected on the client.
    
    We limit the depth of objects after 20 objects are written. This deals
    with cycles too.
    
    Because these objects aren't the complete model we can't cache them
    but if the full thing is already written, we can reuse that. This might
    not be fully ok since if there's an error:ed reference inside of it,
    it would error the log.
    
    This should never error nor suspend.
    
    Functions are emitted as eval of their source string to produce a similar
    looking function on the client.
    
    Unresolved Promises are serialized as infinite promises.
    sebmarkbage committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    2fe5fb0 View commit details
    Browse the repository at this point in the history
  6. Don't replay consoles written inside onError/onPostpone.

    These aren't conceptually part of the request's render so we exit the
    request context for those.
    sebmarkbage committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    609cb19 View commit details
    Browse the repository at this point in the history