Skip to content

Commit cc782ad

Browse files
committed
feat: 🎸 remove ES5 Javascript
BREAKING CHANGE: 🧨 Remove supports for old browsers(IE11, etc.). Minimal supported browsers use ES9.
1 parent eab9f5b commit cc782ad

File tree

43 files changed

+2284
-4907
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2284
-4907
lines changed

Diff for: docs/docs/integration-with-app.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ At first we must make an API call with your framework of choice. In this example
4545
"name": "polyfill.js",
4646
"type": "script",
4747
"source": {
48-
"es5": "http://localhost:4444/static/es5/polyfill.31c5090d8c961e43fade.js"
48+
"es9": "http://localhost:4444/static/es9/polyfill.31c5090d8c961e43fade.js"
4949
},
5050
"test": "return window.fetch"
5151
},
@@ -55,7 +55,6 @@ At first we must make an API call with your framework of choice. In this example
5555
"source": {
5656
"es11": "http://localhost:4444/static/es11/widget.4521af42bfa3596bb128.js",
5757
"es9": "http://localhost:4444/static/es9/widget.6961af42bfa3596bb147.js",
58-
"es5": "http://localhost:4444/static/es5/widget.31c5090d8c961e43fade.js"
5958
},
6059
"attr": {
6160
"async": true,
@@ -66,7 +65,7 @@ At first we must make an API call with your framework of choice. In this example
6665
"name": "optional.js",
6766
"type": "script",
6867
"source": {
69-
"es5": "http://localhost:4444/static/es5/optional.31c5090d8c961e43fade.js"
68+
"es9": "http://localhost:4444/static/es9/optional.31c5090d8c961e43fade.js"
7069
},
7170
"optional": true
7271
},
@@ -165,7 +164,7 @@ If your application doesn't use npm modules, you can handle assets your own way
165164
widget.mount();
166165
});
167166
};
168-
script.src = asset.es5.source;
167+
script.src = asset.es9.source;
169168
document.body.appendChild(script);
170169
}
171170

@@ -197,7 +196,7 @@ After we receive response from the widget API call we must update the final HTML
197196
<script src='<%= asset.source %>' defer='true'></script>
198197
<% } %>
199198
<%if (typeof asset.source === 'object') { %>
200-
<script src='<%= asset.source.es5 %>' defer='true'></script>
199+
<script src='<%= asset.source.es9 %>' defer='true'></script>
201200
<% } %>
202201
<% } %>
203202
<% }); %>

Diff for: lerna.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
"verifyAccess": false
1010
}
1111
},
12-
"useWorkspaces": true,
13-
"version": "0.31.1"
12+
"version": "0.31.1",
13+
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
1414
}

Diff for: package-lock.json

