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

feat(plugins): fix typing and load-order #29

Merged
merged 1 commit into from
Sep 12, 2021
Merged

feat(plugins): fix typing and load-order #29

merged 1 commit into from
Sep 12, 2021

Conversation

blakebyrnes
Copy link
Contributor

I ported over the Secretagent plugin fix and noticed that types weren't working here.

I finally got plugin types to work, but it requires the extended classes to not have a default export. I don't think this matters for the end developer - it just matters in the client codebase for Tab, Hero, and I think we'll want to enable extensions for FrameEnvironment.

I toyed with converting other classes, but it seems like we would need to change whole codebase or it feels off.

@calebjclark
Copy link
Contributor

Is there a Typescript issue open regarding type extensions not working with default exports?

@blakebyrnes
Copy link
Contributor Author

blakebyrnes commented Sep 12, 2021

From typescript manual:

However, there are two limitations to keep in mind:

You can’t declare new top-level declarations in the augmentation — just patches to existing declarations.
Default exports also cannot be augmented, only named exports (since you need to augment an export by its exported name, and default is a reserved word - see #14080 for details)

microsoft/TypeScript#14080

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.

None yet

2 participants