Skip to content

feat: add better ESM support #6939

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

Merged
merged 2 commits into from
Jul 28, 2025
Merged

feat: add better ESM support #6939

merged 2 commits into from
Jul 28, 2025

Conversation

kyletsang
Copy link
Member

This pull request introduces several changes to modernize the codebase and improve compatibility with ES modules. The most significant updates include switching from CommonJS to ES module syntax, adding the "type": "module" field in package.json, and updating dependencies. Additionally, import paths across multiple files have been updated to explicitly include .js extensions for better module resolution.

Modernization of module system:

  • .babelrc.js: Replaced module.exports with export default to align with ES module syntax.
  • package.json: Added "type": "module" to indicate the use of ES modules.
  • package.json: Removed the creation of package.json files with "type" fields during build scripts, as the "type": "module" field now applies globally.

Dependency updates:

  • package.json: Updated @restart/ui to version ^2.0.0-beta.5 and dom-helpers to version ^6.0.1 for improved functionality and compatibility.

Import path updates:

  • Updated all import paths across multiple files (e.g., src/AbstractModalHeader.tsx, src/Accordion.tsx, src/Alert.tsx, etc.) to include .js extensions explicitly, ensuring compatibility with ES modules. Examples include:
    • src/AbstractModalHeader.tsx: Changed imports for CloseButton and ModalContext to include .js extensions.
    • src/Accordion.tsx: Updated imports for AccordionBody, AccordionButton, AccordionCollapse, and others to include .js extensions.
    • src/Alert.tsx: Updated imports for AlertHeading, AlertLink, Fade, and others to include .js extensions.

@kyletsang
Copy link
Member Author

Needs react-restart/ui#126 to be merged and released before this can be merged

@kyletsang kyletsang marked this pull request as ready for review July 28, 2025 06:44
@kyletsang kyletsang merged commit e9e9457 into master Jul 28, 2025
11 checks passed
@kyletsang kyletsang deleted the import-extensions branch July 28, 2025 06:45
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.

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy