Skip to content

Commit b77ba74

Browse files
mcanshpcattori
andauthored
chore(deps): bump esbuild to latest (#4754)
* chore: add invariant instead of using `!` Signed-off-by: Logan McAnsh <[email protected]> * chore(deps): bump esbuild to latest Signed-off-by: Logan McAnsh <[email protected]> * Create fresh-shrimps-join.md Signed-off-by: Logan McAnsh <[email protected]> Co-authored-by: Pedro Cattori <[email protected]>
1 parent 3d5527a commit b77ba74

File tree

6 files changed

+185
-888
lines changed

6 files changed

+185
-888
lines changed

.changeset/fresh-shrimps-join.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"remix": patch
3+
"@remix-run/dev": patch
4+
---
5+
6+
Support Typescript 4.9 features (like `satisfies`) in Remix `app/` code
7+
8+
esbuild 0.15.13 added support for parsing TS 4.9 `satisfies`, so upgrading to esbuild 0.16.3 adds that ability to the Remix compiler

packages/remix-dev/compiler/compileBrowser.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { emptyModulesPlugin } from "./plugins/emptyModulesPlugin";
1616
import { mdxPlugin } from "./plugins/mdx";
1717
import { urlImportsPlugin } from "./plugins/urlImportsPlugin";
1818
import { writeFileSafe } from "./utils/fs";
19+
import invariant from "../invariant";
1920

2021
export type BrowserCompiler = {
2122
// produce ./public/build/
@@ -70,7 +71,7 @@ const createEsbuildConfig = (
7071
entryPoints[id] = config.routes[id].file + "?browser";
7172
}
7273

73-
let plugins = [
74+
let plugins: esbuild.Plugin[] = [
7475
deprecatedRemixPackagePlugin(options.onWarning),
7576
cssFilePlugin(options),
7677
urlImportsPlugin(),
@@ -128,9 +129,12 @@ export const createBrowserCompiler = (
128129
metafile: true,
129130
incremental: true,
130131
});
131-
metafile = compiler.metafile!;
132+
invariant(compiler.metafile, "Expected metafile to be defined");
133+
metafile = compiler.metafile;
132134
} else {
133-
metafile = (await compiler.rebuild()).metafile!;
135+
let rebuild = await compiler.rebuild();
136+
invariant(rebuild.metafile, "Expected metafile to be defined");
137+
metafile = rebuild.metafile;
134138
}
135139
let manifest = await createAssetsManifest(remixConfig, metafile);
136140
manifestChannel.write(manifest);

packages/remix-dev/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"chalk": "^4.1.2",
3333
"chokidar": "^3.5.1",
3434
"dotenv": "^16.0.0",
35-
"esbuild": "0.15.12",
35+
"esbuild": "0.16.3",
3636
"execa": "5.1.1",
3737
"exit-hook": "2.2.1",
3838
"express": "^4.17.1",

0 commit comments

Comments
 (0)