Skip to content

Commit

Permalink
Merge branch 'main' into canary
Browse files Browse the repository at this point in the history
  • Loading branch information
Pkmmte committed Feb 25, 2023
2 parents 74c0814 + eb69889 commit 19d3c33
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 54 deletions.
5 changes: 0 additions & 5 deletions .changeset/dirty-cycles-burn.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/eight-wolves-fry.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/weak-jobs-change.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/yellow-falcons-listen.md

This file was deleted.

30 changes: 0 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,36 +120,6 @@ const pilot = usePilot();
pilot.fly('/dashboard'); // or pilot.push('/dashboard');
```

## Supported Next.js features

| Feature | Support | Description |
|----------------------|---------------------|-------------|
| `/_app` | <center>✅</center> | Optional app wrapper is applied on pages when the [`_app`](https://nextjs.org/docs/advanced-features/custom-app) route is registered. |
| `/404` | <center>✅</center> | Rendered when page route cannot be found or when [`notFound: true`]((https://nextjs.org/docs/api-reference/data-fetching/get-server-side-props#notfound)) is returned while loading props. |
| `/500` | <center>✅</center> | Rendered when an error is thrown while loading props. |
| `/pages` | <center>✅</center> | Automatically finds routes from `/pages` or `/src/pages` directory via [`pilot build`](https://pilot.waveplay.dev/docs/cli.md) command. |
| `getServerSideProps` | <center>✅</center> | Calls this function and delegates props if it exists when loading new route. |
| `getStaticProps` | <center>✅</center> | Calls this function and delegates props if it exists when loading new route. May be skipped if props were cached. |
| `i18n` | <center>✅</center> | Supports `defaultLocale` and `locales` from next.config.js `i18n` fields. `locale` is passed as a variable in your getProps functions. [Learn more](https://pilot.waveplay.dev/docs/i18n.md). |
| `revalidate` | <center>✅</center> | Uses this field returned by your `getStaticProps` function to skip future loading for the time specified. |
| `.env` | <center>✅</center> | Environment variables are loaded during `pilot build`. This follows the [same pattern](https://nextjs.org/docs/basic-features/environment-variables#exposing-environment-variables-to-the-browser) and [load order](https://nextjs.org/docs/basic-features/environment-variables#environment-variable-load-order) as Next.js. |
| `context` | <center>🕒</center> | `context` is passed to `getServerSideProps` and `getStaticProps` functions. If haven't [set up Web Props](https://pilot.waveplay.dev/docs/web-props.md), `req` and `res` will be empty objects.<br/><br/>Fields not supported yet:<br/>`preview`, `previewData` |
| `<Link>` | <center>🕒</center> | Supports most functionality that [`next/link`](https://nextjs.org/docs/api-reference/next/link) provides.<br/><br/>Props not supported yet:<br/>`passHref`, `prefetch`, `replace`, `scroll`, `shallow` |
| `redirects` | <center>🕒</center> | Redirects are supported by [returning a `redirect` object](https://nextjs.org/docs/api-reference/data-fetching/get-server-side-props#redirect) from your props functions.<br/><br/>Redirects defined in `next.config.js` are not supported yet. |
| `useRouter` | <center>🕒</center> | Supports most functionality using the `usePilot()` hook.<br/><br/>Fields not supported yet:<br/>`basePath`, `domainLocales`, `isFallback`, `isReady`, `isPreview`.<br/><br/>Functions not supported yet:<br/>`beforePopState()`, `events()`, `prefetch()`, `replace()` |
| `/api` | <center>❌</center> | Not supported yet. |
| `getStaticPaths` | <center>❌</center> | Not supported yet. |
| `middleware` | <center>❌</center> | Not supported yet. |
| `rewrites` | <center>❌</center> | Not supported yet. |
| `withRouter` | <center>❌</center> | Not supported yet. |
| `appDir` | <center>❌</center> | Not supported yet. |
| `serverComponents` | <center>❌</center> | Not supported yet. |
| `next export` | <center>❌</center> | Not supported yet. |

> **Note:** If a feature is not in the table above, that likely means there are no plans to support it or we may have missed it. However, you can still use unsupported features in the web environment.
>
> Native apps work much differently than a server which means some features may not be possible to support. Please open an issue if you'd like to see a feature added.
## Credits

This project was originally developed as an internal router for [WavePlay](https://waveplay.com).
Expand Down
6 changes: 6 additions & 0 deletions packages/create-pilot-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# create-pilot-app

## 3.2.0

### Minor Changes

- 323afa8: chore(deps): updated dependency versions for create-pilot-app templates

## 3.1.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/create-pilot-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-pilot-app",
"version": "3.1.3",
"version": "3.2.0",
"private": false,
"description": "Create Pilot.js-powered Next.js React apps with one command",
"keywords": [
Expand Down
11 changes: 11 additions & 0 deletions packages/pilot/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Change Log

## 3.3.0

### Minor Changes

- 59977ea: feat(cli): new "up-dirs" option for better monorepo support

### Patch Changes

- 336380d: fix(cli): minor port typo in logs when running "dev" command
- 315db4c: fix(cli): commonjs config files not being recognized

## 3.2.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/pilot/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@waveplay/pilot",
"version": "3.2.0",
"version": "3.3.0",
"private": false,
"description": "NextJS-like routing for React Native",
"repository": {
Expand Down
1 change: 0 additions & 1 deletion packages/pilot/src/client/core/use-pilot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
'use client'
import { atom, Atom, useAtom } from 'jotai'
import { Platform } from 'react-native'
// @ts-expect-error
import { useRouter } from 'next/router'
import { Pilot } from './pilot'
import { PilotConfig } from '../types'
Expand Down
1 change: 0 additions & 1 deletion packages/pilot/src/i18n/app-with-translation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import i18next from 'i18next'
import { useMemo } from 'react'
// @ts-ignore (peer dependency)
import { I18nextProvider, initReactI18next } from 'react-i18next'
// @ts-expect-error
import type { AppProps as NextJsAppProps } from 'next/app'

type AppProps = NextJsAppProps & {
Expand Down

0 comments on commit 19d3c33

Please sign in to comment.