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

chore: remove file extensions from imports #3392

Conversation

amorriscode
Copy link
Contributor

tl;dr

  • Removes file extension (.js) from component imports in examples

Description

I was taking a look at a TypeScript example on CodeSandbox and saw that it didn't compile. The reason was that the imports were looking for *.js files, even though they don't exist. This PR removes the file extensions so the components can be loaded properly.

Resources

@darthtrevino
Copy link
Member

The extensions are for ESM compatibility. We can dig into fixing issues with the examples, but the module tests need to be able to pass

@amorriscode
Copy link
Contributor Author

Ah yeah, sorry about that @darthtrevino. I should've done a bit more research. 😞 I'll see if I can find a solution over the next few days. If not, I'll close out the PR.

@darthtrevino
Copy link
Member

I've thought about this some more, and I think it's probably safe to remove the extensions in the examples/ package only. My main concern was with the core libraries, but we use transpiled versions of those, and support for TS imports like this are still emerging in common toolchains.

@amorriscode amorriscode deleted the amorriscode/fix-typescript-examples branch February 20, 2022 17:48
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