Skip to content

feat: add full ESM support #125

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 1 commit into from
Jun 25, 2025
Merged

feat: add full ESM support #125

merged 1 commit into from
Jun 25, 2025

Conversation

kyletsang
Copy link
Collaborator

@kyletsang kyletsang commented Jun 21, 2025

This pull request includes changes to modernize the codebase by adopting ES module syntax and improving type imports for better TypeScript support. Additionally, it updates dependencies and adjusts configurations to align with these changes.

ES Module Migration:

  • .babelrc.js: Changed from CommonJS module.exports to ES module export default.
  • package.json: Updated the type field to module and adjusted the main entry point to lib/index.js.

TypeScript Enhancements:

  • Various files in src/ (e.g., Dropdown.tsx, DropdownMenu.tsx, Modal.tsx): Updated type imports to use type keyword for improved TypeScript clarity and performance. Added .js extensions to local module imports for ES module compatibility. [1] [2] [3] [4]

Dependency Updates:

  • package.json: Updated dom-helpers dependency from version ^5.2.0 to ^6.0.1.

Configuration Adjustments:

  • eslint.config.mjs: Disabled the react/prop-types rule, aligning with the project's focus on TypeScript for type checking. [1] [2]

Code Cleanup:

  • src/Modal.tsx: Removed unnecessary ESLint disable comment for react/prop-types, as this rule is now disabled globally in the ESLint configuration.

@kyletsang kyletsang requested a review from jquense June 21, 2025 00:10
@kyletsang kyletsang force-pushed the import-extensions branch from 7cfc48e to 375d67a Compare June 24, 2025 05:49
import preventOverflow from '@popperjs/core/lib/modifiers/preventOverflow';
import { placements } from '@popperjs/core/lib/enums';
import { popperGenerator } from '@popperjs/core/lib/popper-base';
// Since tsconfig is set for nodenext, these imports are resolving with a { default: ... } object, which
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unsure if there's a better way to handle this? Can be cleaned up when moving to floating UI?

@kyletsang kyletsang requested a review from jquense June 24, 2025 05:52
@kyletsang kyletsang merged commit 9fb475a into main Jun 25, 2025
7 checks passed
@kyletsang kyletsang deleted the import-extensions branch June 25, 2025 03:32
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