diff --git a/buildtools/check-example.js b/buildtools/check-example.js index 4bf704f77dad..a48e5747e506 100644 --- a/buildtools/check-example.js +++ b/buildtools/check-example.js @@ -110,7 +110,7 @@ function loaded(page, browser) { process.exit(2); } ); - }, 500); + }, 1000); } else { await browser.close(); } diff --git a/buildtools/webpack.api.js b/buildtools/webpack.api.js index 6cbc28aa5648..d113132634db 100644 --- a/buildtools/webpack.api.js +++ b/buildtools/webpack.api.js @@ -39,9 +39,13 @@ module.exports = (env, argv) => { options: { babelrc: false, comments: false, - plugins: [ - require.resolve('@babel/plugin-proposal-nullish-coalescing-operator'), - require.resolve('@babel/plugin-proposal-optional-chaining'), + presets: [ + [ + '@babel/preset-env', + { + targets: require('./webpack.share').browsers, + }, + ], ], }, }, diff --git a/buildtools/webpack.commons.js b/buildtools/webpack.commons.js index 47408cb53a2f..6f7bc07ff750 100644 --- a/buildtools/webpack.commons.js +++ b/buildtools/webpack.commons.js @@ -49,6 +49,15 @@ module.exports = function (config) { $: 'jquery', }); + const babelPresetEnv = [ + require.resolve('@babel/preset-env'), + { + targets: config.browsers || require('./webpack.share').browsers, + debug: true, + loose: true, + }, + ]; + // Expose corejs-typeahead as window.Bloodhound const typeaheadRule = { test: require.resolve('corejs-typeahead'), @@ -144,6 +153,7 @@ module.exports = function (config) { assumptions: { setPublicClassFields: true, }, + presets: [babelPresetEnv], plugins: [ [ require.resolve('@babel/plugin-transform-typescript'), @@ -151,9 +161,6 @@ module.exports = function (config) { {allowDeclareFields: true}, ], [require.resolve('@babel/plugin-proposal-decorators'), {decoratorsBeforeExport: true}], - require.resolve('@babel/plugin-proposal-class-properties'), - require.resolve('@babel/plugin-proposal-nullish-coalescing-operator'), - require.resolve('@babel/plugin-proposal-optional-chaining'), ], }, }, @@ -173,11 +180,8 @@ module.exports = function (config) { options: { babelrc: false, comments: false, - plugins: [ - require.resolve('babel-plugin-angularjs-annotate'), - require.resolve('@babel/plugin-proposal-nullish-coalescing-operator'), - require.resolve('@babel/plugin-proposal-optional-chaining'), - ], + presets: [babelPresetEnv], + plugins: [require.resolve('babel-plugin-angularjs-annotate')], }, }, }; @@ -200,10 +204,7 @@ module.exports = function (config) { options: { babelrc: false, comments: false, - plugins: [ - require.resolve('@babel/plugin-proposal-nullish-coalescing-operator'), - require.resolve('@babel/plugin-proposal-optional-chaining'), - ], + presets: [babelPresetEnv], }, }, }; diff --git a/buildtools/webpack.config.dll.js b/buildtools/webpack.config.dll.js index 10283f2e8d4b..cea538605c34 100644 --- a/buildtools/webpack.config.dll.js +++ b/buildtools/webpack.config.dll.js @@ -41,9 +41,13 @@ module.exports = { options: { babelrc: false, comments: false, - plugins: [ - require.resolve('@babel/plugin-proposal-nullish-coalescing-operator'), - require.resolve('@babel/plugin-proposal-optional-chaining'), + presets: [ + [ + require.resolve('@babel/preset-env'), + { + targets: require('./webpack.share').browsers, + }, + ], ], }, }, diff --git a/buildtools/webpack.share.js b/buildtools/webpack.share.js new file mode 100644 index 000000000000..fd3cd849222a --- /dev/null +++ b/buildtools/webpack.share.js @@ -0,0 +1,25 @@ +// The MIT License (MIT) +// +// Copyright (c) 2018-2023 Camptocamp SA +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +// the Software, and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +module.exports = { + // see: npx browserslist '> 0.7% in CH or > 0.7% in FR or Firefox ESR' + browsers: 'defaults, > 0.1% in CH, > 0.1% in FR, Firefox ESR and supports es6-class and not iOS < 10', +}; diff --git a/contribs/gmf/examples/displayquerygrid-ref.png b/contribs/gmf/examples/displayquerygrid-ref.png index 7a205de043b2..ef4b41649fed 100644 Binary files a/contribs/gmf/examples/displayquerygrid-ref.png and b/contribs/gmf/examples/displayquerygrid-ref.png differ diff --git a/contribs/gmf/examples/displayquerywindow-ref.png b/contribs/gmf/examples/displayquerywindow-ref.png index 0f5f7f307429..23a5e5567132 100644 Binary files a/contribs/gmf/examples/displayquerywindow-ref.png and b/contribs/gmf/examples/displayquerywindow-ref.png differ diff --git a/contribs/gmf/examples/layertree-ref.png b/contribs/gmf/examples/layertree-ref.png index b7ce46b3d187..fa2acd2995bf 100644 Binary files a/contribs/gmf/examples/layertree-ref.png and b/contribs/gmf/examples/layertree-ref.png differ diff --git a/contribs/gmf/examples/layertreeadd-ref.png b/contribs/gmf/examples/layertreeadd-ref.png index b7ce46b3d187..fa2acd2995bf 100644 Binary files a/contribs/gmf/examples/layertreeadd-ref.png and b/contribs/gmf/examples/layertreeadd-ref.png differ diff --git a/contribs/gmf/examples/print-ref.png b/contribs/gmf/examples/print-ref.png index 8fabda3871a1..26f8433aeae7 100644 Binary files a/contribs/gmf/examples/print-ref.png and b/contribs/gmf/examples/print-ref.png differ diff --git a/examples/layerorder-ref.png b/examples/layerorder-ref.png index 18f76bc0f177..f0f70ba6c4eb 100644 Binary files a/examples/layerorder-ref.png and b/examples/layerorder-ref.png differ diff --git a/examples/mapfishprint-ref.png b/examples/mapfishprint-ref.png index c94893e5dfbf..a7ad0ebdbf66 100644 Binary files a/examples/mapfishprint-ref.png and b/examples/mapfishprint-ref.png differ diff --git a/webpack.config.js b/webpack.config.js index d907cbb964a0..af0120118f47 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,6 +1,6 @@ // The MIT License (MIT) // -// Copyright (c) 2017-2021 Camptocamp SA +// Copyright (c) 2017-2023 Camptocamp SA // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in @@ -32,9 +32,6 @@ module.exports = (env, args) => { case 'dist': common_config.nodll = true; break; - case 'ngeo-examples': - case 'gmf-examples': - common_config.browsers = ['> 0.5% in CH', '> 0.5% in FR', 'Firefox ESR', 'ie 11']; } let config = require('./buildtools/webpack.commons')(common_config);