Skip to content

Commit

Permalink
Merge branch 'canary' into fix/query-hash-issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] committed Jul 21, 2022
2 parents df45e36 + 14463dd commit e7e3804
Show file tree
Hide file tree
Showing 127 changed files with 28,319 additions and 22,906 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_test_deploy.yml
Expand Up @@ -1441,7 +1441,7 @@ jobs:
if: ${{ needs.build.outputs.isRelease == 'true' }}
needs: build
name: stable - x86_64-unknown-freebsd - node@16
runs-on: macos-10.15
runs-on: macos-12
steps:
- name: tune mac network
run: sudo sysctl -w net.link.generic.system.hwcksum_tx=0 && sudo sysctl -w net.link.generic.system.hwcksum_rx=0
Expand All @@ -1456,7 +1456,7 @@ jobs:
rm -rf test
- name: Build
id: build
uses: vmactions/freebsd-vm@v0.1.6
uses: vmactions/freebsd-vm@v0.2.0
env:
DEBUG: napi:*
RUSTUP_HOME: /usr/local/rustup
Expand Down
18 changes: 15 additions & 3 deletions examples/convex/README.md
Expand Up @@ -20,16 +20,28 @@ yarn create next-app --example with-convex with-convex-app
pnpm create next-app --example with-convex with-convex-app
```

After creating a [Convex account](https://www.convex.dev) and getting a beta key,
Log in to Convex,

```bash
npx convex init --beta-key <your beta key>
npx convex login
```

Next, push the Convex functions for this project.
initialize a new Convex project,

```bash
npx convex init
```

and push the Convex functions for this project.

```bash
npx convex push
```

Now you can run your code locally with a Convex backend with

```bash
npm run dev
```

Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
38 changes: 11 additions & 27 deletions examples/convex/convex/README.md
@@ -1,45 +1,29 @@
# Welcome to your functions directory
# Welcome to your Convex functions directory!

Write your convex functions in this directory.
Write your Convex functions here.

A query function (how you read data) looks like this:
A query function looks like:

```typescript
// getCounter.ts
// myQueryFunction.ts
import { query } from './_generated/server'

