-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat: clean deprecated APIs #14462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: clean deprecated APIs #14462
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
10e2556
feat: clean deprecated APIs
florian-lefebvre c3038fa
Update cyan-crews-cross.md
florian-lefebvre 8c2743c
Remove `with` option from `prefetch()` function
florian-lefebvre aedd960
Update pretty-forks-smash.md
florian-lefebvre edf6186
Update .changeset/pretty-forks-smash.md
florian-lefebvre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| --- | ||
| 'astro': major | ||
| --- | ||
|
|
||
| Removes the old `app.render()` signature (Adapter API) | ||
|
|
||
| In Astro 4.0, the `app.render()` signature that allowed passing `routeData` and `locals` as optional arguments was deprecated in favor of a single optional `renderOptions` argument. | ||
|
|
||
| Astro 6.0 removes this signature entirely. Attempting to pass these separate arguments will now cause an error in your project. | ||
|
|
||
| #### What should I do? | ||
|
|
||
| Review your `app.render` calls and pass `routeData` and `locals` as properties of an object instead of as multiple independent arguments: | ||
|
|
||
| ```diff | ||
| // my-adapter/entrypoint.ts | ||
| -app.render(request, routeData, locals) | ||
| +app.render(request, { routeData, locals }) | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| --- | ||
| 'astro': major | ||
| --- | ||
|
|
||
| Removes `prefetch()` `with` option | ||
|
|
||
| In Astro 4.8.4, the `with` option of the programmatic `prefetch()` function was deprecated in favor of a more sensible default behavior that no longer required specifying the priority of prefetching for each page. | ||
|
|
||
| Astro 6.0 removes this option entirely and it is no longer possible to configure the priority of prefetching by passing the `with` option. Attempting to do so will now cause errors. | ||
|
|
||
| By default, Astro's prefetching now uses an automatic approach that will always try to use `<link rel="prefetch>` if supported, or will fall back to `fetch()`. | ||
|
|
||
| #### What should I do? | ||
|
|
||
| Review your `prefetch()` calls and remove the `with` option if it still exists: | ||
|
|
||
| ```diff | ||
| -prefetch('/about', { with: 'fetch' }); | ||
| +prefetch('/about'); | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| --- | ||
| 'astro': major | ||
| --- | ||
|
|
||
| Removes the `handleForms` prop for the `<ClientRouter />` component | ||
|
|
||
| In Astro 4.0, the `handleForms` prop of the `<ClientRouter />` component was deprecated, as it was no longer necessary to opt in to handling `submit` events for `form` elements. This functionality has been built in by default and the property, if still included in your project, silently had no impact on form submission. | ||
|
|
||
| Astro 6.0 removes this prop entirely and it now must be removed to avoid errors in your project. | ||
|
|
||
| #### What should I do? | ||
|
|
||
| Remove the `handleForms` property from your `<ClientRouter />` component if it exists. It has provided no additional functionality, and so removing it should not change any behavior in your project: | ||
|
|
||
| ```diff | ||
| --- | ||
| // title="src/pages/index.astro | ||
| import { ClientRouter } from "astro:transitions"; | ||
| --- | ||
| <html> | ||
| <head> | ||
| - <ClientRouter handleForms /> | ||
| + <ClientRouter /> | ||
| </head> | ||
| <body> | ||
| <!-- stuff here --> | ||
| </body> | ||
| </html> | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.