+2,193-4,723
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
"name": "merkur-monorepo",
33
"description": "Merkur is library for creating micro frontend with server side rendering.",
44
"devDependencies": {
5-
"@babel/core": "^7.21.8",
6-
"@babel/eslint-parser": "7.21.8",
7-
"@babel/plugin-transform-modules-commonjs": "^7.21.5",
8-
"@babel/preset-env": "^7.21.5",
9-
"@commitlint/cli": "^17.6.3",
10-
"@commitlint/config-conventional": "^17.6.3",
5+
"@babel/core": "^7.22.5",
6+
"@babel/eslint-parser": "7.22.5",
7+
"@babel/plugin-transform-modules-commonjs": "^7.22.5",
8+
"@babel/preset-env": "^7.22.5",
9+
"@commitlint/cli": "^17.6.5",
10+
"@commitlint/config-conventional": "^17.6.5",
1111
"@rollup/plugin-babel": "^6.0.3",
12-
"@rollup/plugin-node-resolve": "^15.0.2",
13-
"@rollup/plugin-terser": "^0.4.1",
12+
"@rollup/plugin-node-resolve": "^15.1.0",
13+
"@rollup/plugin-terser": "^0.4.3",
1414
"commitizen": "^4.3.0",
1515
"coveralls": "^3.1.1",
1616
"es-check": "^7.1.1",
17-
"eslint": "^8.40.0",
17+
"eslint": "^8.42.0",
1818
"eslint-config-last": "^0.0.5",
1919
"eslint-config-prettier": "^8.8.0",
2020
"eslint-plugin-jasmine": "^4.1.3",
@@ -25,10 +25,10 @@
2525
"husky": "^8.0.3",
2626
"jest": "^29.5.0",
2727
"jest-environment-jsdom": "^29.5.0",
28-
"lerna": "^6.6.2",
28+
"lerna": "^7.0.2",
2929
"lint-staged": "^13.2.2",
3030
"prettier": "^2.8.8",
31-
"rollup": "^3.21.6",
31+
"rollup": "^3.25.1",
3232
"to-mock": "^1.6.2"
3333
},
3434
"scripts": {

Diff for: packages/core/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
"./lib/index.es9.cjs": "./lib/index.es9.cjs"
1616
},
1717
"browser": {
18-
"./lib/index.js": "./lib/index.es5.js",
19-
"./lib/index.cjs": "./lib/index.es5.js",
18+
"./lib/index.js": "./lib/index.js",
19+
"./lib/index.cjs": "./lib/index.cjs",
2020
"./lib/index.mjs": "./lib/index.mjs",
2121
"./lib/index.es9.mjs": "./lib/index.es9.mjs"
2222
},
2323
"scripts": {
2424
"preversion": "npm test",
2525
"test": "jest --no-watchman -c ./jest.config.js",
26-
"test:es:version": "es-check es5 ./lib/index.es5.js && es-check es11 ./lib/index.mjs --module && es-check es9 ./lib/index.es9.mjs --module && es-check es9 ./lib/index.es9.cjs --module",
26+
"test:es:version": "es-check es11 ./lib/index.mjs --module && es-check es9 ./lib/index.es9.mjs --module && es-check es9 ./lib/index.es9.cjs --module",
2727
"build": "rollup -c rollup.config.mjs",
2828
"prepare": "npm run build"
2929
},

Diff for: packages/core/rollup.config.mjs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import {
22
createRollupESConfig,
3-
createRollupES5Config,
43
createRollupES9Config,
54
createRollupUMDConfig,
65
} from '../../createRollupConfig.mjs';
76

87
let esConfig = createRollupESConfig();
9-
let es5Config = createRollupES5Config();
108
let es9Config = createRollupES9Config();
119
let umdConfig = createRollupUMDConfig();
1210

13-
export default [esConfig, es5Config, es9Config, umdConfig];
11+
export default [esConfig, es9Config, umdConfig];

Diff for: packages/create-widget/template/server/routes/widgetAPI/widgetAPI.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ router.get(
2929
assets: info.assets,
3030
staticFolder,
3131
staticBaseUrl,
32-
folders: ['es11', 'es9', 'es5'],
32+
folders: ['es11', 'es9'],
3333
});
3434

3535
const status = info?.error?.status ?? 200;

Diff for: packages/create-widget/views/hyper/template/webpack.config.js

