-
Notifications
You must be signed in to change notification settings - Fork 10
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: improve @magicbell/react-headless cjs/esm support #391
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
a892e91
to
d05b043
Compare
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packages/react-headless/src/stores/notifications/NotificationRepository.ts
Show resolved
Hide resolved
import { IRemoteNotification } from '../types'; | ||
import INotificationRepository from './INotificationRepository'; | ||
import INotificationStore from './INotificationStore'; | ||
import { IRemoteNotification } from '../types/index.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💅 I think it's better to directly import here, instead of going through index.ts
, as we're in the same package.
import { IRemoteNotification } from '../types/index.js'; | |
import IRemoteNotification from './IRemoteNotification.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, we should drop all barrel files. They're bad for bundlers / tree shaking. I didn't do it here, as I simply added the extensions using https://www.npmjs.com/package/fix-esm-import-path.
Agreed about dropping the "magic constants". I didn't like the Now, we have a single place where we can import the constants from |
d05b043
to
ce99ef5
Compare
@smeijer let me know if you need additional support here, like testing, delegating tasks or pairing, but it's mostly done as I can see. |
fixes cjs/esm support by building with tshy. Needed to upgrade immer from v9 to v10 to support the case.