Skip to content

Commit

Permalink
Merge branch 'canary' into get-page-context
Browse files Browse the repository at this point in the history
  • Loading branch information
vordgi authored May 18, 2024
2 parents 7191c04 + 0cd20e0 commit f3129fc
Show file tree
Hide file tree
Showing 331 changed files with 12,924 additions and 6,162 deletions.
493 changes: 258 additions & 235 deletions Cargo.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ next-core = { path = "packages/next-swc/crates/next-core" }
next-custom-transforms = { path = "packages/next-swc/crates/next-custom-transforms" }

# SWC crates
swc_core = { version = "0.90.33", features = [
swc_core = { version = "0.92.5", features = [
"ecma_loader_lru",
"ecma_loader_parking_lot",
] }
testing = { version = "0.35.22" }
testing = { version = "0.35.24" }

# Turbo crates
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240516.1" }
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240517.2" }
# [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros..
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240516.1" }
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240517.2" }
# [TODO]: need to refactor embed_directory! macro usage in next-core
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240516.1" }
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240517.2" }

# General Deps

Expand Down Expand Up @@ -90,7 +90,7 @@ indoc = "2.0.0"
itertools = "0.10.5"
lazy_static = "1.4.0"
log = "0.4.17"
lightningcss = { version = "=1.0.0-alpha.54", features = [
lightningcss = { version = "1.0.0-alpha.54", features = [
"serde",
"visitor",
"into_owned",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ description: Use CSS-in-JS libraries with Next.js
The following libraries are supported in Client Components in the `app` directory (alphabetical):

- [`ant-design`](https://ant.design/docs/react/use-with-next#using-app-router)
- [`chakra-ui`](https://chakra-ui.com/getting-started/nextjs-app-guide)
- [`@fluentui/react-components`](https://react.fluentui.dev/?path=/docs/concepts-developer-server-side-rendering-next-js-appdir-setup--page)
- [`kuma-ui`](https://kuma-ui.com)
Expand All @@ -25,7 +26,6 @@ The following libraries are supported in Client Components in the `app` director
- [`tamagui`](https://tamagui.dev/docs/guides/next-js#server-components)
- [`tss-react`](https://tss-react.dev/)
- [`vanilla-extract`](https://vanilla-extract.style)
- [`ant-design`](https://ant.design/docs/react/use-with-next#using-app-router)

The following are currently working on support:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ Next.js will automatically expand variables that use `$` to reference other vari

```txt filename=".env"
TWITTER_USER=nextjs
TWITTER_URL=https://twitter.com/$TWITTER_USER
TWITTER_URL=https://x.com/$TWITTER_USER
```

In the above example, `process.env.TWITTER_URL` would be set to `https://twitter.com/nextjs`.
In the above example, `process.env.TWITTER_URL` would be set to `https://x.com/nextjs`.

> **Good to know**: If you need to use variable with a `$` in the actual value, it needs to be escaped e.g. `\$`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ export const metadata = {

The Twitter specification is (surprisingly) used for more than just X (formerly known as Twitter).

Learn more about the [Twitter Card markup reference](https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/markup).
Learn more about the [Twitter Card markup reference](https://developer.x.com/en/docs/twitter-for-websites/cards/overview/markup).

```jsx filename="layout.js | page.js"
export const metadata = {
Expand Down
2 changes: 1 addition & 1 deletion docs/05-community/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ If you have a question about Next.js, or want to help others, you're always welc

## Social Media

Follow Next.js on [Twitter](https://twitter.com/nextjs) for the latest updates, and subscribe to the [Vercel YouTube channel](https://www.youtube.com/@VercelHQ) for Next.js videos.
Follow Next.js on [Twitter](https://x.com/nextjs) for the latest updates, and subscribe to the [Vercel YouTube channel](https://www.youtube.com/@VercelHQ) for Next.js videos.

## Code of Conduct

Expand Down
2 changes: 1 addition & 1 deletion docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ For optimal accessibility when using a screen reader while reading the docs, we

## Join our Community

If you have questions about anything related to Next.js, you're always welcome to ask our community on [GitHub Discussions](https://github.com/vercel/next.js/discussions), [Discord](https://discord.com/invite/bUG2bvbtHy), [Twitter](https://twitter.com/nextjs), and [Reddit](https://www.reddit.com/r/nextjs).
If you have questions about anything related to Next.js, you're always welcome to ask our community on [GitHub Discussions](https://github.com/vercel/next.js/discussions), [Discord](https://discord.com/invite/bUG2bvbtHy), [Twitter](https://x.com/nextjs), and [Reddit](https://www.reddit.com/r/nextjs).
6 changes: 3 additions & 3 deletions examples/cms-sanity/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
/.next/
/out/

# production
/build
/studio/dist
# sanity
/.sanity/
/dist/

# misc
.DS_Store
Expand Down
32 changes: 15 additions & 17 deletions examples/cms-sanity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,31 @@
"typegen": "sanity schema extract && sanity typegen generate"
},
"dependencies": {
"@sanity/assist": "3.0.3",
"@sanity/icons": "2.11.8",
"@sanity/image-url": "1.0.2",
"@sanity/preview-url-secret": "1.6.11",
"@sanity/vision": "3.39.0",
"@tailwindcss/typography": "^0.5.12",
"@types/node": "^20.12.7",
"@types/react": "^18.2.79",
"@types/react-dom": "^18.2.25",
"@sanity/assist": "^3.0.4",
"@sanity/icons": "^2.11.8",
"@sanity/image-url": "^1.0.2",
"@sanity/preview-url-secret": "^1.6.13",
"@sanity/vision": "^3.42.1",
"@tailwindcss/typography": "^0.5.13",
"@types/node": "^20.12.12",
"@types/react": "^18.3.2",
"@types/react-dom": "^18.3.0",
"@vercel/speed-insights": "^1.0.10",
"autoprefixer": "^10.4.19",
"date-fns": "^3.6.0",
"next": "latest",
"next-sanity": "9.0.10",
"next-sanity": "^9.0.18",
"postcss": "^8.4.38",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rxjs": "^7.8.1",
"sanity": "3.39.0",
"sanity-plugin-asset-source-unsplash": "3.0.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"sanity": "^3.42.1",
"sanity-plugin-asset-source-unsplash": "^3.0.1",
"server-only": "^0.0.1",
"styled-components": "6.1.8",
"styled-components": "^6.1.11",
"tailwindcss": "^3.4.3",
"typescript": "5.4.5"
},
"devDependencies": {
"@next/env": "latest",
"eslint": "^8.57.0",
"eslint-config-next": "latest"
}
Expand Down
3 changes: 0 additions & 3 deletions examples/cms-sanity/sanity-typegen.json

This file was deleted.

19 changes: 14 additions & 5 deletions examples/cms-sanity/sanity.cli.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import { loadEnvConfig } from "@next/env";
import { defineCliConfig } from "sanity/cli";

const dev = process.env.NODE_ENV !== "production";
loadEnvConfig(__dirname, dev, { info: () => null, error: console.error });

const projectId = process.env.NEXT_PUBLIC_SANITY_PROJECT_ID;
const dataset = process.env.NEXT_PUBLIC_SANITY_DATASET;

export default defineCliConfig({ api: { projectId, dataset } });
export default defineCliConfig({
api: { projectId, dataset },
vite: {
define: {
"process.env.NEXT_PUBLIC_SANITY_PROJECT_ID": JSON.stringify(projectId),
"process.env.NEXT_PUBLIC_SANITY_DATASET": JSON.stringify(dataset),
},
resolve: {
alias: {
"@": __dirname,
},
},
},
});
45 changes: 42 additions & 3 deletions examples/cms-sanity/sanity.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,26 @@
import { visionTool } from "@sanity/vision";
import { PluginOptions, defineConfig } from "sanity";
import { unsplashImageAsset } from "sanity-plugin-asset-source-unsplash";
import { presentationTool } from "sanity/presentation";
import {
presentationTool,
defineDocuments,
defineLocations,
type DocumentLocation,
} from "sanity/presentation";
import { structureTool } from "sanity/structure";

import { apiVersion, dataset, projectId, studioUrl } from "@/sanity/lib/api";
import { locate } from "@/sanity/plugins/locate";
import { pageStructure, singletonPlugin } from "@/sanity/plugins/settings";
import { assistWithPresets } from "@/sanity/plugins/assist";
import author from "@/sanity/schemas/documents/author";
import post from "@/sanity/schemas/documents/post";
import settings from "@/sanity/schemas/singletons/settings";
import { resolveHref } from "@/sanity/lib/utils";

const homeLocation = {
title: "Home",
href: "/",
} satisfies DocumentLocation;

export default defineConfig({
basePath: studioUrl,
Expand All @@ -31,7 +41,36 @@ export default defineConfig({
},
plugins: [
presentationTool({
locate,
resolve: {
mainDocuments: defineDocuments([
{
route: "/posts/:slug",
filter: `_type == "post" && slug.current == $slug`,
},
]),
locations: {
settings: defineLocations({
locations: [homeLocation],
message: "This document is used on all pages",
tone: "caution",
}),
post: defineLocations({
select: {
title: "title",
slug: "slug.current",
},
resolve: (doc) => ({
locations: [
{
title: doc?.title || "Untitled",
href: resolveHref("post", doc?.slug)!,
},
homeLocation,
],
}),
}),
},
},
previewUrl: { previewMode: { enable: "/api/draft" } },
}),
structureTool({ structure: pageStructure([settings]) }),
Expand Down
7 changes: 5 additions & 2 deletions examples/cms-sanity/sanity.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ export type SanityAssistSchemaTypeField = {
};
export declare const internalGroqTypeReferenceTo: unique symbol;

// Source: sanity/lib/queries.ts
// Source: ./sanity/lib/queries.ts
// Variable: settingsQuery
// Query: *[_type == "settings"][0]
export type SettingsQueryResult = {
Expand Down Expand Up @@ -454,6 +454,7 @@ export type SettingsQueryResult = {
_type: "image";
};
} | null;

// Variable: heroQuery
// Query: *[_type == "post" && defined(slug.current)] | order(date desc, _updatedAt desc) [0] { content, _id, "status": select(_originalId in path("drafts.**") => "draft", "published"), "title": coalesce(title, "Untitled"), "slug": slug.current, excerpt, coverImage, "date": coalesce(date, _updatedAt), "author": author->{"name": coalesce(name, "Anonymous"), picture},}
export type HeroQueryResult = {
Expand Down Expand Up @@ -509,6 +510,7 @@ export type HeroQueryResult = {
} | null;
} | null;
} | null;

// Variable: moreStoriesQuery
// Query: *[_type == "post" && _id != $skip && defined(slug.current)] | order(date desc, _updatedAt desc) [0...$limit] { _id, "status": select(_originalId in path("drafts.**") => "draft", "published"), "title": coalesce(title, "Untitled"), "slug": slug.current, excerpt, coverImage, "date": coalesce(date, _updatedAt), "author": author->{"name": coalesce(name, "Anonymous"), picture},}
export type MoreStoriesQueryResult = Array<{
Expand Down Expand Up @@ -546,6 +548,7 @@ export type MoreStoriesQueryResult = Array<{
} | null;
} | null;
}>;

// Variable: postQuery
// Query: *[_type == "post" && slug.current == $slug] [0] { content, _id, "status": select(_originalId in path("drafts.**") => "draft", "published"), "title": coalesce(title, "Untitled"), "slug": slug.current, excerpt, coverImage, "date": coalesce(date, _updatedAt), "author": author->{"name": coalesce(name, "Anonymous"), picture},}
export type PostQueryResult = {
Expand Down Expand Up @@ -602,7 +605,7 @@ export type PostQueryResult = {
} | null;
} | null;

// Source: app/(blog)/posts/[slug]/page.tsx
// Source: ./app/(blog)/posts/[slug]/page.tsx
// Variable: postSlugs
// Query: *[_type == "post"]{slug}
export type PostSlugsResult = Array<{
Expand Down
94 changes: 0 additions & 94 deletions examples/cms-sanity/sanity/plugins/locate.ts

This file was deleted.

4 changes: 2 additions & 2 deletions examples/convex/convex/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Welcome to your Convex functions directory!

Write your Convex functions here. See
https://docs.convex.dev/using/writing-convex-functions for more.
Write your Convex functions here.
See https://docs.convex.dev/functions for more.

A query function that takes two arguments looks like:

Expand Down
2 changes: 1 addition & 1 deletion examples/convex/convex/_generated/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* THIS CODE IS AUTOMATICALLY GENERATED.
*
* Generated by convex@1.6.3.
* Generated by convex@1.12.0.
* To regenerate, run `npx convex dev`.
* @module
*/
Expand Down
Loading

0 comments on commit f3129fc

Please sign in to comment.