Skip to content
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

perf(deps): replace psl with tldts #790

Merged
merged 1 commit into from
Dec 30, 2023
Merged

perf(deps): replace psl with tldts #790

merged 1 commit into from
Dec 30, 2023

Conversation

TonyRL
Copy link
Contributor

@TonyRL TonyRL commented Dec 30, 2023

It runs fast and performant.

Returned object is similar.

image

Background: salesforce/tough-cookie#346

@DIYgod DIYgod merged commit 5d07522 into DIYgod:dev Dec 30, 2023
@DIYgod
Copy link
Owner

DIYgod commented Dec 30, 2023

Thanks so much!

@TonyRL TonyRL deleted the feat/tldts branch December 30, 2023 03:44
@@ -78,7 +78,7 @@ export function getPageRSSHub(data: {

let parsedDomain;
try {
parsedDomain = psl.parse(new URL(url).hostname);
parsedDomain = parse(new URL(url).hostname);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: salesforce/tough-cookie#346 (comment)

Some of these might be relevant depending on your use-case. There are slight differences in default behavior between psl and tldts.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much, private domains will not be used in our extension, so there is no problem.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to shrink the bundle size a bit, there is a version of tldts that only ships with ICANN rules: https://github.com/remusao/tldts/tree/master/packages/tldts-icann#tldts---blazing-fast-url-parsing-icann-rules-only

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.

3 participants