Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/client-bundle-es2024.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webpack-dev-server": major
---

The injected client bundle now targets ES2024. Browsers without native ES module support (IE 11, Edge legacy, Safari < 10.1, Chrome < 61, Firefox < 60) are no longer supported.
19 changes: 2 additions & 17 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,18 @@ export default (api) => {
api.cache(true);

return {
ignore: ["client/**", "node_modules/**"],
presets: [
[
"@babel/preset-env",
{
modules: false,
targets: {
esmodules: true,
node: "0.12",
node: "22.15.0",
},
},
],
],
plugins: ["@babel/plugin-transform-object-assign"],
env: {
test: {
presets: [
[
"@babel/preset-env",
{
targets: {
node: "22.15.0",
},
},
],
],
plugins: ["@babel/plugin-transform-runtime"],
},
},
};
};
15 changes: 1 addition & 14 deletions client-src/overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,6 @@ import ansiHTML from "ansi-html-community";

/** @typedef {import("./index.js").EXPECTED_ANY} EXPECTED_ANY */

/**
* @type {(input: string, position: number) => number | undefined}
*/
// @ts-expect-error
const getCodePoint = String.prototype.codePointAt
? // @ts-expect-error
(input, position) => input.codePointAt(position)
: (input, position) =>
(input.charCodeAt(position) - 0xd800) * 0x400 +
input.charCodeAt(position + 1) -
0xdc00 +
0x10000;

/**
* @param {string} macroText macro text
* @param {RegExp} macroRegExp macro reg exp
Expand Down Expand Up @@ -70,7 +57,7 @@ function encode(text) {
let result = references[/** @type {keyof typeof references} */ (input)];
if (!result) {
const code =
input.length > 1 ? getCodePoint(input, 0) : input.charCodeAt(0);
input.length > 1 ? input.codePointAt(0) : input.charCodeAt(0);
result = `&#${code};`;
}
return result;
Expand Down
21 changes: 1 addition & 20 deletions client-src/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const baseForModules = {
path: path.resolve(__dirname, "../client/modules"),
...library,
},
target: ["web", "es5"],
target: ["web", "es2024"],
module: {
rules: [
{
Expand All @@ -42,26 +42,7 @@ export default [
output: {
filename: "logger/index.js",
},
module: {
rules: [
{
test: /\.js$/,
use: [
{
loader: "babel-loader",
options: {
plugins: ["@babel/plugin-transform-object-assign"],
},
},
],
},
],
},
plugins: [
new webpack.DefinePlugin({
Symbol:
'(typeof Symbol !== "undefined" ? Symbol : function (i) { return i; })',
}),
new webpack.NormalModuleReplacementPlugin(
/^tapable$/,
path.join(__dirname, "modules/logger/tapable.js"),
Expand Down
54 changes: 0 additions & 54 deletions package-lock.json

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

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,7 @@
"@babel/cli": "^7.28.6",
"@babel/core": "^7.29.0",
"@babel/eslint-parser": "^7.28.6",
"@babel/plugin-transform-object-assign": "^7.27.1",
"@babel/plugin-transform-runtime": "^7.29.0",
"@babel/preset-env": "^7.29.2",
"@babel/runtime": "^7.29.2",
"@changesets/cli": "^2.29.8",
"@changesets/get-github-info": "^0.8.0",
"@commitlint/cli": "^19.5.0",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.client.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "esnext",
"lib": ["es5", "dom", "webworker", "es2022.error"],
"lib": ["es2024", "dom", "webworker"],
"module": "nodenext",
"moduleResolution": "nodenext",
"allowJs": true,
Expand Down
Loading