-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into brophdawg11/pathless-route-collision-3
- Loading branch information
Showing
510 changed files
with
26,870 additions
and
23,009 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"remix": patch | ||
"@remix-run/cloudflare": patch | ||
"@remix-run/cloudflare-workers": patch | ||
--- | ||
|
||
Update Cloudflare Workers adapter's `RequestHandler` type to be in line with other adapters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@remix-run/cloudflare": minor | ||
--- | ||
|
||
Rename `createCloudflareKVSessionStorage` to `createWorkersKVSessionStorage` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@remix-run/node": minor | ||
--- | ||
|
||
Add `remove` and `getFilePath` methods to `NodeOnDiskFile` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
--- | ||
"remix": minor | ||
"@remix-run/dev": minor | ||
"@remix-run/react": minor | ||
"@remix-run/serve": minor | ||
"@remix-run/server-runtime": minor | ||
--- | ||
|
||
# The new dev server | ||
|
||
The new dev flow is to spin up the dev server _alongside_ your normal Remix app server: | ||
|
||
```sh | ||
# spin up the new dev server | ||
remix dev | ||
|
||
# spin up your app server in a separate tab or via `concurrently` | ||
nodemon ./server.js | ||
``` | ||
|
||
The dev server will build your app in dev mode and then rebuild whenever any app files change. | ||
It will also wait for your app server to be "ready" (more on this later) before triggering a live reload in your browser. | ||
|
||
## Benefits | ||
|
||
- Navigations no longer wipe in-memory references (e.g. database connections, in-memory caches, etc...). That means no need to use `global` trick anymore. | ||
- Supports _any_ app server, not just the Remix App Server. | ||
- Automatically wires up the live reload port for you (no need for you to mess with env vars for that anymore) | ||
|
||
## App server picks up changes | ||
|
||
Use `nodemon` (or similar) so that your app server restarts and picks up changes after a rebuild finishes. | ||
|
||
For example, you can use `wrangler --watch` for Cloudflare. | ||
|
||
Alternatively, you can roll your own with `chokidar` (or similar) if you want to still use the `global` trick to persist in-memory stuff across rebuilds. | ||
|
||
## Configure | ||
|
||
To enable the new dev server with all defaults, set the `unstable_dev` future flag to `true`: | ||
|
||
```js | ||
// remix.config.js | ||
|
||
module.exports = { | ||
future: { | ||
unstable_dev: true, | ||
}, | ||
}; | ||
``` | ||
|
||
You can also set specific options: | ||
|
||
```js | ||
// remix.config.js | ||
|
||
module.exports = { | ||
future: { | ||
unstable_dev: { | ||
// Port to use for the dev server (i.e. the live reload websocket) | ||
// Can be overridden by a CLI flag: `remix dev --port 3011` | ||
// default: finds an empty port and uses that | ||
port: 3010, | ||
|
||
// Port for your running Remix app server | ||
// Can be overridden by a CLI flag: `remix dev --app-server-port 3021` | ||
// default: `3000` | ||
appServerPort: 3020, | ||
|
||
// Path to the Remix request handler in your app server | ||
// Most app server will route all requests to the Remix request handler and will not need to set this option. | ||
// If your app server _does_ route only certain request paths to the Remix request handler, then you'll need to set this. | ||
// default: `""` | ||
remixRequestHandlerPath: "/products", | ||
|
||
// Milliseconds between "readiness" pings to your app server | ||
// When a Remix rebuild finishes, the dev server will ping a special endpoint (`__REMIX_ASSETS_MANIFEST`) | ||
// to check if your app server is serving up-to-date routes and assets. | ||
// You can set this option to tune how frequently the dev server polls your app server. | ||
// default: `50` | ||
rebuildPollIntervalMs: 25, | ||
}, | ||
}, | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"remix": patch | ||
"@remix-run/testing": patch | ||
--- | ||
|
||
Ensure all routes have IDs when using the `createRemixStub` testing helper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"remix": patch | ||
"@remix-run/node": patch | ||
--- | ||
|
||
Export `JsonFunction` as a type in `@remix-run/node` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@remix-run/server-runtime": minor | ||
--- | ||
|
||
remove `react` & `react-dom` from `peerDependencies` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"remix": patch | ||
"@remix-run/cloudflare": patch | ||
"@remix-run/deno": patch | ||
--- | ||
|
||
Export `JsonFunction` type in `@remix-run/cloudflare` and `@remix-run/deno` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
"remix": patch | ||
"@remix-run/dev": patch | ||
--- | ||
|
||
When running the dev server (current or `unstable_dev`), each rebuild wrote new files to `build/` and `public/build/`. | ||
Since these files are not removed (unless the dev server crashes or is gracefully terminated), | ||
thousands of files could accumulate as the dev server ran. | ||
This causes performance issues and could be confusing. | ||
|
||
Now, the dev server also cleans up the build directories whenever a rebuild starts. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"remix": patch | ||
"@remix-run/react": patch | ||
--- | ||
|
||
Configure the browser-side live reload socket timeout via the new `timeoutMs` prop on `<LiveReload />` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@remix-run/react": patch | ||
--- | ||
|
||
Added support for `unstable_useBlocker` and `unstable_usePrompt` from React Router |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,8 @@ jobs: | |
|
||
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.FORMAT_PAT }} | ||
|
||
- name: ⎔ Setup node | ||
uses: actions/setup-node@v3 | ||
|
@@ -43,8 +45,8 @@ jobs: | |
|
||
- name: 💪 Commit | ||
run: | | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Remix Run Bot" | ||
git add . | ||
if [ -z "$(git status --porcelain)" ]; then | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
name: 🌒 Nightly Release | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 7 * * *" # every day at 12AM PST | ||
|
||
|
@@ -41,49 +42,43 @@ jobs: | |
- name: 📥 Install deps | ||
run: yarn --frozen-lockfile | ||
|
||
- name: ⤴️ Update Version if needed | ||
- name: 🕵️ Check for changes | ||
id: version | ||
run: | | ||
# get latest commit sha | ||
SHA=$(git rev-parse HEAD) | ||
# get first 7 characters of sha | ||
SHORT_SHA=${SHA::7} | ||
# get latest nightly tag | ||
LATEST_NIGHTLY_TAG=$(git tag -l v0.0.0-nightly-\* --sort=-committerdate | head -n 1) | ||
CHANGES=$(git diff $LATEST_NIGHTLY_TAG..dev -- ./packages/ -- ':!packages/**/package.json') | ||
# check if there are changes to ./packages | ||
if [[ -n $(echo $CHANGES | xargs) ]]; then | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Remix Run Bot" | ||
# check if last commit to dev starts would be the nightly tag we're about to create (minus the date) | ||
# if it is, we'll skip the nightly creation | ||
# if not, we'll create a new nightly tag | ||
if [[ ${LATEST_NIGHTLY_TAG} == v0.0.0-nightly-${SHORT_SHA}-* ]]; then | ||
echo "🛑 Latest nightly tag is the same as the latest commit sha, skipping nightly release" | ||
else | ||
# yyyyMMdd format (e.g. 20221207) | ||
DATE=$(date '+%Y%m%d') | ||
# v0.0.0-nightly-<short sha>-<date> | ||
NEXT_VERSION=0.0.0-nightly-${SHORT_SHA}-${DATE} | ||
echo ::set-output name=NEXT_VERSION::${NEXT_VERSION} | ||
git checkout -b nightly/${NEXT_VERSION} | ||
if [ -z "$(git status --porcelain)" ]; then | ||
echo "✨" | ||
else | ||
echo "dirty working directory..." | ||
git add . | ||
git commit -m "dirty working directory..." | ||
fi | ||
yarn run version ${NEXT_VERSION} --skip-prompt | ||
else | ||
echo "🛑 no changes since last nightly, skipping..." | ||
# set output so it can be used in other jobs | ||
echo "NEXT_VERSION=${NEXT_VERSION}" >> $GITHUB_OUTPUT | ||
fi | ||
- name: 🏗 Build | ||
- name: ⤴️ Update version | ||
if: steps.version.outputs.NEXT_VERSION | ||
run: yarn build | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Remix Run Bot" | ||
git checkout -b nightly/${{steps.version.outputs.NEXT_VERSION}} | ||
yarn run version ${{steps.version.outputs.NEXT_VERSION}} --skip-prompt | ||
git push origin --tags | ||
- name: 🏷 Push Tag | ||
- name: 🏗 Build | ||
if: steps.version.outputs.NEXT_VERSION | ||
run: git push origin --tags | ||
run: yarn build | ||
|
||
- name: 🔐 Setup npm auth | ||
if: steps.version.outputs.NEXT_VERSION | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.