microlinkhq / metascraper

Get unified metadata from websites using Open Graph, Microdata, RDFa, Twitter Cards, JSON-LD, HTML, and more.
https://metascraper.js.org
MIT License
2.35k stars 168 forks source link

Make JSDOM opt-in #720

Closed masylum closed 4 months ago

masylum commented 4 months ago

This is Pau again, on my quest to fully deprecate jsdom (I want to run metascraper in cloudflare workers). I'm going to fork the project to remove loadIframe from helpers since I'm actually not using any other package that uses that code. Perhaps this is a dependency you also want to extract from helpers on it's own package, so people have the option of removing jsdom dependency if they want to.

Kikobeats commented 4 months ago

Hey Pau!

It could be helpful if jsdom is lazily load just if loadIframe is used?

I would happy to merge any effort there to keep the work in the repo rather than fork it 😆

masylum commented 4 months ago

I gave up after 2 hours fighting with +300 incompatible dependencies of dependencies 😭 I guess I will have to pay egress costs. Maybe I will re-engage with this at some point but yeah, I will open PR as usual if I move this forward no worries.

Kikobeats commented 4 months ago

knowing parsing DOM is CPU intensive, is there any particular gain for running this in Edge (which is more oriented into networking operations) vs. doing in Serverless (after cold start) or regular machine?

masylum commented 4 months ago

I honestly don't care about edge, is just wanted to avoid egress costs, cold starts and remove vendors. But not a big deal at the moment.