-
-
Notifications
You must be signed in to change notification settings - Fork 111
feat: switch to Feedsmith library #249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: switch to Feedsmith library #249
Conversation
lib/generator.js
Outdated
| return generateRssFeed({ | ||
| title: config.title, | ||
| description: config.subtitle || config.description, | ||
| link: encodeURL(url), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is some duplicated code across different formats. Is it possible to remove duplicate codes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! I applied some changes and described here: #249 (comment).
|
Apologies for the amount of changes, but they're all focused on making the code more DRY. The changes: 9ada4a7 TL;DR
FullI reworked the lib/generator.js to split the code into smaller sub-functions. This was necessary because of the difference between Feed and Feedsmith.
To DRY the code I also created intermediate functions ( The changes do not affect the existing functionality, tests implemented in the previous I compiled 2 tables comparing source of the data used to generate feeds and put them at the end of this post. Questions
Old vs New Atom Feed
Old vs New RSS Feed
|
check list
Description
This PR replaces the current use of Feed library with Feedsmith to add support for
hublinks.Recently, I stumbled upon the PR #240 and Issue #239, which has been pending due to lack of
hublinks support in the Feed library. As the creator of Feedsmith, I believe it could serve as a suitable alternative because:fast-xml-parserfor parsing and generatingdetectFeedTypefunctionRegarding changes, I tried to maintain existing functionality with as minimal changes as possible to reduce confusion. If you'd be interested, I can make it more readable by breaking logic into smaller functions for easier maintanence/testing.