contentful 11.0.2 → 11.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION.md +35 -0
- package/dist/contentful.browser.js +2 -2
- package/dist/contentful.browser.min.js +1 -1
- package/dist/contentful.cjs +2 -2
- package/dist/esm/contentful.js +1 -1
- package/dist/esm/create-contentful-api.js +1 -1
- package/dist/stats-browser-min.html +1 -1
- package/dist/types/types/asset.d.ts +2 -2
- package/dist/types/types/metadata.d.ts +0 -1
- package/dist/types/types/query/query.d.ts +1 -1
- package/dist/types/types/query/select.d.ts +2 -2
- package/package.json +2 -2
package/MIGRATION.md
CHANGED
|
@@ -52,6 +52,41 @@ From version 3.0.0 onwards, you can access documentation for a specific version
|
|
|
52
52
|
|
|
53
53
|
You can upgrade to a major version using `npm update contentful`
|
|
54
54
|
|
|
55
|
+
## Migration to version 11.x
|
|
56
|
+
Version 11.0.0 introduces full ESM support by default, with CJS variants still available for legacy environments. This version is a significant step forward in modernizing our build and improving performance while maintaining wide compatibility across various environments.
|
|
57
|
+
|
|
58
|
+
### Breaking changes
|
|
59
|
+
|
|
60
|
+
#### Node.js core modules
|
|
61
|
+
|
|
62
|
+
We no longer bundle Node.js core modules. If you’re bundling for the browser, you may need to configure your bundler to provide fallbacks or empty functions, particularly for the fs module. This change was introduced in version 11.x and may affect projects using Node.js-specific modules in the browser.
|
|
63
|
+
Pre-bundled code
|
|
64
|
+
|
|
65
|
+
Pre-bundled code for Node.js is no longer provided. If your setup relies on pre-bundled packages, you may need to adjust your build configuration.
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
### Improvements
|
|
69
|
+
|
|
70
|
+
#### Tree shaking
|
|
71
|
+
|
|
72
|
+
Tree shaking is significantly improved, ensuring that only the necessary parts of the library are included in your final bundle.
|
|
73
|
+
Smaller browser bundles
|
|
74
|
+
|
|
75
|
+
Browser bundle sizes have been reduced by nearly threefold, from 128KB to 45KB, contributing to faster load times and improved performance.
|
|
76
|
+
|
|
77
|
+
#### Module support and package configuration
|
|
78
|
+
The package now uses "type": "module" in package.json to define the default module format as ESM, while also providing support for CJS through the exports field. This allows us to support a wide range of environments including Node.js (with and without TypeScript, both CJS and ESM), AngularJS, GatsbyJS, Next.js, Nuxt, React Native (Expo), Rollup, Svelte, Vite, Webpack, and more.
|
|
79
|
+
|
|
80
|
+
#### Testing framework
|
|
81
|
+
We’ve migrated our internal test environment from Jest to Vitest, aligning with modern testing frameworks and tools.
|
|
82
|
+
|
|
83
|
+
## Security
|
|
84
|
+
|
|
85
|
+
### Removal of eval
|
|
86
|
+
|
|
87
|
+
We have completely removed the use of eval in our exported code, improving security and compatibility with strict environments.
|
|
88
|
+
|
|
89
|
+
|
|
55
90
|
## Migration to contentful.js 10.x
|
|
56
91
|
|
|
57
92
|
Version `10.0.0` is a complete rewrite in TypeScript. This version introduces a new concept of [client chain modifiers](README.md#client-chain-modifiers).
|
|
@@ -10251,7 +10251,7 @@ var contentful = (function (exports) {
|
|
|
10251
10251
|
http.defaults.baseURL = getGlobalOptions().environmentBaseUrl;
|
|
10252
10252
|
}
|
|
10253
10253
|
return {
|
|
10254
|
-
version: "11.0
|
|
10254
|
+
version: "11.1.0",
|
|
10255
10255
|
getSpace: getSpace,
|
|
10256
10256
|
getContentType: getContentType,
|
|
10257
10257
|
getContentTypes: getContentTypes,
|
|
@@ -10374,7 +10374,7 @@ var contentful = (function (exports) {
|
|
|
10374
10374
|
environment: 'master'
|
|
10375
10375
|
};
|
|
10376
10376
|
var config = Object.assign(Object.assign({}, defaultConfig), params);
|
|
10377
|
-
var userAgentHeader = getUserAgentHeader("contentful.js/".concat("11.0
|
|
10377
|
+
var userAgentHeader = getUserAgentHeader("contentful.js/".concat("11.1.0"), config.application, config.integration);
|
|
10378
10378
|
config.headers = Object.assign(Object.assign({}, config.headers), {
|
|
10379
10379
|
'Content-Type': 'application/vnd.contentful.delivery.v1+json',
|
|
10380
10380
|
'X-Contentful-User-Agent': userAgentHeader
|