You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently integrating the @atproto/api library into a TypeScript project that utilizes ES modules. Upon attempting to compile my project with TypeScript (tsc), I encountered the following error:
This issue arises because the library is distributed as a CommonJS module, which complicates direct usage with named imports in ES module environments.
Expected Behavior
Ideally, I would like to import the @atproto/api components using ES module syntax directly in TypeScript without encountering compatibility issues or errors. For example:
import{BskyAgent,RichText}from"@atproto/api";
Proposed Solution
To address this compatibility issue and to enhance the library's usability within the TypeScript and modern JavaScript ecosystem, I kindly request the addition of ES module support. This could be achieved by:
Providing an ES module build of the library alongside the CommonJS version.
Ensuring named exports are correctly exported in the ES module format.
This enhancement would greatly benefit developers by allowing seamless integration with ES module-based projects and tools, improving developer experience and adoption.
Additional Context
I understand that adding ES module support may involve significant changes to the build and distribution process. However, considering the widespread adoption of ES modules in the JavaScript ecosystem, I believe this enhancement would align well with the needs of modern development workflows.
Thank you for considering this request. I am looking forward to any updates on this matter and am willing to assist or provide further information if needed.
Best regards,
Shino3 (@ shino3.net)
The text was updated successfully, but these errors were encountered:
+1, would significantly improve bundle size when only using a portion of the API. The prod bundle size impact is now ~900KB, and probably will be growing regularly.
Dear Bluesky maintainers,
I am currently integrating the @atproto/api library into a TypeScript project that utilizes ES modules. Upon attempting to compile my project with TypeScript (tsc), I encountered the following error:
This issue arises because the library is distributed as a CommonJS module, which complicates direct usage with named imports in ES module environments.
Expected Behavior
Ideally, I would like to import the @atproto/api components using ES module syntax directly in TypeScript without encountering compatibility issues or errors. For example:
Proposed Solution
To address this compatibility issue and to enhance the library's usability within the TypeScript and modern JavaScript ecosystem, I kindly request the addition of ES module support. This could be achieved by:
This enhancement would greatly benefit developers by allowing seamless integration with ES module-based projects and tools, improving developer experience and adoption.
Additional Context
I understand that adding ES module support may involve significant changes to the build and distribution process. However, considering the widespread adoption of ES modules in the JavaScript ecosystem, I believe this enhancement would align well with the needs of modern development workflows.
Thank you for considering this request. I am looking forward to any updates on this matter and am willing to assist or provide further information if needed.
Best regards,
Shino3 (@ shino3.net)
The text was updated successfully, but these errors were encountered: