Closed
Description
Is your feature request related to a problem? Please describe.
As of 2022-04-11, we use cjs
and es
in dist, tsconfig and build scripts. This is an issue as we will likely provide ESM artifacts being discussed in #2900.
We haven't decided on whether to use ESM wrapper or Isolate State. It needs a deep dive, but we're likely to use ES Module wrapper using a tool like gen-esm-wrapper, as:
- it doesn't significantly increase install size.
- has less operational load as we don't have to manage additional configuration.
There can still be a confusion as browser+react-native artifacts in es
can be considered as Node.js (ESM) artifacts.
Describe the solution you'd like
Do the following renames:
cjs
tonode
dist-cjs
todist-node
tsconfig.cjs.json
totsconfig.node.json
build:cjs
tobuild:node
es
tofrontend
dist-es
todist-frontend
tsconfig.es.json
totsconfig.frontend.json
build:es
tobuild:frontend
In future, when ESM artifacts are supported
- ES Module wrapper: They can be added inside
node
- Isolate State: The
node
can be renamed tonode-cjs
, and ESM artifacts can be emitted insidenode-esm
ornode-mjs
Describe alternatives you've considered
- Rename
es
tofrontend
but retaincjs
- Rename
es
toweb
because it's short. We didn't select this option, as backend technologies are also sometimes called web technologies. - Rename
es
toclient
as it's used on the client side. We didn't select this option, as it can be confused with service clients if we decide to make name public (like as a suffix in package name for specific variant:@aws-sdk/client-s3-client
).