Skip to content

Commit

Permalink
Update webpack environment targets
Browse files Browse the repository at this point in the history
Also:
* Bump browserslist
* Widen browser support matrix
* Update browser typescript target to ES2018
* Bump `autoprefixer` but remove its usage as it spams the logs about it being unnecessary

Signed-off-by: Miki <[email protected]>
  • Loading branch information
AMoo-Miki committed Aug 1, 2023
1 parent a52e95c commit bcabefe
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 35 deletions.
15 changes: 10 additions & 5 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
[production]
last 2 Firefox versions
last 2 Chrome versions
last 2 Safari versions
> 0.25%
not ie 11
Firefox > 0 and last 2 years and > 0.01%
Chrome > 0 and last 2 years and > 0.01%
Safari > 0 and last 2 years and > 0.01%
Edge > 0 and last 1 year and > 0.01%
Opera > 0 and last 2 year and > 0.01%
> 0.2%
not op_mini all
not and_uc < 100
not android < 100
not dead

[dev]
last 1 chrome versions
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Removes `minimatch` manual resolution ([#3019](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3019))
- Upgrade `vega-lite` dependency from `4.17.0` to `^5.6.0` ([#3076](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3076)). Backwards-compatible version included in v2.5.0 release.
- Bump `js-yaml` from `3.14.0` to `4.1.0` ([#3770](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3770))
- Update webpack environment targets ([#4649](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4649))

### 🪛 Refactoring

Expand Down
2 changes: 1 addition & 1 deletion packages/osd-babel-preset/node_preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = (_, options = {}) => {
// `nvm install 8 && node ./src/cli` will run OpenSearch Dashboards
// in node version 8 and babel will stop transpiling async/await
// because they are supported in the "current" version of node
node: 'current',
node: 14,
},

// replaces `import "core-js/stable"` with a list of require statements
Expand Down
12 changes: 12 additions & 0 deletions packages/osd-babel-preset/webpack_preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ module.exports = () => {
{
useBuiltIns: 'entry',
modules: false,
targets: [
'Firefox > 0 and last 2 years and > 0.01%',
'Chrome > 0 and last 2 years and > 0.01%',
'Safari > 0 and last 2 years and > 0.01%',
'Edge > 0 and last 1 years and > 0.01%',
'Opera > 0 and last 2 years and > 0.01%',
'> 0.2%',
'not op_mini all',
'not and_uc < 100',
'not android < 100',
'not dead',
],
// Please read the explanation for this
// in node_preset.js
corejs: '3.2.1',
Expand Down
4 changes: 3 additions & 1 deletion packages/osd-optimizer/postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@
*/

module.exports = {
plugins: [require('autoprefixer')()],
plugins: [
/*require('autoprefixer')()*/
],
};

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tsconfig.browser.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"target": "es5",
"target": "es2018",
"module": "esnext",
},
"include": [
Expand Down
59 changes: 33 additions & 26 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4851,12 +4851,12 @@ autobind-decorator@^1.3.4:
integrity sha1-TJb/p3sQYi7eJPEQ9du/VmkUF9E=

autoprefixer@^10.4.1:
version "10.4.4"
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.4.tgz#3e85a245b32da876a893d3ac2ea19f01e7ea5a1e"
integrity sha512-Tm8JxsB286VweiZ5F0anmbyGiNI3v3wGv3mz9W+cxEDYB/6jbnj6GM9H9mK3wIL8ftgl+C07Lcwb8PG5PCCPzA==
version "10.4.14"
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.14.tgz#e28d49902f8e759dd25b153264e862df2705f79d"
integrity sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==
dependencies:
browserslist "^4.20.2"
caniuse-lite "^1.0.30001317"
browserslist "^4.21.5"
caniuse-lite "^1.0.30001464"
fraction.js "^4.2.0"
normalize-range "^0.1.2"
picocolors "^1.0.0"
Expand Down Expand Up @@ -5330,16 +5330,15 @@ browserify-zlib@^0.2.0:
dependencies:
pako "~1.0.5"

browserslist@^4.17.5, browserslist@^4.19.1, browserslist@^4.20.2:
version "4.20.2"
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.20.2.tgz#567b41508757ecd904dab4d1c646c612cd3d4f88"
integrity sha512-CQOBCqp/9pDvDbx3xfMi+86pr4KXIf2FDkTTdeuYw8OxS9t898LA1Khq57gtufFILXpfgsSx5woNgsBgvGjpsA==
browserslist@^4.17.5, browserslist@^4.19.1, browserslist@^4.21.5:
version "4.21.9"
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.9.tgz#e11bdd3c313d7e2a9e87e8b4b0c7872b13897635"
integrity sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==
dependencies:
caniuse-lite "^1.0.30001317"
electron-to-chromium "^1.4.84"
escalade "^3.1.1"
node-releases "^2.0.2"
picocolors "^1.0.0"
caniuse-lite "^1.0.30001503"
electron-to-chromium "^1.4.431"
node-releases "^2.0.12"
update-browserslist-db "^1.0.11"

[email protected]:
version "2.1.1"
Expand Down Expand Up @@ -5581,10 +5580,10 @@ camelize@^1.0.0:
resolved "https://registry.yarnpkg.com/camelize/-/camelize-1.0.0.tgz#164a5483e630fa4321e5af07020e531831b2609b"
integrity sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs=

caniuse-lite@^1.0.30001317:
version "1.0.30001460"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001460.tgz"
integrity sha512-Bud7abqjvEjipUkpLs4D7gR0l8hBYBHoa+tGtKJHvT2AYzLp1z7EmVkUT4ERpVUfca8S2HGIVs883D8pUH1ZzQ==
caniuse-lite@^1.0.30001464, caniuse-lite@^1.0.30001503:
version "1.0.30001517"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001517.tgz#90fabae294215c3495807eb24fc809e11dc2f0a8"
integrity sha512-Vdhm5S11DaFVLlyiKu4hiUTkpZu+y1KA/rZZqVQfOD5YdDT/eQKlkt7NaE0WGOFgX32diqt9MiP9CAiFeRklaA==

ccount@^1.0.0:
version "1.1.0"
Expand Down Expand Up @@ -7448,10 +7447,10 @@ elasticsearch@^16.4.0, elasticsearch@^16.7.0:
chalk "^1.0.0"
lodash "^4.17.10"

electron-to-chromium@^1.4.84:
version "1.4.102"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.102.tgz#fec312f753bcd9b89396136147efdb8bbd55cc82"
integrity sha512-MuWg3/gLTk6PSjC7ZrTgT8aAYZmUYd+gRtD95vN77KMBwZXiGdHHa8Y7ppMc/zwNumZtoIBLS0rzZyjEHd7sNw==
electron-to-chromium@^1.4.431:
version "1.4.477"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.477.tgz#05669aa6f161ee9076a6805457e9bd9fe6d0dfd1"
integrity sha512-shUVy6Eawp33dFBFIoYbIwLHrX0IZ857AlH9ug2o4rvbWmpaCUdBpQ5Zw39HRrfzAFm4APJE9V+E2A/WB0YqJw==

elegant-spinner@^1.0.1:
version "1.0.1"
Expand Down Expand Up @@ -13159,10 +13158,10 @@ node-preload@^0.2.1:
dependencies:
process-on-spawn "^1.0.0"

node-releases@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.2.tgz#7139fe71e2f4f11b47d4d2986aaf8c48699e0c01"
integrity sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg==
node-releases@^2.0.12:
version "2.0.13"
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.13.tgz#d5ed1627c23e3461e819b02e57b75e4899b1c81d"
integrity sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==

node-sass@^8.0.0:
version "8.0.0"
Expand Down Expand Up @@ -17659,6 +17658,14 @@ upath@^1.1.1:
resolved "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894"
integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==

update-browserslist-db@^1.0.11:
version "1.0.11"
resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz#9a2a641ad2907ae7b3616506f4b977851db5b940"
integrity sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==
dependencies:
escalade "^3.1.1"
picocolors "^1.0.0"

uri-js@^4.2.2:
version "4.4.1"
resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e"
Expand Down

0 comments on commit bcabefe

Please sign in to comment.