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

Add type guard for PluginOptionError #742

Merged
merged 2 commits into from
Mar 11, 2024
Merged

Conversation

smaye81
Copy link
Member

@smaye81 smaye81 commented Mar 8, 2024

This adds a type guard function for PluginOptionError so that instanceof is no longer used. For additional details, see #713

@smaye81
Copy link
Member Author

smaye81 commented Mar 8, 2024

@timostamm couldn't write any tests for this since these aren't exported by protoplugin and I'm guessing we don't want to just for the sake of testing.

Also, lmk if there's additional checks for the PluginOptionError type.

@smaye81 smaye81 requested a review from timostamm March 8, 2024 19:42
@smaye81 smaye81 merged commit 00c7213 into main Mar 11, 2024
5 checks passed
@smaye81 smaye81 deleted the sayers/pluginoptionerror branch March 11, 2024 13:37
smaye81 added a commit that referenced this pull request Mar 13, 2024
Fixes #713

In #728, #729, and #742, we made changes that remove a common failure
point for the dual package hazard -- usage of `instanceof` with custom
types . As a result, the `node` exports condition for our packages
should not be necessary and is actually problematic for some bundlers.
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.

2 participants