export default query(async ({ db }): Promise<number> => {
const counterDoc = await db.table('counter_table').first()
console.log('Got stuff')
if (counterDoc === null) {
return 0
}
return counterDoc.counter
export default query(async ({ db }) => {
// Load data with `db` here!
})
```

A mutation function (how you write data) looks like this:
A mutation function looks like:

```typescript
// incrementCounter.ts
// myMutationFunction.ts
import { mutation } from './_generated/server'

export default mutation(async ({ db }, increment: number) => {
let counterDoc = await db.table('counter_table').first()
if (counterDoc === null) {
counterDoc = {
counter: increment,
}
db.insert('counter_table', counterDoc)
} else {
counterDoc.counter += increment
db.replace(counterDoc._id, counterDoc)
}
// Like console.log but relays log messages from the server to client.
console.log(`Value of counter is now ${counterDoc.counter}`)
export default mutation(async ({ db }) => {
// Edit data with `db` here!
})
```

The convex cli is your friend. See everything it can do by running
The Convex CLI is your friend. See everything it can do by running
`npx convex -h` in your project root directory. To learn more, launch the docs
with `npx convex docs`.
2 changes: 1 addition & 1 deletion examples/convex/package.json
Expand Up @@ -9,7 +9,7 @@
"next": "latest",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"convex-dev": "0.1.4"
"convex": "^0.1.6"
},
"devDependencies": {
"@types/node": "~16.11.12",
Expand Down
2 changes: 1 addition & 1 deletion examples/convex/pages/_app.tsx
@@ -1,7 +1,7 @@
import '../styles/globals.css'
import type { AppProps } from 'next/app'

import { ConvexProvider, ConvexReactClient } from 'convex-dev/react'
import { ConvexProvider, ConvexReactClient } from 'convex/react'
import convexConfig from '../convex.json'
const convex = new ConvexReactClient(convexConfig.origin)

Expand Down
3 changes: 3 additions & 0 deletions examples/with-cypress/.gitignore
Expand Up @@ -32,3 +32,6 @@ yarn-error.log*

# vercel
.vercel

# typescript
*.tsbuildinfo
7 changes: 7 additions & 0 deletions examples/with-cypress/cypress.config.ts
@@ -0,0 +1,7 @@
const { defineConfig } = require('cypress')

module.exports = defineConfig({
e2e: {
baseUrl: 'http://localhost:3000',
},
})
3 changes: 0 additions & 3 deletions examples/with-cypress/cypress.json

This file was deleted.

File renamed without changes.
22 changes: 0 additions & 22 deletions examples/with-cypress/cypress/plugins/index.js

This file was deleted.

@@ -1,5 +1,6 @@
/// <reference types="cypress" />
// ***********************************************
// This example commands.js shows you how to
// This example commands.ts shows you how to
// create various custom commands and overwrite
// existing commands.
//
Expand All @@ -23,3 +24,14 @@
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
//
// declare global {
// namespace Cypress {
// interface Chainable {
// login(email: string, password: string): Chainable<void>
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
// }
// }
// }
@@ -1,5 +1,5 @@
// ***********************************************************
// This example support/index.js is processed and
// This example support/e2e.ts is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
Expand Down
8 changes: 8 additions & 0 deletions examples/with-cypress/cypress/tsconfig.json
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress", "node"]
},
"include": ["**/*.ts"]
}
5 changes: 5 additions & 0 deletions examples/with-cypress/next-env.d.ts
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
12 changes: 8 additions & 4 deletions examples/with-cypress/package.json
Expand Up @@ -11,11 +11,15 @@
},
"dependencies": {
"next": "latest",
"react": "17.0.2",
"react-dom": "17.0.2"
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"cypress": "8.2.0",
"start-server-and-test": "1.13.1"
"@types/node": "18.0.6",
"@types/react": "18.0.15",
"@types/react-dom": "18.0.6",
"cypress": "10.3.1",
"start-server-and-test": "1.14.0",
"typescript": "4.7.4"
}
}
@@ -1,6 +1,7 @@
import type { AppProps } from 'next/app'
import '../styles/globals.css'

function MyApp({ Component, pageProps }) {
function MyApp({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
}

Expand Down
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions examples/with-cypress/tsconfig.json
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
3 changes: 3 additions & 0 deletions examples/with-dynamic-import/.gitignore
Expand Up @@ -32,3 +32,6 @@ yarn-error.log*

# vercel
.vercel

# TypeScript
*.tsbuildinfo
Expand Up @@ -4,18 +4,12 @@ export default function Header() {
return (
<div>
<Link href="/">
<a style={styles.a}>Home</a>
<a style={{ marginRight: 10 }}>Home</a>
</Link>

<Link href="/about">
<a style={styles.a}>About</a>
<a style={{ marginRight: 10 }}>About</a>
</Link>
</div>
)
}

const styles = {
a: {
marginRight: 10,
},
}
5 changes: 5 additions & 0 deletions examples/with-dynamic-import/next-env.d.ts
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
12 changes: 8 additions & 4 deletions examples/with-dynamic-import/package.json
Expand Up @@ -3,13 +3,17 @@
"scripts": {
"dev": "next",
"build": "next build",
"export": "next export",
"start": "next start"
},
"dependencies": {
"fuse.js": "6.4.1",
"fuse.js": "6.6.2",
"next": "latest",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "^18",
"@types/react": "^18",
"typescript": "^4.7.4"
}
}
10 changes: 0 additions & 10 deletions examples/with-dynamic-import/pages/about.js

This file was deleted.

File renamed without changes.
20 changes: 20 additions & 0 deletions examples/with-dynamic-import/tsconfig.json
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
2 changes: 1 addition & 1 deletion lerna.json
Expand Up @@ -16,5 +16,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "12.2.3-canary.15"
"version": "12.2.3-canary.16"
}
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -56,7 +56,7 @@
"@babel/plugin-proposal-object-rest-spread": "7.14.7",
"@babel/preset-flow": "7.14.5",
"@babel/preset-react": "7.14.5",
"@edge-runtime/jest-environment": "1.1.0-beta.11",
"@edge-runtime/jest-environment": "1.1.0-beta.17",
"@fullhuman/postcss-purgecss": "1.3.0",
"@mdx-js/loader": "0.18.0",
"@next/bundle-analyzer": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "12.2.3-canary.15",
"version": "12.2.3-canary.16",
"keywords": [
"react",
"next",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-next/package.json
@@ -1,6 +1,6 @@
{
"name": "eslint-config-next",
"version": "12.2.3-canary.15",
"version": "12.2.3-canary.16",
"description": "ESLint configuration used by NextJS.",
"main": "index.js",
"license": "MIT",
Expand All @@ -9,7 +9,7 @@
"directory": "packages/eslint-config-next"
},
"dependencies": {
"@next/eslint-plugin-next": "12.2.3-canary.15",
"@next/eslint-plugin-next": "12.2.3-canary.16",
"@rushstack/eslint-patch": "^1.1.3",
"@typescript-eslint/parser": "^5.21.0",
"eslint-import-resolver-node": "^0.3.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-next/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
"version": "12.2.3-canary.15",
"version": "12.2.3-canary.16",
"description": "ESLint plugin for NextJS.",
"main": "lib/index.js",
"license": "MIT",
Expand Down

0 comments on commit e7e3804

Please sign in to comment.