Skip to content

Commit

Permalink
Merge branch 'dev' into brophdawg11/pathless-route-collision-3
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Jan 24, 2023
2 parents 5bab975 + 57004e3 commit 4d6ac17
Show file tree
Hide file tree
Showing 510 changed files with 26,870 additions and 23,009 deletions.
7 changes: 7 additions & 0 deletions .changeset/afraid-hounds-join.md
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
5 changes: 5 additions & 0 deletions .changeset/breezy-dancers-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/cloudflare": minor
---

Rename `createCloudflareKVSessionStorage` to `createWorkersKVSessionStorage`
7 changes: 6 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"@remix-run/cloudflare",
"@remix-run/cloudflare-pages",
"@remix-run/cloudflare-workers",
"@remix-run/css-bundle",
"@remix-run/deno",
"@remix-run/dev",
"@remix-run/eslint-config",
Expand All @@ -19,12 +20,16 @@
"@remix-run/react",
"@remix-run/serve",
"@remix-run/server-runtime",
"@remix-run/testing",
"@remix-run/vercel"
]
],
"linked": [],
"access": "public",
"baseBranch": "dev",
"updateInternalDependencies": "patch",
"ignore": []
"ignore": [],
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
}
}
5 changes: 5 additions & 0 deletions .changeset/flat-cobras-beam.md
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`
85 changes: 85 additions & 0 deletions .changeset/mean-clocks-bow.md
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,
},
},
};
```
6 changes: 6 additions & 0 deletions .changeset/mighty-beans-judge.md
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
6 changes: 6 additions & 0 deletions .changeset/old-rice-drive.md
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`
5 changes: 5 additions & 0 deletions .changeset/short-bobcats-switch.md
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`
7 changes: 7 additions & 0 deletions .changeset/silver-rockets-remember.md
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`
6 changes: 0 additions & 6 deletions .changeset/stupid-games-build.md

This file was deleted.

11 changes: 11 additions & 0 deletions .changeset/tender-turtles-wash.md
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.
6 changes: 6 additions & 0 deletions .changeset/wild-foxes-wait.md
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 />`
8 changes: 0 additions & 8 deletions .changeset/witty-kiwis-flow.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/yellow-ligers-clean.md
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
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
**/build/
**/tests/__snapshots/
**/node_modules/
!.eslintrc.js
.tmp
/playground
**/__tests__/fixtures
**/__tests__/**/*/fixtures
/packages/*/dist/

# Deno
integration/helpers/deno-template
Expand Down
14 changes: 14 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ module.exports = {
],
plugins: ["markdown"],
overrides: [
{
files: ["**/*.md/**"],
rules: {
"import/no-extraneous-dependencies": OFF,
"no-dupe-keys": OFF,
"no-undef": OFF,
"no-unused-expressions": OFF,
"no-unused-vars": OFF,
},
},
{
files: ["rollup.config.js"],
rules: {
Expand All @@ -24,4 +34,8 @@ module.exports = {
},
},
],
// Report unused `eslint-disable` comments.
reportUnusedDisableDirectives: true,
// Tell ESLint not to ignore dot-files, which are ignored by default.
ignorePatterns: ["!.*.js"],
};
6 changes: 4 additions & 2 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/merged-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ on:
types: [closed]
branches:
- dev
paths:
- "packages/**"

permissions:
pull-requests: write

jobs:
if_merged:
merged:
name: Add label to merged PR
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
Expand Down
49 changes: 22 additions & 27 deletions .github/workflows/nightly.yml
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

Expand Down Expand Up @@ -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
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/no-response.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: 🥺 No Response

on:
issue_comment:
types: [created]
schedule:
# Schedule for five minutes after the hour, every hour
- cron: "5 * * * *"
Expand All @@ -12,14 +10,14 @@ permissions:
pull-requests: write

jobs:
noResponse:
stale:
if: github.repository == 'remix-run/remix'
runs-on: ubuntu-latest

steps:
- name: 🥺 Handle Ghosting
uses: actions/stale@v5
uses: actions/stale@v7
with:
days-before-close: 10
close-issue-message: >
This issue has been automatically closed because we haven't received a
response from the original author 🙈. This automation helps keep the issue
Expand All @@ -30,8 +28,7 @@ jobs:
response from the original author 🙈. This automation helps keep the issue
tracker clean from PRs that are unactionable. Please reach out if you
have more information for us! 🙂
days-before-close: 10
# don't automatically mark issues/PRs as stale
days-before-stale: -1
any-of-labels: needs-response
labels-to-remove-when-unstale: needs-response
stale-issue-label: needs-response
stale-pr-label: needs-response
Loading

0 comments on commit 4d6ac17

Please sign in to comment.