@remix-run/serve
Advanced tools
Comparing version 0.0.0-nightly-1a57073-20230907 to 0.0.0-nightly-1ac5c50dd-20240726
246
CHANGELOG.md
# `@remix-run/serve` | ||
## 2.10.3 | ||
### Patch Changes | ||
- Updated dependencies: | ||
- `@remix-run/express@2.10.3` | ||
- `@remix-run/node@2.10.3` | ||
## 2.10.2 | ||
### Patch Changes | ||
- Updated dependencies: | ||
- `@remix-run/node@2.10.2` | ||
- `@remix-run/express@2.10.2` | ||
## 2.10.1 | ||
### Patch Changes | ||
- Updated dependencies: | ||
- `@remix-run/express@2.10.1` | ||
- `@remix-run/node@2.10.1` | ||
## 2.10.0 | ||
### Patch Changes | ||
- Upgrade `express` dependency to `^4.19.2` ([#9184](https://github.com/remix-run/remix/pull/9184)) | ||
- Updated dependencies: | ||
- `@remix-run/express@2.10.0` | ||
- `@remix-run/node@2.10.0` | ||
## 2.9.2 | ||
### Patch Changes | ||
- Updated dependencies: | ||
- `@remix-run/node@2.9.2` | ||
- `@remix-run/express@2.9.2` | ||
## 2.9.1 | ||
### Patch Changes | ||
- Updated dependencies: | ||
- `@remix-run/express@2.9.1` | ||
- `@remix-run/node@2.9.1` | ||
## 2.9.0 | ||
### Minor Changes | ||
- Put `undici` fetch polyfill behind a new `installGlobals({ nativeFetch: true })` parameter ([#9198](https://github.com/remix-run/remix/pull/9198)) | ||
- `remix-serve` will default to using `undici` for the fetch polyfill if `future.unstable_singleFetch` is enabled because the single fetch implementation relies on the `undici` polyfill | ||
- Any users opting into Single Fetch and managing their own polyfill will need to pass the flag to `installGlobals` on their own to avoid runtime errors with Single Fetch | ||
### Patch Changes | ||
- Updated dependencies: | ||
- `@remix-run/node@2.9.0` | ||
- `@remix-run/express@2.9.0` | ||
## 2.8.1 | ||
### Patch Changes | ||
- Updated dependencies: | ||
- `@remix-run/express@2.8.1` | ||
- `@remix-run/node@2.8.1` | ||
## 2.8.0 | ||
### Patch Changes | ||
- Updated dependencies: | ||
- `@remix-run/express@2.8.0` | ||
- `@remix-run/node@2.8.0` | ||
## 2.7.2 | ||
### Patch Changes | ||
- Updated dependencies: | ||
- `@remix-run/express@2.7.2` | ||
- `@remix-run/node@2.7.2` | ||
## 2.7.1 | ||
### Patch Changes | ||
- Updated dependencies: | ||
- `@remix-run/express@2.7.1` | ||
- `@remix-run/node@2.7.1` | ||
## 2.7.0 | ||
### Patch Changes | ||
- Updated dependencies: | ||
- `@remix-run/express@2.7.0` | ||
- `@remix-run/node@2.7.0` | ||
## 2.6.0 | ||
### Patch Changes | ||
- Updated dependencies: | ||
- `@remix-run/node@2.6.0` | ||
- `@remix-run/express@2.6.0` | ||
## 2.5.1 | ||
### Patch Changes | ||
- Updated dependencies: | ||
- `@remix-run/express@2.5.1` | ||
- `@remix-run/node@2.5.1` | ||
## 2.5.0 | ||
### Patch Changes | ||
- Don't try to load sourcemaps if they don't exist on disk ([#8446](https://github.com/remix-run/remix/pull/8446)) | ||
- Updated dependencies: | ||
- `@remix-run/node@2.5.0` | ||
- `@remix-run/express@2.5.0` | ||
## 2.4.1 | ||
### Patch Changes | ||
- Use node `fileURLToPath` to convert source map URL to path ([#8321](https://github.com/remix-run/remix/pull/8321)) | ||
- Updated dependencies: | ||
- `@remix-run/node@2.4.1` | ||
- `@remix-run/express@2.4.1` | ||
## 2.4.0 | ||
### Patch Changes | ||
- Fix source map loading when file has `?t=timestamp` suffix (rebuilds) ([#8174](https://github.com/remix-run/remix/pull/8174)) | ||
- Updated dependencies: | ||
- `@remix-run/node@2.4.0` | ||
- `@remix-run/express@2.4.0` | ||
## 2.3.1 | ||
### Patch Changes | ||
- Updated dependencies: | ||
- `@remix-run/express@2.3.1` | ||
- `@remix-run/node@2.3.1` | ||
## 2.3.0 | ||
### Patch Changes | ||
- Updated dependencies: | ||
- `@remix-run/express@2.3.0` | ||
- `@remix-run/node@2.3.0` | ||
## 2.2.0 | ||
### Patch Changes | ||
- Updated dependencies: | ||
- `@remix-run/express@2.2.0` | ||
- `@remix-run/node@2.2.0` | ||
## 2.1.0 | ||
### Patch Changes | ||
- Updated dependencies: | ||
- `@remix-run/express@2.1.0` | ||
- `@remix-run/node@2.1.0` | ||
## 2.0.1 | ||
### Patch Changes | ||
- Fix HMR for CJS projects using `remix-serve` and manual mode (`remix dev --manual`) ([#7487](https://github.com/remix-run/remix/pull/7487)) | ||
- By explicitly busting the `require` cache, `remix-serve` now correctly re-imports new server changes in CJS | ||
- ESM projects were already working correctly and are not affected by this. | ||
- Fix error caused by partially written server build ([#7470](https://github.com/remix-run/remix/pull/7470)) | ||
- Previously, it was possible to trigger a reimport of the app server code before the new server build had completely been written. Reimporting the partially written server build caused issues related to `build.assets` being undefined and crashing when reading `build.assets.version` | ||
- Updated dependencies: | ||
- `@remix-run/node@2.0.1` | ||
- `@remix-run/express@2.0.1` | ||
## 2.0.0 | ||
### Major Changes | ||
- `remix-serve` now picks an open port if 3000 is taken ([#7278](https://github.com/remix-run/remix/pull/7278)) | ||
- If `PORT` env var is set, `remix-serve` will use that port | ||
- Otherwise, `remix-serve` picks an open port (3000 unless that is already taken) | ||
- Integrate manual mode in `remix-serve` ([#7231](https://github.com/remix-run/remix/pull/7231)) | ||
- Remove undocumented `createApp` Node API ([#7229](https://github.com/remix-run/remix/pull/7229)) | ||
- `remix-serve` is a CLI, not a library | ||
- Require Node >=18.0.0 ([#6939](https://github.com/remix-run/remix/pull/6939)) | ||
- Promote the `future.v2_dev` flag in `remix.config.js` to a root level `dev` config ([#7002](https://github.com/remix-run/remix/pull/7002)) | ||
- Default to `serverModuleFormat: "esm"` and update `remix-serve` to use dynamic import to support ESM and CJS build outputs ([#6949](https://github.com/remix-run/remix/pull/6949)) | ||
- Preserve dynamic imports in `remix-serve` for external bundle ([#7173](https://github.com/remix-run/remix/pull/7173)) | ||
- For preparation of using Node's built in fetch implementation, installing the fetch globals is now a responsibility of the app server ([#7009](https://github.com/remix-run/remix/pull/7009)) | ||
- If you are using `remix-serve`, nothing is required | ||
- If you are using your own app server, you will need to install the globals yourself | ||
```js filename=server.js | ||
import { installGlobals } from "@remix-run/node"; | ||
installGlobals(); | ||
``` | ||
- `source-map-support` is now a responsibility of the app server ([#7009](https://github.com/remix-run/remix/pull/7009)) | ||
- If you are using `remix-serve`, nothing is required | ||
- If you are using your own app server, you will need to install [`source-map-support`](https://www.npmjs.com/package/source-map-support) yourself. | ||
```sh | ||
npm i source-map-support | ||
``` | ||
```js filename=server.js | ||
import sourceMapSupport from "source-map-support"; | ||
sourceMapSupport.install(); | ||
``` | ||
### Patch Changes | ||
- Update `remix-serve` usage error message to support ESM projects ([#7400](https://github.com/remix-run/remix/pull/7400)) | ||
- Updated dependencies: | ||
- `@remix-run/node@2.0.0` | ||
- `@remix-run/express@2.0.0` | ||
## 1.19.3 | ||
@@ -4,0 +250,0 @@ |
#!/usr/bin/env node | ||
/** | ||
* @remix-run/serve v0.0.0-nightly-1a57073-20230907 | ||
* @remix-run/serve v0.0.0-nightly-1ac5c50dd-20240726 | ||
* | ||
@@ -42,4 +42,18 @@ * Copyright (c) Remix Software Inc. | ||
process.env.NODE_ENV = process.env.NODE_ENV ?? "production"; | ||
sourceMapSupport__default["default"].install(); | ||
node.installGlobals(); | ||
sourceMapSupport__default["default"].install({ | ||
retrieveSourceMap: function (source) { | ||
let match = source.startsWith("file://"); | ||
if (match) { | ||
let filePath = url__default["default"].fileURLToPath(source); | ||
let sourceMapPath = `${filePath}.map`; | ||
if (fs__default["default"].existsSync(sourceMapPath)) { | ||
return { | ||
url: source, | ||
map: fs__default["default"].readFileSync(sourceMapPath, "utf8") | ||
}; | ||
} | ||
} | ||
return null; | ||
} | ||
}); | ||
run(); | ||
@@ -59,7 +73,13 @@ function parseNumber(raw) { | ||
console.error(` | ||
Usage: remix-serve <build-dir>`); | ||
Usage: remix-serve <server-build-path> - e.g. remix-serve build/index.js`); | ||
process.exit(1); | ||
} | ||
let buildPath = path__default["default"].resolve(buildPathArg); | ||
let versionPath = path__default["default"].resolve(buildPath, "..", "version.txt"); | ||
async function reimportServer() { | ||
Object.keys(require.cache).forEach(key => { | ||
if (key.startsWith(buildPath)) { | ||
delete require.cache[key]; | ||
} | ||
}); | ||
let stat = fs__default["default"].statSync(buildPath); | ||
@@ -78,3 +98,3 @@ | ||
} | ||
chokidar__default["default"].watch(buildPath, { | ||
chokidar__default["default"].watch(versionPath, { | ||
ignoreInitial: true | ||
@@ -96,2 +116,5 @@ }).on("add", handleServerUpdate).on("change", handleServerUpdate); | ||
let build = await reimportServer(); | ||
node.installGlobals({ | ||
nativeFetch: build.future.unstable_singleFetch | ||
}); | ||
let onListen = () => { | ||
@@ -98,0 +121,0 @@ var _Object$values$flat$f; |
MIT License | ||
Copyright (c) Remix Software Inc. 2020-2021 | ||
Copyright (c) Shopify Inc. 2022-2023 | ||
Copyright (c) Shopify Inc. 2022-2024 | ||
@@ -6,0 +6,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
{ | ||
"name": "@remix-run/serve", | ||
"version": "0.0.0-nightly-1a57073-20230907", | ||
"version": "0.0.0-nightly-1ac5c50dd-20240726", | ||
"description": "Production application server for Remix", | ||
@@ -18,7 +18,7 @@ "bugs": { | ||
"dependencies": { | ||
"@remix-run/express": "0.0.0-nightly-1a57073-20230907", | ||
"@remix-run/node": "0.0.0-nightly-1a57073-20230907", | ||
"@remix-run/express": "0.0.0-nightly-1ac5c50dd-20240726", | ||
"@remix-run/node": "0.0.0-nightly-1ac5c50dd-20240726", | ||
"chokidar": "^3.5.3", | ||
"compression": "^1.7.4", | ||
"express": "^4.17.1", | ||
"express": "^4.19.2", | ||
"get-port": "5.1.1", | ||
@@ -42,3 +42,6 @@ "morgan": "^1.10.0", | ||
"README.md" | ||
] | ||
} | ||
], | ||
"scripts": { | ||
"tsc": "tsc" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
143
20753
6
+ Added@remix-run/express@0.0.0-nightly-1ac5c50dd-20240726(transitive)
+ Added@remix-run/node@0.0.0-nightly-1ac5c50dd-20240726(transitive)
+ Added@remix-run/router@0.0.0-experimental-9ffbba722(transitive)
+ Added@remix-run/server-runtime@0.0.0-nightly-1ac5c50dd-20240726(transitive)
+ Added@types/cookie@0.6.0(transitive)
+ Addedcookie@0.6.0(transitive)
+ Addedturbo-stream@2.2.0(transitive)
+ Addedundici@6.21.0(transitive)
- Removed@remix-run/express@0.0.0-nightly-1a57073-20230907(transitive)
- Removed@remix-run/node@0.0.0-nightly-1a57073-20230907(transitive)
- Removed@remix-run/router@1.9.0-pre.0(transitive)
- Removed@remix-run/server-runtime@0.0.0-nightly-1a57073-20230907(transitive)
- Removed@types/cookie@0.4.1(transitive)
- Removedcookie@0.4.2(transitive)
- Removedtype-fest@4.29.0(transitive)
Updatedexpress@^4.19.2