Skip to content

Commit

Permalink
Merge branch 'dev' into loaderfunction-type
Browse files Browse the repository at this point in the history
  • Loading branch information
pcattori committed Aug 10, 2023
2 parents d8950d4 + 1d41751 commit d466256
Show file tree
Hide file tree
Showing 249 changed files with 2,006 additions and 3,736 deletions.
5 changes: 0 additions & 5 deletions .changeset/big-papayas-jam.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/brown-gifts-chew.md

This file was deleted.

4 changes: 1 addition & 3 deletions .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@
"@remix-run/dev",
"@remix-run/eslint-config",
"@remix-run/express",
"@remix-run/netlify",
"@remix-run/node",
"@remix-run/react",
"@remix-run/serve",
"@remix-run/server-runtime",
"@remix-run/testing",
"@remix-run/vercel"
"@remix-run/testing"
]
],
"linked": [],
Expand Down
5 changes: 5 additions & 0 deletions .changeset/deduplicate-prefetch-link-tags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/react": patch
---

Deduplicate prefetch link tags
5 changes: 5 additions & 0 deletions .changeset/disabled-link-preload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/react": patch
---

Add `<link rel="preload">` timeout counter and disabling logic in case preloading is disabled by the user in Firefox. This prevents us from hanging on client-side navigations when we try to preload stylesheets and never receive a `load`/`error` event on the `link` tag.
5 changes: 5 additions & 0 deletions .changeset/empty-cameras-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": patch
---

allow non-development modes for remix watch
13 changes: 13 additions & 0 deletions .changeset/fair-falcons-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"@remix-run/vercel": major
---

