You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes unexpected `undefined` value when calling an action from the client without a return value
22
+
```
23
+
24
+
You can generate a changeset using the `pnpm changeset` command, which will prompt you for the necessary information and create a randomly-named file in the `.changeset` folder. You can then edit the generated file to add more detail, or write your changeset from scratch.
25
+
26
+
## Format
27
+
28
+
Begin your changeset message with **a present tense verb** that completes a sentence in the style of: "This PR . . ." or "This contribution ..."
29
+
30
+
- Adds
31
+
- Removes
32
+
- Fixes
33
+
- Updates
34
+
- Refactors
35
+
- Improves
36
+
- Deprecates
37
+
38
+
Finish the introductory sentence with a message focusing on what has changed **about the codebase** (not what your feature itself does) that is meaningful to a **user** of Astro. It is usually more helpful to describe the change **as someone building an Astro site will experience it**, instead of describing **how you fixed it** or **what the code in the PR does**:
39
+
40
+
```markdown title="changeset.md" del={2} ins={5}
41
+
// What the code now does
42
+
Logs helpful errors if content is invalid
43
+
44
+
// The nature of the change to the Astro code base
45
+
Adds logging for content collections configuration errors.
46
+
```
47
+
48
+
You may then include additional paragraphs if necessary to describe the change in more detail. This may not be needed for a small bug fix, but is often helpful if the reader must make a change to their own code, or needs to understand how the change might affect them.
49
+
50
+
The level of detail of a changeset depends on the type of change (e.g. `patch` vs `minor`, breaking or not, only affects integration authors etc.) You may also use [`<h4>` - `<h6>` Markdown headings](#using-markdown-section-headings) to break your longer content into sections.
51
+
52
+
:::tip[Don't hide the good stuff in the changeset!]
53
+
CHANGELOGS are often read only once, when someone is updating to the latest version of a package. Documentation is a constant reference that will be revisited and consulted frequently.
54
+
55
+
Make sure that the helpful explanations and examples for your fellow developers in both your changeset and your PR description are captured in the actual feature documentation, too!
56
+
:::
57
+
58
+
### Patch updates
59
+
60
+
These updates are often fixes, refactors or other small improvements. They are typically not user-facing, and do not require someone to update their own project code.
61
+
62
+
Verbs like "fixes" and "refactors" are helpful to let readers know this is an internal or implementation change that they do not need to worry about. At the same time, these messages are helpful to someone who is interested in keeping up with small changes to the codebase.
63
+
64
+
Often one line is enough to describe your change meaningfully to an Astro user:
65
+
66
+
```md title="my-patch-changeset.md" wrap
67
+
---
68
+
"astro": patch
69
+
---
70
+
71
+
Fixes a bug where the toolbar audit would incorrectly flag images as above the fold
72
+
```
73
+
74
+
```md title="my-patch-changeset.md" wrap
75
+
---
76
+
"astro": patch
77
+
---
78
+
79
+
Refactors internal handling of styles and scripts for content collections to improve build performance
80
+
```
81
+
82
+
```md title="my-patch-changeset.md" wrap
83
+
---
84
+
"astro": patch
85
+
---
86
+
87
+
Updates the `HTMLAttributes` type exported from `astro` to allow data attributes
88
+
```
89
+
90
+
These do not need to be full sentences and do not need end punctuation unless you write multiple sentences.
91
+
92
+
:::tip[Help your reader figure out if this is change important to them]
93
+
Even though these are small changes described by very short sentences, they still need to communicate a lot!
94
+
95
+
Check that you have clearly stated not just **what has changed** but also **who needs to know**. If your reader can identify that a change is important to them, they can always seek out further information if they need to know more.
96
+
:::
97
+
98
+
#### Tips and Examples
99
+
100
+
For a great changeset message:
101
+
102
+
Include the specific API changed (using inline code highlighting as appropriate) when your change might not be easy to identify so that your reader can easily tell whether it's something they are using and need to care about:
When the specific API change is not user-facing (e.g. a type not publicly exposed) and/or your reader will not recognize it by name, describe the use case or end result that will be meaningful to the reader instead:
111
+
112
+
> Adds `| (string & {})` for better autocomplete of `App.SessionData`
113
+
>
114
+
> vs
115
+
>
116
+
> ✅ Improves autocompletion for session keys
117
+
118
+
### New features
119
+
120
+
Begin your changeset with "Adds" to alert readers that there is something new and mention the names of any new items (options, functions) that have been added directly in the first sentence:
121
+
122
+
```md title="my-minor-changeset.md" wrap
123
+
---
124
+
"astro": minor
125
+
---
126
+
127
+
Adds a new `flamethrow` view transitions animation
128
+
129
+
<!---->
130
+
```
131
+
132
+
Additionally, describe what people are now able to do because of these additions that they could not before.
133
+
134
+
The changeset is an opportunity to call people's attention to new things they might wish to try in their Astro project, and may include a code example showing basic usage of the new feature:
135
+
136
+
````md wrap title="my-minor-changeset.md"
137
+
---
138
+
"astro": minor
139
+
---
140
+
141
+
Adds a new, optional property `timeout` for the `client:idle` directive
142
+
143
+
This value allows you to specify a maximum time to wait, in milliseconds, before hydrating a UI framework component, even if the page is not yet done with its initial load.
144
+
145
+
This means you can delay hydration for lower-priority UI elements with more control to ensure your element is interactive within a specified time frame.
146
+
147
+
```
148
+
<Button client:idle={{ timeout: 500 }} />
149
+
```
150
+
````
151
+
152
+
You can also use [`<h4>` - `<h6>` Markdown headings](#using-markdown-section-headings) to break your longer content into sections.
153
+
154
+
### Breaking changes
155
+
156
+
Changesets focus on what has changed, and **must include any breaking changes**, including changes to default behavior. Most users will have several default settings configured (often by not setting any value themselves), so changes to defaults can have a significant impact on someone's project!
157
+
158
+
Verbs like "removes", "changes", and "deprecates" call attention to something that might require attention. Unlike a new feature someone can choose not to use, changing default or expected behavior cannot be ignored.
159
+
160
+
You can also use [`<h4>` - `<h6>` Markdown headings](#using-markdown-section-headings) to break your content into sections, for example, to add headings like, "What should I do?" or "Migrating from the previous version."
161
+
162
+
```md title="my-major-changeset.md" wrap
163
+
---
164
+
"astro": major
165
+
---
166
+
167
+
Removes support for returning simple objects from endpoints. You must now return a `Response` instead.
168
+
```
169
+
170
+
Changeset messages for breaking changes must also provide clear guidance for updating. Diff code samples are encouraged when appropriate:
171
+
172
+
````md title="my-major-changeset.md" wrap
173
+
---
174
+
"astro": major
175
+
---
176
+
177
+
Removes support for Shiki custom language's `path` property. The language JSON file must now be imported and passed to the option instead.
178
+
179
+
```diff
180
+
// astro.config.js
181
+
+ import customLang from './custom.tmLanguage.json'
182
+
183
+
export default defineConfig({
184
+
markdown: {
185
+
shikiConfig: {
186
+
langs: [
187
+
- { path: './custom.tmLanguage.json' },
188
+
+ customLang,
189
+
],
190
+
},
191
+
},
192
+
})
193
+
```
194
+
````
195
+
196
+
If your contribution changes a default value, then it is helpful to describe how to revert back to the previous behavior. Readers may also appreciate being informed that they can remove configuration that is no longer needed.
197
+
198
+
````md title="my-major-changeset.md" wrap
199
+
---
200
+
"astro": major
201
+
---
202
+
203
+
Changes the default value of `security.checkOrigin` to true, which now enables Cross-Site Request Forgery (CSRF) protection by default for pages rendered on demand.
204
+
205
+
If you had previously configured `security.checkOrigin: true`, you no longer need this set in your Astro config. This is now the default and it is safe to remove.
206
+
207
+
To revert to the previous default behavior and opt out of automatically checking that the “origin” header matches the URL sent by each request, you must now explicitly set `security.checkOrigin: false`:
208
+
209
+
```diff
210
+
export default defineConfig({
211
+
+ security: {
212
+
+ checkOrigin: false
213
+
+ }
214
+
})
215
+
```
216
+
````
217
+
218
+
## Using Markdown section headings
219
+
220
+
For longer descriptions that you want to split into sections, always start at the `<h4>` level, using `####` where you would normally use `##` in a regular Markdown post. This ensures readability when your message is incorporated into the final CHANGELOG:
0 commit comments