Skip to content

v2: Modernize dependencies and prepare v2 module #254

@mmcdole

Description

@mmcdole

Overview

Part of gofeed v2 development. This issue tracks modernizing dependencies, updating the Go version, and preparing the module for v2 release following Go module conventions.

Goals

  • Update Go version to a more recent stable version (e.g., Go 1.21 or 1.22)
  • Review and update all dependencies to their latest stable versions
  • Replace dependencies with stdlib alternatives where possible
  • Ensure minimal dependency footprint for the core library
  • Properly version the module as v2 following Go module conventions

Tasks

Dependencies & Modernization

  • Update Go version in go.mod (1.21+)
  • Audit all current dependencies for:
    • Security vulnerabilities
    • Maintenance status (last updated, open issues)
    • Whether they can be replaced with stdlib
  • Update all dependencies to latest stable versions
  • Run go mod tidy to clean up
  • Document any dependencies that could be replaced with stdlib but require significant refactoring

v2 Module Preparation

  • Change module declaration to module github.com/mmcdole/gofeed/v2
  • Update all internal imports to use /v2 suffix
  • Create migration guide for v1 to v2 users
  • Document breaking changes and minimum Go version requirements

Future Considerations

  • Evaluate moving cmd/ftest to a separate module to avoid pulling in CLI dependencies (currently uses urfave/cli) - see Dependency update needed #128
  • Consider if any other structural changes would benefit library users

Current Dependencies Review

The library currently depends on:

  • PuerkitoBio/goquery - HTML parsing for feed detection
  • json-iterator/go - JSON parsing performance
  • mmcdole/goxpp - XML pull parsing
  • urfave/cli - Only used by cmd/ftest, not the library itself
  • golang.org/x/net - HTML parsing support
  • golang.org/x/text - Character encoding

Version Migration Strategy

Following Go module conventions for v2:

  • Module path becomes github.com/mmcdole/gofeed/v2
  • Users import with: import "github.com/mmcdole/gofeed/v2"
  • v1 continues to work unchanged at github.com/mmcdole/gofeed
  • This prevents breaking existing v1 users when v2 is released

References

Labels

  • v2
  • enhancement

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions