Skip to content

ci: release#87

Merged
ascorbic merged 1 commit intomainfrom
changeset-release/main
Jun 21, 2025
Merged

ci: release#87
ascorbic merged 1 commit intomainfrom
changeset-release/main

Conversation

@mixie-bot
Copy link
Copy Markdown
Contributor

@mixie-bot mixie-bot Bot commented Jun 21, 2025

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 main, this PR will be updated.

Releases

@ascorbic/feed-loader@2.0.0

Major Changes

  • #85 8c0c2a0 Thanks @ascorbic! - BREAKING CHANGE: Updated underlying feed parser library

    This release updates the underlying feed parsing library from the previous parser to @rowanmanning/feed-parser, which provides more robust and standardized feed parsing. There is a legacy mode for the previous data shape. This change includes several breaking changes to the data structure:

    Schema Changes

    Category Structure

    • BREAKING: Category objects now use label, term, and url fields instead of name and domain
      • Old: { name: string, domain: string | null }
      • New: { label: string, term: string, url: string | null }

    Media/Enclosure Structure

    • BREAKING: Media objects now include additional fields and renamed properties
      • Old: { url: string, type: string | null, length: number | null }
      • New: { url: string, image: string | null, title: string | null, length: number | null, type: string | null, mimeType: string | null }

    Field Name Changes

    • BREAKING: link field renamed to url
    • BREAKING: guid field renamed to id
    • BREAKING: Atom summary field now maps to description (consistent with RSS)
    • BREAKING: RSS/Atom enclosure/link[@rel=enclosure] elements now map to media array

    Error Message Changes

    • Updated error messages to match new parser behavior:
      • "Item does not have a guid, skipping" → "Item does not have an id or url, skipping"
      • "Response body is empty" → "Feed response is empty"

    Benefits

    • More robust XML/Atom/RSS parsing
    • Better handling of malformed feeds
    • Standardized data structure across feed types
    • Improved character encoding support
    • More comprehensive category and media handling

    Legacy Mode Support

    To ease migration, this release includes a temporary legacy mode that maintains backward compatibility:

    // Enable legacy mode for backward compatibility
    const loader = feedLoader({
      url: "https://example.com/feed.xml",
      legacy: true, // Will show deprecation warning
    });

    ⚠️ Legacy mode is deprecated and will be removed in a future major version. Use it only as a temporary migration aid.

    Migration Guide

    Option 1: Use Legacy Mode (Temporary)

    Enable legacy mode to maintain the old data structure while you plan your migration:

    const loader = feedLoader({
      url: "https://example.com/feed.xml",
      legacy: true,
    });
    // Data will be in the old format with categories[].name, enclosures, link, guid

    Option 2: Update to New Format (Recommended)

    Update your code to handle the new structured data format:

    Field Name Changes

    // Item fields
    item.link  item.url
    item.guid  item.id
    item.pubdate/item.date  item.published
    item.summary  item.description (Atom feeds)
    item.enclosures  item.media

    Author Structure Change

    // Old: Single string format
    item.author = "email (name)";
    
    // New: Array of objects
    item.authors = [{ email: "email", name: "name" }];
    // Access: item.authors[0]?.name, item.authors[0]?.email

    Category Structure Change

    // Old: Array of strings
    item.categories = ["category1", "category2"];
    
    // New: Array of objects
    item.categories = [{ label: "category1", term: "category1", url: null }];
    // Access: item.categories[0].label

    Media/Enclosure Structure Change

    // Old: Basic enclosure format
    item.enclosures = [
      {
        url: "http://example.com/file.mp3",
        type: "audio/mpeg",
        length: "1234",
      },
    ];
    
    // New: Enhanced media format
    item.media = [
      {
        url: "http://example.com/file.mp3",
        mimeType: "audio/mpeg",
        length: 1234,
        image: null,
        title: null,
      },
    ];

    Image Structure Change

    // Old: Simple object with undefined for missing values
    item.image = { url: "http://example.com/image.jpg", title: undefined };
    
    // New: Full object structure
    item.image = {
      url: "http://example.com/image.jpg",
      title: "Image Title",
      description: "Image description",
    };

    Meta Structure Changes

    // Feed generator changed from string to object
    meta.generator = "WordPress"  feed.generator = { name: "WordPress" }
    
    // Authors follow same pattern as items
    meta.author = "email (name)"  feed.authors = [{ email: "email", name: "name" }]

    Most users who only access title, description, url, and basic fields will not need changes.

Minor Changes

  • #88 1049d3e Thanks @ascorbic! - Adds experimental live feed loader

    Adds a new liveFeedLoader for Astro's experimental live content collections feature. This allows RSS/Atom feeds to be fetched at request time rather than build time, enabling real-time content updates without rebuilds.

    Features:

    • Runtime feed loading with liveFeedLoader()
    • Support for RSS, Atom, and RDF feeds
    • Collection filtering (limit, category, author, date ranges)
    • Individual entry loading by ID or URL
    • Structured error handling with FeedLoadError and FeedValidationError
    • TypeScript support with proper generics

    Requirements:

    • Astro 5.10.0 or later
    • Experimental live content collections enabled in astro.config.mjs

    Usage:

    // src/live.config.ts
    import { defineLiveCollection } from "astro:content";
    import { liveFeedLoader } from "@ascorbic/feed-loader";
    
    const news = defineLiveCollection({
      type: "live",
      loader: liveFeedLoader({
        url: "https://feeds.example.com/news.xml",
      }),
    });

    The existing feedLoader remains unchanged and fully compatible.

@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 21, 2025

Deploy Preview for astro-loaders ready!

Name Link
🔨 Latest commit aea3861
🔍 Latest deploy log https://app.netlify.com/projects/astro-loaders/deploys/6856e448ef63db0008923306
😎 Deploy Preview https://deploy-preview-87--astro-loaders.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mixie-bot mixie-bot Bot force-pushed the changeset-release/main branch from a150d0d to aea3861 Compare June 21, 2025 16:56
@ascorbic ascorbic merged commit ecdf149 into main Jun 21, 2025
7 checks passed
@ascorbic ascorbic deleted the changeset-release/main branch June 21, 2025 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant