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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@
6
6
7
7
- Use native node fetch available in node 18+ instead of `node-fetch` polyfill [#214](https://github.com/SalesforceCommerceCloud/commerce-sdk-isomorphic/pull/214)
8
8
- Support subpath imports for individual APIs and named imports [#219](https://github.com/SalesforceCommerceCloud/commerce-sdk-isomorphic/pull/219)
9
+
- Add importer utility for dynamic imports [#236](https://github.com/SalesforceCommerceCloud/commerce-sdk-isomorphic/pull/236)
- Main OAS file named `<api-name>-oas-v1-public.yaml` (e.g., `shopper-products-oas-v1-public.yaml`)
92
+
- Update `package.json` subpath exports so consumers can import the new API directly. Add a new entry under the top-level `exports` map using lower camel case for the API name, ensuring the path to the `lib` directory is correct:
93
+
94
+
Example for a new API named `shopperTest`:
95
+
96
+
```json
97
+
"exports": {
98
+
"./shopperTest": {
99
+
"import": "./lib/shopperTest.js",
100
+
"require": "./lib/shopperTest.cjs.js"
101
+
}
102
+
}
103
+
```
104
+
30
105
## Usage
31
106
32
107
An example React App is available at `./src/environment/App` directory. To use the sample application, configure these parameters in `./src/environment/config.js` file.
-**Subpath exports**: This utility depends on `package.json` subpath exports (e.g., `"./shopperSearch"`). When adding a new API, ensure you add matching entries; see Contributing > New APIs.
395
+
-**Chunking behavior**: Each API becomes a separate chunk in modern bundlers. Prefer loading at route or feature boundaries.
396
+
-**Error handling**: If a subpath export is missing or fails to load, the promise will reject. Handle with `try/catch` as needed.
397
+
-**Naming**: Keys are PascalCase (e.g., `ShopperBasketsV2`) while subpaths are lower camel case (e.g., `shopperBasketsv2`).
398
+
343
399
## License Information
344
400
345
401
The Commerce SDK Isomorphic is licensed under BSD-3-Clause license. See the [license](./LICENSE.txt) for details.
0 commit comments