-
Notifications
You must be signed in to change notification settings - Fork 205
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
Change source of truth for types to umd/index.d.ts to resolve issue with typescript import in 5.x (Resolves #109) #130
base: main
Are you sure you want to change the base?
Conversation
…sue with typescript import in 5.x
@dcodeIO hello! Could you review the PR? |
Have ya'll verified that the proposed change indeed works for both ESM and CJS/UMD? |
@dcodeIO we're trying to move a project from CJS to ESM, and it looks like if we swap the imports like in this PR, it works in both CJS and ESM. |
Would love to get this merged! 🙏 |
Also would love to get this merged. Requires we enable |
@dcodeIO Were you able to review this? We need this fix. I have tested it as well and it works fine. |
Any news ? |
… removed if dcodeIO/long.js#130 ever gets merged.
… removed if dcodeIO/long.js#130 ever gets merged.
The previous PR to resolve this issue (#124) ended up duplicating the types to the umd module.
Moving the source-of-truth to the
./umd/index.d.ts
file enables the./index.d.ts
file to import the class from the umd subdirectory with no issues. The other way around, however, seems to be the cause of the issues.My suggestion is to move the source of truth to the umd declaration file, and import it from the root index.d.ts, as to avoid duplicated code, while still keeping the types functional.
This would resolve #109