-
Notifications
You must be signed in to change notification settings - Fork 586
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(core): create submodule exports in core #6079
Conversation
Submodules examples: Submodule source code, authoring submodules
export const add = (a, b) => a + b;
export * from "./add"; Submodule source code, cross-importing submodules
// scope/pkg/submodule is used even within the same package.
import { add } from "@aws-sdk/core/addition";
export const multiply = (a, b) => {
let p = 0;
while (b--) p = add(p, a);
return p;
}
export * from "./multiply"; Submodule
|
I don't know if any authoritative definitions for the different export conditions, so I don't if it's 'okay' to use
|
confirmed works as expected in latest webpack, rollup, esbuild, vite, react-native (metro), and Node.js (CJS & MJS) |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
This PR modifies
@aws-sdk/core
into a special package that exports submodules using thepackage.json
exports
field, available since Node.js 12 and widely supported by bundlers.These submodules preserve the benefits of modularization while also consolidating package sprawl and making it easier to have a consistent single version of core functionality.
@aws-sdk/core
has been moved into submodules@aws-sdk/core
.Testing
internal test code available at commit AwsSdkJavaScriptTest/trees/5be19fdc2a1e0d71515f2a081020478e44fb5f5a
Checklist