Skip to content

Don't export TS types from JS files#4597

Merged
chandlerprall merged 2 commits intoelastic:masterfrom
chandlerprall:bug/4595-exported-types
Mar 2, 2021
Merged

Don't export TS types from JS files#4597
chandlerprall merged 2 commits intoelastic:masterfrom
chandlerprall:bug/4595-exported-types

Conversation

@chandlerprall
Copy link
Copy Markdown
Contributor

Summary

Fixes #4595 by removing EuiPageSideBarProps and EuiPageTemplateProps exports from src/components/index.js as they are TypeScript definitions and removed from the transpiled code.

I confirmed with BABEL_MODULES=false yarn webpack --config=src/webpack.config.js that these are the only two such exports.

Copy link
Copy Markdown
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

🙇‍♀️ Thank you!

@chandlerprall chandlerprall merged commit 9c6dea9 into elastic:master Mar 2, 2021
@chandlerprall chandlerprall deleted the bug/4595-exported-types branch March 2, 2021 22:55
@orhantoy
Copy link
Copy Markdown

orhantoy commented Mar 2, 2021

There's something similar here (EuiSideNavProps):

export { EuiSideNav, EuiSideNavProps } from './side_nav';

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_4597/

@chandlerprall
Copy link
Copy Markdown
Contributor Author

Thanks @orhantoy ; I'll remove it as well, and am looking into why webpack warned/failed on the other 2 exported types but not EuiSideNavProps. Is this one causing a build failure for you?

@orhantoy
Copy link
Copy Markdown

orhantoy commented Mar 3, 2021

@chandlerprall No build failure, just mentioning it here because I also ran into the issue with EuiPageSideBarProps, and while investigating I noticed EuiSideNavProps.

@chandlerprall
Copy link
Copy Markdown
Contributor Author

why webpack warned/failed on the other 2 exported types but not EuiSideNavProps

side_nav/index.ts exports * from whereas page/index.ts has explicit exports, looks like webpack only inspects one layer deep when issuing that warning.

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.

EUI 31.9.0 upgrade error

4 participants