8000 feat: add better ESM support by kyletsang · Pull Request #6939 · react-bootstrap/react-bootstrap · GitHub
[go: up one dir, main page]

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

feat: add better ESM support #6939

wants to merge 1 commit into from

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

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
0