Skip to content

Commit

Permalink
Merge branch 'dev' into chance/changesets-peer-deps-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chaance committed Dec 13, 2022
2 parents 67ea5e0 + 41a1042 commit 0829631
Show file tree
Hide file tree
Showing 234 changed files with 8,112 additions and 6,471 deletions.
1 change: 1 addition & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@remix-run/react",
"@remix-run/serve",
"@remix-run/server-runtime",
"@remix-run/testing",
"@remix-run/vercel"
]
],
Expand Down
5 changes: 5 additions & 0 deletions .changeset/early-camels-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/react": patch
---

Update `@remix-run/react` to use `Router` from `react-router-dom@6.4.4`
8 changes: 8 additions & 0 deletions .changeset/fresh-shrimps-join.md
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions .changeset/late-files-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/react": patch
---

Allow pass-through props to be passed to the script rendered by `ScrollRestoration`
28 changes: 28 additions & 0 deletions .changeset/light-sheep-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
"remix": patch
"@remix-run/serve": patch
"@remix-run/server-runtime": patch
---

Fix `TypedResponse` so that Typescript correctly shows errors for incompatible types in loaders and actions.

Previously, when the return type of a loader or action was explicitly set to `TypedResponse<SomeType>`,
Typescript would not show errors when the loader or action returned an incompatible type.

For example:

```ts
export const action = async (
args: ActionArgs
): Promise<TypedResponse<string>> => {
return json(42);
};
```

In this case, Typescript would not show an error even though `42` is clearly not a `string`.

This happens because `json` returns a `TypedResponse<string>`,
but because `TypedReponse<string>` was previously just `Response & { json: () => Promise<string> }`
and `Response` already defines `{ json: () => Promise<any> }`, type erasure caused `Promise<any>` to be used for `42`.

To fix this, we explicitly omit the `Response`'s `json` property before intersecting with `{ json: () => Promise<T> }`.
11 changes: 11 additions & 0 deletions .changeset/metal-impalas-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"remix": patch
"@remix-run/dev": patch
---

Optimize `parentRouteId` lookup in `defineConventionalRoutes`

Local runs of production Remix builds:

- Realistic project w/ 700 routes: 10-15s -> <1s (>10x faster)
- Example project w/ 1,111 routes: 27s -> 0.104s (259x faster)
29 changes: 29 additions & 0 deletions .changeset/moody-pants-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
"@remix-run/dev": patch
---

Convention for Remix optional segments

Note that this only set ups the convention conversion for React Router.
Optional segments won't be available in Remix until Remix is built on top of React Router v6.5

Converts segments surrounded by parenthesis into optional segments for React Router.
For example `/($lang)/about` will be converted to `/:lang?/about` in React Router.

This means `/($lang)/about` would match:

```
/en/about
/fr/about
/about
```

Another example: `/(one)/($two)/(three).($four)` route would match all of the following:

```
/
/one
/one/param1
/one/param1/three
/one/param1/three/param2
```
9 changes: 9 additions & 0 deletions .changeset/poor-shrimps-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"remix": patch
"@remix-run/react": patch
"@remix-run/serve": patch
"@remix-run/server-runtime": patch
"@remix-run/testing": patch
---

adds a new testing package to allow easier testing of components using Remix specific apis like useFetcher, useActionData, etc.
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
35 changes: 19 additions & 16 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,41 +38,36 @@ jobs:
node-version-file: ".nvmrc"
cache: "yarn"

- name: 🦕 Setup deno
uses: denoland/setup-deno@v1
with:
deno-version: vx.x.x

- 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)
# get changes since last nightly
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 "hello@remix.run"
git config --local user.name "Remix Run Bot"
# 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}
# set output so it can be used in other jobs
echo "NEXT_VERSION=${NEXT_VERSION}" >> $GITHUB_OUTPUT
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..."
fi
Expand All @@ -81,6 +76,14 @@ jobs:
if: steps.version.outputs.NEXT_VERSION
run: yarn build