-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const {
22
createLiveReloadServer,
33
createWebConfig,
44
createNodeConfig,
5-
applyES5Transformation,
65
applyES9Transformation,
76
applyStyleLoaders,
87
pipe,
@@ -11,7 +10,6 @@ const {
1110
module.exports = createLiveReloadServer().then(() =>
1211
Promise.all([
1312
pipe(createWebConfig, applyStyleLoaders)(),
14-
pipe(createWebConfig, applyStyleLoaders, applyES5Transformation)(),
1513
pipe(createWebConfig, applyStyleLoaders, applyES9Transformation)(),
1614
pipe(createNodeConfig, applyStyleLoaders)(),
1715
])

Diff for: packages/create-widget/views/preact/template/webpack.config.js

-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const {
22
createLiveReloadServer,
33
createWebConfig,
44
createNodeConfig,
5-
applyES5Transformation,
65
applyES9Transformation,
76
applyStyleLoaders,
87
createCacheKey,
@@ -48,12 +47,6 @@ function applyBabelLoader(config, { isProduction, environment, cache }) {
4847
module.exports = createLiveReloadServer().then(() =>
4948
Promise.all([
5049
pipe(createWebConfig, applyStyleLoaders, applyBabelLoader)(),
51-
pipe(
52-
createWebConfig,
53-
applyStyleLoaders,
54-
applyBabelLoader,
55-
applyES5Transformation
56-
)(),
5750
pipe(
5851
createWebConfig,
5952
applyStyleLoaders,

Diff for: packages/create-widget/views/react/template/webpack.config.js

-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const {
22
createLiveReloadServer,
33
createWebConfig,
44
createNodeConfig,
5-
applyES5Transformation,
65
applyES9Transformation,
76
applyStyleLoaders,
87
createCacheKey,
@@ -47,12 +46,6 @@ function applyBabelLoader(config, { isProduction, environment, cache }) {
4746
module.exports = createLiveReloadServer().then(() =>
4847
Promise.all([
4948
pipe(createWebConfig, applyStyleLoaders, applyBabelLoader)(),
50-
pipe(
51-
createWebConfig,
52-
applyStyleLoaders,
53-
applyBabelLoader,
54-
applyES5Transformation
55-
)(),
5649
pipe(
5750
createWebConfig,
5851
applyStyleLoaders,

Diff for: packages/create-widget/views/svelte/template/webpack.config.js

-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const {
22
createLiveReloadServer,
33
createWebConfig,
44
createNodeConfig,
5-
applyES5Transformation,
65
applyES9Transformation,
76
applyStyleLoaders,
87
pipe,
@@ -51,12 +50,6 @@ function applySvelteNode(config) {
5150
module.exports = createLiveReloadServer().then(() =>
5251
Promise.all([
5352
pipe(createWebConfig, applyStyleLoaders, applySvelteWeb)(),
54-
pipe(
55-
createWebConfig,
56-
applyStyleLoaders,
57-
applySvelteWeb,
58-
applyES5Transformation
59-
)(),
6053
pipe(
6154
createWebConfig,
6255
applyStyleLoaders,

Diff for: packages/create-widget/views/uhtml/template/webpack.config.js

-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const {
22
createLiveReloadServer,
33
createWebConfig,
44
createNodeConfig,
5-
applyES5Transformation,
65
applyES9Transformation,
76
applyStyleLoaders,
87
pipe,
@@ -11,7 +10,6 @@ const {
1110
module.exports = createLiveReloadServer().then(() =>
1211
Promise.all([
1312
pipe(createWebConfig, applyStyleLoaders)(),
14-
pipe(createWebConfig, applyStyleLoaders, applyES5Transformation)(),
1513
pipe(createWebConfig, applyStyleLoaders, applyES9Transformation)(),
1614
pipe(createNodeConfig, applyStyleLoaders)(),
1715
])

Diff for: packages/create-widget/views/vanilla/template/webpack.config.js

-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const {
22
createLiveReloadServer,
33
createWebConfig,
44
createNodeConfig,
5-
applyES5Transformation,
65
applyES9Transformation,
76
applyStyleLoaders,
87
pipe,
@@ -11,7 +10,6 @@ const {
1110
module.exports = createLiveReloadServer().then(() =>
1211
Promise.all([
1312
pipe(createWebConfig, applyStyleLoaders)(),
14-
pipe(createWebConfig, applyStyleLoaders, applyES5Transformation)(),
1513
pipe(createWebConfig, applyStyleLoaders, applyES9Transformation)(),
1614
pipe(createNodeConfig, applyStyleLoaders)(),
1715
])

Diff for: packages/integration-react/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
"./lib/index.es9.cjs": "./lib/index.es9.cjs"
1515
},
1616
"browser": {
17-
"./lib/index.js": "./lib/index.es5.js",
18-
"./lib/index.cjs": "./lib/index.es5.js",
17+
"./lib/index.js": "./lib/index.js",
18+
"./lib/index.cjs": "./lib/index.cjs",
1919
"./lib/index.mjs": "./lib/index.mjs",
2020
"./lib/index.es9.mjs": "./lib/index.es9.mjs"
2121
},
2222
"scripts": {
2323
"preversion": "npm test",
2424
"test": "jest --no-watchman -c ./jest.config.js",
25-
"test:es:version": "es-check es5 ./lib/index.es5.js && es-check es11 ./lib/index.mjs --module && es-check es9 ./lib/index.es9.mjs --module && es-check es9 ./lib/index.es9.cjs --module",
25+
"test:es:version": "es-check es11 ./lib/index.mjs --module && es-check es9 ./lib/index.es9.mjs --module && es-check es9 ./lib/index.es9.cjs --module",
2626
"build": "rollup -c rollup.config.mjs",
2727
"prepare": "npm run build"
2828
},

Diff for: packages/integration-react/rollup.config.mjs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {
22
createRollupESConfig,
3-
createRollupES5Config,
43
createRollupES9Config,
54
} from '../../createRollupConfig.mjs';
65
import resolve from '@rollup/plugin-node-resolve';
@@ -9,7 +8,6 @@ import replace from '@rollup/plugin-replace';
98
import commonjs from '@rollup/plugin-commonjs';
109

1110
let esConfig = createRollupESConfig();
12-
let es5Config = createRollupES5Config();
1311
let es9Config = createRollupES9Config();
1412

1513
let extendedPlugins = [
@@ -34,7 +32,6 @@ let extendedPlugins = [
3432
];
3533

3634
esConfig.plugins.push(...extendedPlugins);
37-
es5Config.plugins.push(...extendedPlugins);
3835
es9Config.plugins.push(...extendedPlugins);
3936

40-
export default [esConfig, es9Config, es5Config];
37+
export default [esConfig, es9Config];

Diff for: packages/integration-react/src/__mocks__/widgetMock.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ const mockedWidgetProperties = {
1313
name: 'widget.js',
1414
type: 'script',
1515
source: {
16-
es9: 'http://localhost:4444/static/es9/widget.6961af42bfa3596bb147.js',
17-
es5: 'http://localhost:4444/static/es5/widget.31c5090d8c961e43fade.js',
16+
es11: 'http://localhost:4444/static/es11/widget.6961af42bfa3596bb147.js',
17+
es9: 'http://localhost:4444/static/es9/widget.31c5090d8c961e43fade.js',
1818
},
1919
},
2020
{

Diff for: packages/integration/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
"./server/index.js": "./server/index.js"
1919
},
2020
"browser": {
21-
"./lib/index.js": "./lib/index.es5.js",
22-
"./lib/index.cjs": "./lib/index.es5.js",
21+
"./lib/index.js": "./lib/index.js",
22+
"./lib/index.cjs": "./lib/index.cjs",
2323
"./lib/index.mjs": "./lib/index.mjs",
2424
"./lib/index.es9.mjs": "./lib/index.es9.mjs"
2525
},
2626
"scripts": {
2727
"preversion": "npm test",
2828
"test": "jest --no-watchman -c ./jest.config.js",
29-
"test:es:version": "es-check es5 ./lib/index.es5.js && es-check es11 ./lib/index.mjs --module && es-check es9 ./lib/index.es9.mjs --module && es-check es9 ./lib/index.es9.cjs --module",
29+
"test:es:version": "es-check es11 ./lib/index.mjs --module && es-check es9 ./lib/index.es9.mjs --module && es-check es9 ./lib/index.es9.cjs --module",
3030
"build": "rollup -c rollup.config.mjs",
3131
"prepare": "npm run build"
3232
},

Diff for: packages/integration/rollup.config.mjs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import {
22
createRollupESConfig,
3-
createRollupES5Config,
43
createRollupES9Config,
54
createRollupUMDConfig,
65
} from '../../createRollupConfig.mjs';
76

87
let esConfig = createRollupESConfig();
9-
let es5Config = createRollupES5Config();
108
let es9Config = createRollupES9Config();
119
let umdConfig = createRollupUMDConfig();
1210

13-
export default [esConfig, es5Config, es9Config, umdConfig];
11+
export default [esConfig, es9Config, umdConfig];

Diff for: packages/integration/server/__tests__/indexSpec.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ const fs = require('fs');
33

44
const staticFolder = 'build/static';
55
const staticBaseUrl = 'https://seznam.cz/static';
6-
const folders = ['es11', 'es9', 'es5', 'css'];
6+
const folders = ['es11', 'es9', 'css'];
77

88
const manifests = {
99
'build/static/css/manifest.json':
1010
'{"style.css":"style.c3e64bd85803ef0e5583.css"}',
11-
'build/static/es5/manifest.json':
12-
'{"widget.css": "widget.96a1e61f8f77442b9837.css", "widget.js": "widget.e5e3d41ecc1f5964c3e3.js"}',
1311
'build/static/es9/manifest.json':
1412
'{"widget.css": "widget.96a1e61f8f77442b9837.css", "widget.js": "widget.fdf95165e917b666fc62.js"}',
1513
'build/static/es11/manifest.json':

0 commit comments

Comments
 (0)