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

Explicitly export members of fluidRouter to workaround Typescript issue #5056

Merged
merged 1 commit into from
Feb 5, 2021

Conversation

ChumpChief
Copy link
Contributor

When downstream customers augment the IRequestHeader, the [index: string]: any; signature is lost and they end up with "property does not exist" errors.

This change uses this workaround to resolve the issue:
microsoft/TypeScript#18877 (comment)

// So we export the explicit members as a workaround:
// https://github.com/microsoft/TypeScript/issues/18877#issuecomment-476921038
export {
IRequest,
Copy link
Member

Choose a reason for hiding this comment

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

I wonder whether we can just export by name the one sthat we would augment by name and the rest can still be export *?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can with some eslint-disables, either way seems fine to me:

export {
    // eslint-disable-next-line import/export
    IRequestHeader,
} from "./fluidRouter";
// eslint-disable-next-line import/export
export * from "./fluidRouter";

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 probably prefer the current approach personally, but happy to change if you'd like.

Copy link
Member

@curtisman curtisman left a comment

Choose a reason for hiding this comment

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

:shipit:

@anthony-murphy
Copy link
Contributor

/azp run Build - client packages

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ChumpChief ChumpChief merged commit d50f6b0 into microsoft:main Feb 5, 2021
@ChumpChief ChumpChief deleted the ExplicitExport branch February 5, 2021 23:45
ChumpChief added a commit to ChumpChief/FluidFramework that referenced this pull request Feb 5, 2021
…ue (microsoft#5056)

When downstream customers augment the IRequestHeader, the [index: string]: any; signature is lost and they end up with "property does not exist" errors.

This change uses this workaround to resolve the issue:
microsoft/TypeScript#18877 (comment)
ChumpChief added a commit that referenced this pull request Feb 6, 2021
…ue (#5056) (#5063)

When downstream customers augment the IRequestHeader, the [index: string]: any; signature is lost and they end up with "property does not exist" errors.

This change uses this workaround to resolve the issue:
microsoft/TypeScript#18877 (comment)
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

3 participants