Skip to content

feat(astro): pass collection name to live content loaders#15349

Merged
ascorbic merged 1 commit intonextfrom
loader-collection-name
Jan 30, 2026
Merged

feat(astro): pass collection name to live content loaders#15349
ascorbic merged 1 commit intonextfrom
loader-collection-name

Conversation

@ascorbic
Copy link
Contributor

Changes

Live content collection loaders now receive the collection name as part of their parameters. This is helpful for loaders that manage multiple collections or need to differentiate behavior based on the collection being accessed.

export function storeLoader({
  field,
  key,
}) {
  return {
    name: "store-loader",
    loadCollection: async ({ filter, collection }) => {
      // ...
    },
    loadEntry: async ({ filter, collection }) => {
      // ...
    },
  };
}

Testing

Added tests

Docs

Need updating

@changeset-bot
Copy link

changeset-bot bot commented Jan 30, 2026

🦋 Changeset detected

Latest commit: 57eeff9

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Jan 30, 2026
@github-actions
Copy link
Contributor

⚠️ Package Trust Level Decreased

Caution

Decreased trust levels may indicate a higher risk of supply chain attacks. Please review these changes carefully.

📦 Package 🔒 Before 🔓 After
eslint-plugin-regexp trusted-with-provenance none
@cloudflare/kv-asset-handler trusted-with-provenance none
@cloudflare/unenv-preset trusted-with-provenance none
workerd trusted-with-provenance none
@sveltejs/vite-plugin-svelte-inspector trusted-with-provenance provenance
@sveltejs/vite-plugin-svelte trusted-with-provenance provenance
jsdoc-type-pratt-parser trusted-with-provenance none
miniflare trusted-with-provenance none
youch provenance none
@cloudflare/workerd-darwin-64 trusted-with-provenance none
@cloudflare/workerd-darwin-arm64 trusted-with-provenance none
@cloudflare/workerd-linux-64 trusted-with-provenance none
@cloudflare/workerd-linux-arm64 trusted-with-provenance none
@cloudflare/workerd-windows-64 trusted-with-provenance none
wrangler trusted-with-provenance none

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 30, 2026

Merging this PR will not alter performance

✅ 9 untouched benchmarks


Comparing loader-collection-name (57eeff9) with next (89b6cdd)1

Open in CodSpeed

Footnotes

  1. No successful run was found on next (6f88013) during the generation of this report, so 89b6cdd was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@ascorbic ascorbic merged commit a257c4c into next Jan 30, 2026
27 checks passed
@ascorbic ascorbic deleted the loader-collection-name branch January 30, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants