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 opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to next, this PR will be updated.
next
is currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, runchangeset pre exit
onnext
.Releases
[email protected]
Major Changes
#11859
3804711
Thanks @florian-lefebvre! - Changes the defaulttsconfig.json
with better defaults, and makessrc/env.d.ts
optionalAstro's default
tsconfig.json
in starter examples has been updated to include generated types and exclude your build output. This means thatsrc/env.d.ts
is only necessary if you have added custom type declarations or if you're not using atsconfig.json
file.Additionally, running
astro sync
no longer creates, nor updates,src/env.d.ts
as it is not required for type-checking standard Astro projects.To update your project to Astro's recommended TypeScript settings, please add the following
include
andexclude
properties totsconfig.json
:Minor Changes
#11911
c3dce83
Thanks @ascorbic! - The Content Layer API introduced behind a flag in 4.14.0 is now stable and ready for use in Astro v5.0.The new Content Layer API builds upon content collections, taking them beyond local files in
src/content/
and allowing you to fetch content from anywhere, including remote APIs. These new collections work alongside your existing content collections, and you can migrate them to the new API at your own pace. There are significant improvements to performance with large collections of local files. For more details, see the Content Layer RFC.If you previously used this feature, you can now remove the
experimental.contentLayer
flag from your Astro config:Loading your content
The core of the new Content Layer API is the loader, a function that fetches content from a source and caches it in a local data store. Astro 4.14 ships with built-in
glob()
andfile()
loaders to handle your local Markdown, MDX, Markdoc, and JSON files:You can then query using the existing content collections functions, and use a simplified
render()
function to display your content:Creating a loader
You're not restricted to the built-in loaders – we hope you'll try building your own. You can fetch content from anywhere and return an array of entries:
For more advanced loading logic, you can define an object loader. This allows incremental updates and conditional loading, and gives full access to the data store. It also allows a loader to define its own schema, including generating it dynamically based on the source API. See the the Content Layer API RFC for more details.
Sharing your loaders
Loaders are better when they're shared. You can create a package that exports a loader and publish it to npm, and then anyone can use it on their site. We're excited to see what the community comes up with! To get started, take a look at some examples. Here's how to load content using an RSS/Atom feed loader:
To learn more, see the Content Layer RFC.
Patch Changes
#11902
d63bc50
Thanks @ascorbic! - Fixes case where content layer did not update during clean dev builds on Linux and Windows#11914
b5d827b
Thanks @ascorbic! - Exports types for allLoaderContext
properties fromastro/loaders
to make it easier to use them in custom loaders.The
ScopedDataStore
interface (which was previously internal) is renamed toDataStore
, to reflect the fact that it's the only public API for the data store.@astrojs/[email protected]
Patch Changes
#11894
cc820c5
Thanks @Fryuni! - Fixes mixed environment variable for app token when using DB commands with libSQL remote.Updated dependencies []: