Skip to content

Commit

Permalink
chore(deps): bump esbuild to latest (#4754)
Browse files Browse the repository at this point in the history
* chore: add invariant instead of using `!`

Signed-off-by: Logan McAnsh <logan@mcan.sh>

* chore(deps): bump esbuild to latest

Signed-off-by: Logan McAnsh <logan@mcan.sh>

* Create fresh-shrimps-join.md

Signed-off-by: Logan McAnsh <logan@mcan.sh>
Co-authored-by: Pedro Cattori <pcattori@gmail.com>
  • Loading branch information
mcansh and pcattori committed Dec 9, 2022
1 parent 3d5527a commit b77ba74
Show file tree
Hide file tree
Showing 6 changed files with 185 additions and 888 deletions.
8 changes: 8 additions & 0 deletions .changeset/fresh-shrimps-join.md
@@ -0,0 +1,8 @@
---
"remix": patch
"@remix-run/dev": patch
---

Support Typescript 4.9 features (like `satisfies`) in Remix `app/` code

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
10 changes: 7 additions & 3 deletions packages/remix-dev/compiler/compileBrowser.ts
Expand Up @@ -16,6 +16,7 @@ import { emptyModulesPlugin } from "./plugins/emptyModulesPlugin";
import { mdxPlugin } from "./plugins/mdx";
import { urlImportsPlugin } from "./plugins/urlImportsPlugin";
import { writeFileSafe } from "./utils/fs";
import invariant from "../invariant";

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

let plugins = [
let plugins: esbuild.Plugin[] = [
deprecatedRemixPackagePlugin(options.onWarning),
cssFilePlugin(options),
urlImportsPlugin(),
Expand Down Expand Up @@ -128,9 +129,12 @@ export const createBrowserCompiler = (
metafile: true,
incremental: true,
});
metafile = compiler.metafile!;
invariant(compiler.metafile, "Expected metafile to be defined");
metafile = compiler.metafile;
} else {
metafile = (await compiler.rebuild()).metafile!;
let rebuild = await compiler.rebuild();
invariant(rebuild.metafile, "Expected metafile to be defined");
metafile = rebuild.metafile;
}
let manifest = await createAssetsManifest(remixConfig, metafile);
manifestChannel.write(manifest);
Expand Down
2 changes: 1 addition & 1 deletion packages/remix-dev/package.json
Expand Up @@ -32,7 +32,7 @@
"chalk": "^4.1.2",
"chokidar": "^3.5.1",
"dotenv": "^16.0.0",
"esbuild": "0.15.12",
"esbuild": "0.16.3",
"execa": "5.1.1",
"exit-hook": "2.2.1",
"express": "^4.17.1",
Expand Down

0 comments on commit b77ba74

Please sign in to comment.