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

fix capture render tree fails when errors in args #1460

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

patricklx
Copy link
Contributor

@patricklx patricklx commented Oct 24, 2023

better alternative to #1447 .

i''m actually not sure anymore how meta.discource. was in a state where it could render the components, but would fail when using inspector.
having errors in the args would cause rendering to fail as well.

@@ -21,7 +21,7 @@ export default function generateVmPlugins(
return [
[
__loadPlugins
?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto save...
well lets cleanup this space

@@ -181,7 +181,7 @@ export default class DebugRenderTreeImpl<TBucket extends object>
let template = this.captureTemplate(node);
let bounds = this.captureBounds(node);
let children = this.captureRefs(refs);
return { id, type, name, args: reifyArgs(args), instance, template, bounds, children };
return { id, type, name, args: reifyArgsDebug(args), instance, template, bounds, children };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this always happen? Do we want this to occur un production or dev only?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think its should be for both

@@ -58,5 +58,6 @@ export interface CapturedNamedArguments extends Record<string, Reference> {

export interface Arguments {
positional: readonly unknown[];
errors: Record<string, Error>;
Copy link
Contributor

@NullVoxPopuli NullVoxPopuli Oct 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where all is this interface used? If it's public, i'm worried about adding to it.

If it's internal, then it's fine

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be used for the inspector, to distinguish if an arg throws an error, or if it return an Error.
as it could also just be a return new Error()

@patricklx
Copy link
Contributor Author

@NullVoxPopuli shall we try this again?
all functions that do extra error handling are only used by capture render tree now

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

Successfully merging this pull request may close these issues.

3 participants