The `@remix-run/vercel` runtime adapter has been removed in favor of out of the box Vercel functionality. Please update
your code by removing `@remix-run/vercel` & `@vercel/node` from your `package.json`, removing your
`server.ts`/`server.js` file, and removing the `server` & `serverBuildPath` options from your `remix.config.js`. ((#7035)[https://github.com/remix-run/remix/pull/7035])

Due to the removal of this adapter, we also removed our [Vercel template][vercel-template] in favor of the
[official Vercel template][official-vercel-template] ((#6784)[https://github.com/remix-run/remix/pull/6784]).

[vercel-template]: https://github.com/remix-run/remix/tree/main/templates/vercel
[official-vercel-template]: https://github.com/vercel/vercel/tree/main/examples/remix
5 changes: 5 additions & 0 deletions .changeset/global-fetch-instanceof.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/node": patch
---

ensures fetch() return is instanceof global Response by removing extended classes for NodeRequest and NodeResponse in favor of custom interface type cast.
6 changes: 6 additions & 0 deletions .changeset/kind-grapes-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"create-remix": major
"@remix-run/dev": major
---

Stop passing `isTypeScript` to `remix.init` script
5 changes: 5 additions & 0 deletions .changeset/lovely-drinks-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": patch
---

allow jsx in js files during hmr
5 changes: 5 additions & 0 deletions .changeset/olive-lemons-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/react": patch
---

Use unique key for `script:ld+json` meta descriptors
2 changes: 0 additions & 2 deletions .changeset/purple-zoos-refuse.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
"@remix-run/deno": major
"@remix-run/dev": major
"@remix-run/express": major
"@remix-run/netlify": major
"@remix-run/node": major
"@remix-run/react": major
"@remix-run/serve": major
"@remix-run/server-runtime": major
"@remix-run/testing": major
"@remix-run/vercel": major
---

Require Node >=18.0.0
17 changes: 17 additions & 0 deletions .changeset/strong-rice-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"@remix-run/netlify": major
---

The `@remix-run/netlify` runtime adapter has removed in favor of [`@netlify/remix-adapter`][official-netlify-adapter]
& [`@netlify/remix-edge-adapter`][official-netlify-edge-adapter]. Please update your code by changing all
`@remix-run/netlify` imports to `@netlify/remix-adapter`.
Keep in mind that `@netlify/remix-adapter` requires `@netlify/functions@^1.0.0`, which is a breaking change compared
to the previous supported `@netlify/functions` versions in `@remix-run/netlify`.

Due to the removal of this adapter, we also removed our [Netlify template][netlify-template] in favor of the
[official Netlify template][official-netlify-template].

[official-netlify-adapter]: https://github.com/netlify/remix-compute/tree/main/packages/remix-adapter
[official-netlify-edge-adapter]: https://github.com/netlify/remix-compute/tree/main/packages/remix-edge-adapter
[netlify-template]: https://github.com/remix-run/remix/tree/main/templates/netlify
[official-netlify-template]: https://github.com/netlify/remix-template
5 changes: 5 additions & 0 deletions .changeset/tasty-apricots-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/server-runtime": patch
---

correctly infer deferred types for top-level promises
6 changes: 6 additions & 0 deletions .changeset/v2-default-to-esm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@remix-run/dev": major
"@remix-run/serve": major
---

Default to serverModuleFormat esm, and update remix-serve to use dynamic import to support esm and cjs build outputs.
2 changes: 0 additions & 2 deletions .changeset/v2-remove-auto-globals-install.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
---
"@remix-run/architect": major
"@remix-run/express": major
"@remix-run/netlify": major
"@remix-run/node": major
"@remix-run/serve": major
"@remix-run/vercel": major
---

For preparation of using Node's built in fetch implementation, installing the fetch globals is now a responsibility of the app server. 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.
Expand Down
5 changes: 5 additions & 0 deletions .changeset/wild-garlics-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": patch
---

allow any mode (NODE_ENV)
5 changes: 5 additions & 0 deletions .changeset/xdm-to-mdx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": patch
---

Replace the deprecated [`xdm`](https://github.com/wooorm/xdm) package with [`@mdx-js/mdx`](https://github.com/mdx-js/mdx)
44 changes: 44 additions & 0 deletions .github/workflows/deduplicate-yarn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: ⚙️ Deduplicate yarn.lock

on:
push:
branches:
- dev
paths:
- yarn.lock

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

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

steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3

- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: "yarn"

- name: ️️⚙️ Deduplicate yarn.lock
run: npx yarn-deduplicate && rm -rf ./node_modules && yarn

- name: 💪 Commit
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
if [ -z "$(git status --porcelain)" ]; then
echo "💿 no deduplication needed"
exit 0
fi
git commit -m "chore: deduplicate `yarn.lock`"
git push
echo "💿 https://github.com/$GITHUB_REPOSITORY/commit/$(git rev-parse HEAD)"
77 changes: 0 additions & 77 deletions .github/workflows/deployments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ on:
required: true
TEST_FLY_TOKEN:
required: true
TEST_NETLIFY_TOKEN:
required: true
TEST_VERCEL_TOKEN:
required: true
TEST_VERCEL_USER_ID:
required: true

jobs:
arc_deploy:
Expand Down Expand Up @@ -222,74 +216,3 @@ jobs:
working-directory: ./scripts/deployment-test
env:
FLY_API_TOKEN: ${{ secrets.TEST_FLY_TOKEN }}

netlify_deploy:
name: "Netlify Deploy"
if: github.repository == 'remix-run/remix'
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0

- name: ⬇️ Checkout repo
uses: actions/checkout@v3

- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: ./scripts/deployment-test/package.json # no lockfile, key caching off package.json

# some deployment targets require the latest version of npm
# TODO: remove this eventually when the default version we get
# is "latest" enough.
- name: 📦 Install latest version of npm
run: npm install -g npm@latest
working-directory: ./scripts/deployment-test

- name: 📥 Install deployment-test deps
run: npm install
working-directory: ./scripts/deployment-test

- name: 🚀 Deploy to Netlify
run: node ./netlify.mjs
working-directory: ./scripts/deployment-test
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.TEST_NETLIFY_TOKEN }}

vercel_deploy:
name: "Vercel Deploy"
if: github.repository == 'remix-run/remix'
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0

- name: ⬇️ Checkout repo
uses: actions/checkout@v3

- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: ./scripts/deployment-test/package.json # no lockfile, key caching off package.json

# some deployment targets require the latest version of npm
# TODO: remove this eventually when the default version we get
# is "latest" enough.
- name: 📦 Install latest version of npm
run: npm install -g npm@latest
working-directory: ./scripts/deployment-test

- name: 📥 Install deployment-test deps
run: npm install
working-directory: ./scripts/deployment-test

- name: 🚀 Deploy to Vercel
run: node ./vercel.mjs
working-directory: ./scripts/deployment-test
env:
VERCEL_TOKEN: ${{ secrets.TEST_VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.TEST_VERCEL_USER_ID }}
3 changes: 0 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ jobs:
TEST_CF_API_TOKEN: ${{ secrets.TEST_CF_API_TOKEN }}
TEST_DENO_DEPLOY_TOKEN: ${{ secrets.TEST_DENO_DEPLOY_TOKEN }}
TEST_FLY_TOKEN: ${{ secrets.TEST_FLY_TOKEN }}
TEST_NETLIFY_TOKEN: ${{ secrets.TEST_NETLIFY_TOKEN }}
TEST_VERCEL_TOKEN: ${{ secrets.TEST_VERCEL_TOKEN }}
TEST_VERCEL_USER_ID: ${{ secrets.TEST_VERCEL_USER_ID }}

stacks:
needs: [nightly]
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ jobs:
TEST_CF_API_TOKEN: ${{ secrets.TEST_CF_API_TOKEN }}
TEST_DENO_DEPLOY_TOKEN: ${{ secrets.TEST_DENO_DEPLOY_TOKEN }}
TEST_FLY_TOKEN: ${{ secrets.TEST_FLY_TOKEN }}
TEST_NETLIFY_TOKEN: ${{ secrets.TEST_NETLIFY_TOKEN }}
TEST_VERCEL_TOKEN: ${{ secrets.TEST_VERCEL_TOKEN }}
TEST_VERCEL_USER_ID: ${{ secrets.TEST_VERCEL_USER_ID }}

stacks:
name: 🥞 Remix Stacks Test
Expand Down
3 changes: 3 additions & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
- jacargentina
- jacob-ebey
- JacobParis
- jacobwgillespie
- jack-r-warren
- jakeginnivan
- jakewtaylor
Expand All @@ -230,6 +231,7 @@
- jaydiablo
- jca41
- jdeniau
- jeeyoungk
- JeffBeltran
- jenseng
- jeremyjfleming
Expand Down Expand Up @@ -534,6 +536,7 @@
- vorcigernix
- wangbinyq
- weavdale
- wilcoschoneveld
- willhack
- willin
- wizardlyhel
Expand Down
20 changes: 4 additions & 16 deletions docs/components/nav-link.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,29 +85,17 @@ You can pass a render prop as children to customize the content of the `<NavLink

The `end` prop changes the matching logic for the `active` and `pending` states to only match to the "end" of the NavLinks's `to` path. If the URL is longer than `to`, it will no longer be considered active.

Without the end prop, this link is always active because every URL matches `/`.

```tsx
<NavLink to="/">Home</NavLink>
```

To match the URL "to the end" of `to`, use `end`:

```tsx
<NavLink to="/" end>
Home
</NavLink>
```

Now this link will only be active at `"/"`. This works for paths with more segments as well:

| Link | URL | isActive |
| ----------------------------- | ------------ | -------- |
| `<NavLink to="/tasks" />` | `/tasks` | true |
| `<NavLink to="/tasks" />` | `/tasks/123` | true |
| `<NavLink to="/tasks" end />` | `/tasks` | true |
| `<NavLink to="/tasks" end />` | `/tasks/123` | false |

**A note on links to the root route**

`<NavLink to="/">` is an exceptional case because _every_ URL matches `/`. To avoid this matching every single route by default, it effectively ignores the `end` prop and only matches when you're at the root route.

## `caseSensitive`

Adding the `caseSensitive` prop changes the matching logic to make it case sensitive.
Expand Down

0 comments on commit d466256

Please sign in to comment.