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

Include link metadata for h5wasm and fix unresolved entities #1101

Merged
merged 1 commit into from
May 9, 2022

Conversation

loichuder
Copy link
Member

Fix #1100

I also fixed an issue with Unresolved entities (such as datatypes): clicking on the Inspect page would show attributes are undefined.

kind: EntityKind.Unresolved,
} as UnresolvedEntity;
};
Copy link
Member Author

Choose a reason for hiding this comment

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

attributes were undefined for "other" entities.

It was not caught by TS due to the type assertion as UnresolvedEntity that allows missing/additionnal field in an object.

To avoid such issues in the future, we should perhaps use type declaration rather than type assertion. See this simple example

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point, the extra variable is annoying, but if it detects this sort of errors, it is indeed worth it.

packages/h5wasm/src/h5wasm-api.ts Show resolved Hide resolved
@loichuder loichuder requested a review from axelboc May 6, 2022 08:11
kind: EntityKind.Unresolved,
} as UnresolvedEntity;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Good point, the extra variable is annoying, but if it detects this sort of errors, it is indeed worth it.

@loichuder loichuder merged commit e78c50d into main May 9, 2022
@loichuder loichuder deleted the h5wasm-link branch May 9, 2022 12:40
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.

[h5wasm] Show more info for links (not only Unresolved)
2 participants