Skip to content

Commit

Permalink
Merge branch 'canary' into bump-react-to-41110021f
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] committed Mar 1, 2023
2 parents 66837d6 + 16a0e5a commit 89146b8
Show file tree
Hide file tree
Showing 12 changed files with 107 additions and 38 deletions.
20 changes: 20 additions & 0 deletions .github/DISCUSSION_TEMPLATE/help.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
body:
- type: textarea
attributes:
label: Summary
description: What do you need help with?
validations:
required: true
- type: textarea
attributes:
label: Additional information
description: Any code snippets, error messages, or dependency details that may be related? (`next info`)
render: js
validations:
required: false
- type: input
attributes:
label: Example
description: A link to a minimal reproduction is helpful for collaborative debugging!
validations:
required: false
33 changes: 33 additions & 0 deletions .github/DISCUSSION_TEMPLATE/ideas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
body:
- type: textarea
attributes:
label: Goals
description: Short list of what the feature request aims to address?
value: |
1.
2.
3.
validations:
required: true
- type: textarea
attributes:
label: Non-Goals
description: Short list of what the feature request _does not_ aim to address?
value: |
1.
2.
3.
validations:
required: false
- type: textarea
attributes:
label: Background
description: Discuss prior art, why do you think this feature is needed? Are there current alternatives?
validations:
required: true
- type: textarea
attributes:
label: Proposal
description: How should this feature be implemented? Are you interested in contributing?
validations:
required: true
9 changes: 5 additions & 4 deletions .github/ISSUE_TEMPLATE/1.bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ labels: ['template: bug']
body:
- type: markdown
attributes:
value: 'NOTE: [examples](https://github.com/vercel/next.js/tree/canary/examples) related issue should be reported using [this](https://github.com/vercel/next.js/issues/new?assignees=&labels=type%3A+example%2Ctemplate%3A+bug&template=2.example_bug_report.yml) issue template instead.'
- type: markdown
attributes:
value: If you leave out sections there is a high likelihood it will be moved to the GitHub Discussions ["Help" section](https://github.com/vercel/next.js/discussions/categories/help).
value: |
*Note:* If you leave out sections, the issue might be moved to the ["Help" section](https://github.com/vercel/next.js/discussions/categories/help).
[examples](https://github.com/vercel/next.js/tree/canary/examples) related issue should be reported using [this](https://github.com/vercel/next.js/issues/new?assignees=&labels=type%3A+example%2Ctemplate%3A+bug&template=2.example_bug_report.yml) issue template instead.
Feature requests should be opened as [discussions](https://github.com/vercel/next.js/discussions/new?category=ideas). [Read more](https://github.com/vercel/next.js/blob/canary/contributing/core/adding-features.md).
- type: checkboxes
attributes:
label: Verify canary release
Expand All @@ -19,6 +19,7 @@ body:
attributes:
label: Provide environment information
description: Please run `next info` in the root directory of your project and paste the results. You might need to use `npx --no-install next info` if next is not in the current PATH.
render: bash
validations:
required: true
- type: dropdown
Expand Down
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/2.example_bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ labels: ['area: examples']
body:
- type: markdown
attributes:
value: Thanks for taking the time to file a bug report for [one of the examples](https://github.com/vercel/next.js/tree/canary/examples)! Please fill out this form as completely as possible.
- type: markdown
attributes:
value: If you leave out sections there is a high likelihood it will be moved to the GitHub Discussions ["Help" section](https://github.com/vercel/next.js/discussions/categories/help).
value: |
*Note:* If you leave out sections, the issue might be moved to the ["Help" section](https://github.com/vercel/next.js/discussions/categories/help).
Thanks for taking the time to file a bug report for [one of the examples](https://github.com/vercel/next.js/tree/canary/examples)! Please fill out this form as completely as possible.
- type: checkboxes
attributes:
label: Verify canary release
Expand All @@ -19,6 +18,7 @@ body:
attributes:
label: Provide environment information
description: Please run `next info` in the root directory of your project and paste the results. You might need to use `npx --no-install next info` if next is not in the current PATH.
render: bash
validations:
required: true
- type: input
Expand Down
28 changes: 0 additions & 28 deletions .github/ISSUE_TEMPLATE/3.feature_request.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ contact_links:
- name: Ask a question
url: https://github.com/vercel/next.js/discussions
about: Ask questions and discuss with other community members
- name: Feature request
url: https://github.com/vercel/next.js/discussions/new?category=ideas
about: Feature requests should be opened as discussions
1 change: 1 addition & 0 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ To contribute to [our examples](./examples), please see
- [Building](./contributing/core/building.md)
- [Testing](./contributing/core/testing.md)
- [Adding Error Links](./contributing/core/adding-error-links.md)
- [Adding a new feature](./contributing/core/adding-features.md)
- [Developing Using Local App](./contributing/core/developing-using-local-app.md)
<!-- - [Using the VS Code Debugger](./contributing/core/vscode-debugger.md) -->
17 changes: 17 additions & 0 deletions contributing/core/adding-features.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Adding a new feature

Anyone can propose a change to Next.js. However, adding new features often requires community discussions before proceeding with the implementation.

Therefore, before opening a PR, you should use the [Feature Request discussion template](https://github.com/vercel/next.js/discussions/new?category=ideas) and collect feedback.

## Why use a discussion?

The discussion's goal is to achieve the following:

1. **Verify the validity of the feature request**: The community can upvote discussions. Highly upvoted feature requests are more likely to be considered.
2. **Understanding the consequences**: Any feature added to Next.js is likely to be around for a while and _has to be maintained_. This means that a new feature has to cover many use cases, needs to consider how it affects the ecosystem, and so on.
3. **Looking at and understanding historical reasons for the current behavior or lack of the feature**: There might be a reason why a feature does not exist, or why the current implementation is in a certain way. There must be solid reasoning to change this, as the feature needs to be maintained even after it is added. (See 2.). Next.js has a strong policy on not breaking features, so any new feature has to be added in a way that makes it possible to incrementally adopt it.

## Examples

The Next.js team uses RFCs (Request For Comment), which you can find in [this discussion category](https://github.com/vercel/next.js/discussions/categories/rfc). Reading through these, you can get a better understanding of what is expected to be included in a good feature request.
3 changes: 2 additions & 1 deletion contributing/repository/triaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

Repository maintainers triage every issue and PR opened in the repository.

> Note: Feature requests should be opened as discussions, filling out [this template](https://github.com/vercel/next.js/discussions/new?category=ideas).
Issues are opened with one of these labels:

- `template: story` - a feature request, converted to an [💡 Ideas discussion](https://github.com/vercel/next.js/discussions/categories/ideas)
- `template: bug` - unverified issue with Next.js itself, or one of the examples in the [`examples`](https://github.com/vercel/next.js/tree/canary/examples) folder
- `template: documentation` - feedback for improvement or an unverified issue with the Next.js documentation

Expand Down
5 changes: 4 additions & 1 deletion packages/next/src/server/typescript/rules/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ function updateVirtualFileWithType(
if (ts.isFunctionDeclaration(node)) {
if (isGenerateMetadata) {
nodeEnd = node.body!.getFullStart()
annotation = TYPE_ANOTATION_ASYNC
const isAsync = node.modifiers?.some(
(m) => m.kind === ts.SyntaxKind.AsyncKeyword
)
annotation = isAsync ? TYPE_ANOTATION_ASYNC : TYPE_ANOTATION
} else {
return
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default function Page() {
return null
}

export async function generateMetadata() {
return {
title: 'foo',
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default function Page() {
return null
}

export function generateMetadata() {
return {
title: 'foo',
}
}

0 comments on commit 89146b8

Please sign in to comment.