Skip to content

Conversation

@KaiVandivier
Copy link
Contributor

@KaiVandivier KaiVandivier commented Jun 16, 2025

LIBS-772

I believe a suitable fix is just to allow .jsx files in the build output (although the JSX itself is still transpiled); I tested and made sure libs with .jsx files work when consumed by both apps using CRA and Vite

I tested this change out locally by renaming some the files in the App Adapter lib in the repo, building it (yarn build:adapter), then running the simple example app (yarn start:example)

Before:

Filename Imported as Works?
ConnectedHeaderBar.jsx './ConnectedHeaderBar.jsx'
Screenshot 2025-06-16 at 11 53 01

After:

Filename Imported as Works?
ConnectedBar.jsx './ConnectedHeaderBar.jsx'
ConnectedHeaderBar.tsx './ConnectedHeaderBar'

@sonarqubecloud
Copy link

@@ -1,5 +1,16 @@
const extensionPattern = /\.[jt]sx?$/
const normalizeExtension = (ext) => ext.replace(extensionPattern, '.js')
const extensionPattern = /\.([jt])sx?$/
Copy link
Contributor Author

@KaiVandivier KaiVandivier Jun 16, 2025

Choose a reason for hiding this comment

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

This regex is also used in the src/lib/compiler/compile.js file; I made sure this small change doesn't affect its usage there

@KaiVandivier KaiVandivier requested review from a team and amcgee June 16, 2025 10:20
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