- name: ⤴️ Update version
if: steps.version.outputs.NEXT_VERSION
run: |
git config --local user.email "hello@remix.run"
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
- name: 🏷 Push Tag
if: steps.version.outputs.NEXT_VERSION
run: git push origin --tags
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/postrelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
tags:
# only run on `remix` tags
- "remix@*"
- remix@**

jobs:
comment:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/reusable-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@ on:
# but we want to pass an array (node_version: "[14, 16, 18]"),
# so we'll need to manually stringify it for now
type: string
enable_remix_router:
required: false
type: string

env:
CI: true
CYPRESS_INSTALL_BINARY: 0
ENABLE_REMIX_ROUTER: ${{ inputs.enable_remix_router }}

jobs:
build:
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,3 @@ jobs:
uses: ./.github/workflows/reusable-test.yml
with:
node_version: '["latest"]'

test-experimental:
if: github.repository == 'remix-run/remix'
uses: ./.github/workflows/reusable-test.yml
with:
node_version: '["latest"]'
enable_remix_router: "1"
13 changes: 12 additions & 1 deletion contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@
- ashleyryan
- ashocean
- athongsavath
- AustinGil
- awthwathje
- axel-habermaier
- BasixKOR
- benwis
- BenMcH
- benwis
- bgschiller
- binajmen
- bmarvinb
Expand All @@ -66,6 +67,7 @@
- ccssmnn
- cephalization
- chaance
- chaukhoa97
- chenc041
- chenxsan
- chiangs
Expand Down Expand Up @@ -100,6 +102,7 @@
- dhargitai
- dhmacs
- dima-takoy
- dmarkow
- DNLHC
- dogukanakkaya
- dokeet
Expand All @@ -118,6 +121,7 @@
- edmundhung
- efkann
- eldarshamukhamedov
- eltociear
- emzoumpo
- eps1lon
- esamattis
Expand Down Expand Up @@ -254,6 +258,7 @@
- lili21
- lionotm
- liranm
- lordofthecactus
- lpsinger
- lswest
- lucasdibz
Expand Down Expand Up @@ -307,6 +312,7 @@
- mikeybinnswebdesign
- mirzafaizan
- mjackson
- mjangir
- mkrtchian
- mochi-sann
- mohammadhosseinbagheri
Expand Down Expand Up @@ -346,6 +352,7 @@
- phishy
- plastic041
- plondon
- pmbanugo
- princerajroy
- prvnbist
- ptitFicus
Expand All @@ -363,6 +370,7 @@
- roachjc
- robindrost
- roddds
- roj1512
- RomanSavarin
- ronnylt
- rossipedia
Expand Down Expand Up @@ -391,6 +399,7 @@
- sergiodxa
- shairez
- shashankboosi
- shubhaguha
- shumuu
- sidkh
- sidv1905
Expand Down Expand Up @@ -452,3 +461,5 @@
- zachdtaylor
- zainfathoni
- zhe
- dabdine
- akamfoad
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Deno has three ways to manage dependencies:
2. [deps.ts](https://deno.land/manual/examples/manage_dependencies)
3. [Import maps](https://deno.land/manual/linking_to_external_code/import_maps)

Additionally, NPM packages can be accessed as Deno modules via [Deno-friendly CDNs](https://deno.land/manual/node/cdns#deno-friendly-cdns) like https://esm.sh .
Additionally, NPM packages can be accessed as Deno modules via [Deno-friendly CDNs](https://deno.land/manual/node/cdns#deno-friendly-cdns) like https://esm.sh.

Remix has some requirements around dependencies:

Expand Down Expand Up @@ -78,7 +78,7 @@ Remix will not yet support import maps.

## Consequences

- URL imports will not be treeshaken
- URL imports will not be treeshaken.
- Users can specify environment via the `NODE_ENV` environment variable at runtime.
- Users won't have to do error-prone, manual dependency resolution.

Expand Down
Loading

0 comments on commit 0829631

Please sign in to comment.