Giter Site home page Giter Site logo

Comments (4)

ianstormtaylor avatar ianstormtaylor commented on August 31, 2024

Ah interesting. Yeah definitely would consider it. I kind of just used JSDOM because I figured that would be best for consistency on server/browser without having to do anything in the browser case. It seems like Cheerio is much faster and less memory leaky? I don't know a ton about either really.

For the Cheerio solution, we could even potentially bundle jQuery on the browser side and pass a real jQuery object? Or just bundle Cheerio there as well and parse the innerHtml?

Open to ideas for what the best solution would look like! Ideally it keeps it nicely parallel in both places, and easy to implement/manage for us at the metascraper level. I'm not super worried about browser-side file size, since it would mostly be for things like Chrome extensions or other cases I'd think.

from metascraper.

ianstormtaylor avatar ianstormtaylor commented on August 31, 2024

Replaced in 0.1.1! Way faster too, nice call

from metascraper.

ianstormtaylor avatar ianstormtaylor commented on August 31, 2024

Also, I opted to just keep it to a single code path (no more browser/server) since my only valid browser use case so far is for chrome extensions, where the Cheerio filesize isn't the worst. But we could always get smarter later with jQuery or something (dunno if that's even smaller).

from metascraper.

blakeembrey avatar blakeembrey commented on August 31, 2024

One code path is awesome 😄 If anything, I'd make a separate endpoint that wraps around window and other interfaces later.

from metascraper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.