[Snyk] Upgrade astro from 2.1.2 to 4.7.1 #23
Closed
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.
This PR was automatically created by Snyk using the credentials of a real user.
![snyk-top-banner](https://github.com/andygongea/OWASP-Benchmark/assets/818805/c518c423-16fe-447e-b67f-ad5a49b5d123)
Snyk has created this PR to upgrade astro from 2.1.2 to 4.7.1.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
The recommended version is 213 versions ahead of your current version.
The recommended version was released on 24 days ago.
Issues fixed by the recommended upgrade:
SNYK-JS-VITE-6531286
SNYK-JS-UNDICI-6564963
SNYK-JS-UNDICI-6564964
SNYK-JS-UNDICI-6252336
Release notes
Package name: astro
Minor Changes
#11055
b92de22
Thanks @ niklas-wortmann! - Updates thedevtools
type to allow passingVueDevToolsOptions
For more customization, you can pass options that the Vue DevTools Vite Plugin supports. (Note:
appendTo
is not supported.) For example, you can setlaunchEditor
to your preferred editor if you are not using Visual Studio Code:import vue from '@ astrojs/vue';
export default defineConfig({
// ...
integrations: [
vue({
devtools: { launchEditor: 'webstorm' },
}),
],
});
Minor Changes
#11071
8ca7c73
Thanks @ bholmesdev! - Adds two new functionsexperimental_getActionState()
andexperimental_withState()
to support the React 19useActionState()
hook when using Astro Actions. This introduces progressive enhancement when calling an Action with thewithState()
utility.This example calls a
like
action that accepts apostId
and returns the number of likes. Pass this action to theexperimental_withState()
function to apply progressive enhancement info, and apply touseActionState()
to track the result:import { experimental_withState } from '@ astrojs/react/actions';
export function Like({ postId }: { postId: string }) {
const [state, action, pending] = useActionState(
experimental_withState(actions.like),
0 // initial likes
);
return (
<form action={action}>
<input type="hidden" name="postId" value={postId} />
<button disabled={pending}>{state} ❤️</button>
</form>
);
}
You can also access the state stored by
useActionState()
from your actionhandler
. Callexperimental_getActionState()
with the API context, and optionally apply a type to the result:import { experimental_getActionState } from '@ astrojs/react/actions';
export const server = {
like: defineAction({
input: z.object({
postId: z.string(),
}),
handler: async ({ postId }, ctx) => {
const currentLikes = experimental_getActionState<number>(ctx);
// write to database
return currentLikes + 1;
},
}),
};
Patch Changes
3cc3e2c
Thanks @ Xetera! - Omitting compiler-internal symbol from user components to fix breaking error messagesImportant
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information: