[Snyk] Upgrade @adonisjs/vite from 2.0.2 to 3.0.0 #23
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.
Snyk has created this PR to upgrade @adonisjs/vite from 2.0.2 to 3.0.0.
ℹ️ 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 13 versions ahead of your current version.
The recommended version was released on 2 months ago.
Release notes
Package name: @adonisjs/vite
Changes
V3 of @ adonisjs/vite is finally available in stable version. The changes have been fully explained in the following documents:
Migration Guide
To migrate your application you will need to make the following changes:
You will need to add the vite server middleware to your
kernel.ts
file :])
generateEntryPointsTags
method is now async.Our implementation is based on the new Vite Runtime API, available only since version 5.1. So make sure you have at least this version of
vite
in your package.json.You'll need the latest version of adonisjs/assembler and adonisjs/core. Then make sure to have
assetsBundler: false
and the assembler hook defined in youradonisrc.ts
file :+ hooks: {
+ onBuildStarting: [() => import('@ adonisjs/vite/build_hook')],
+ },
})
Commits
post
for config plugin (7fd9e77)Changes
This new release has a breaking change: the Vite middleware must be added in your own
kernel.ts
like this :// ...
server.use([
// ...
() => import('@ adonisjs/cors/cors_middleware'),
() => import('@ adonisjs/vite/vite_middleware'),
])
This was needed because otherwise Vite's CORS settings and
@ adonisjs/cors
could conflict. See #14 and #13 for more detailed explanations.Commits
v3.0.0-10...v3.0.0-11
v3.0.0-9...v3.0.0-10
Breaking Changes
generateEntryPointsTags
method is now async.Changes
Commits
v3.0.0-8...v3.0.0-9
Fixed a configuration resolving problem that caused Solid x Inertia apps to sometimes get a "
find.test
is not a function`Commits
v3.0.0-7...v3.0.0-8
chore(release): 3.0.0-7
chore(release): 3.0.0-6
Breaking changes
getRuntime
in favor of acreateRuntime
method that returns a fresh instanceCommits
v3.0.0-4...v3.0.0-5
Assets preloading
This release introduces built-in support for asset preloading.
By default, Vite does code splitting, resulting in the generation of multiple small bundles that are loaded progressively as the user navigates the site. While beneficial, this can sometimes lead to a "waterfall" effect:
@ vite(['resources/js/app.js'])
in our Edge template..vue
or.tsx
components, and sometimes CSS as well.As a result, this will result in a waterfall of requests :
app.js
scriptapp.js
script in the HTML, parse itcomponents/home.vue
andapp.css
.This process can be optimized using preload and modulepreload attributes.
In production, Vite generates a Manifest outlining the relationships between our application's various scripts and styles. Using this manifest, we can generate preload tags for assets and inject them into the HTML.
Preload tags are generated for:
This behavior will be enabled by default with the new
adonisjs/vite
version.CSP Support
CSP support has been simplified compared with version 2.x.x. Now that we only have one dev server, using
self
as a CSP directive will be enough. However, there's an exception when using anassetUrl
pointing to a CDN. We therefore retain only the keyword@ viteUrl
which can be used as a CSP directive, exactly as before.Commits
Full Changelog: v3.0.0-3...v3.0.0-4
v3.0.0-2...v3.0.0-3
Full Changelog: v3.0.0-1...v3.0.0-3
Important
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: