Giter VIP home page Giter VIP logo

Comments (6)

mantoni avatar mantoni commented on May 27, 2024 1

Mochify is structured relatively modular now. I’m developing towards the goal of having every feature being a thing that is added to the Browserify pipeline. Eventually projects like min-wd and consolify should be plugins that can be optionally installed. The Firefox integration could also be a plugin. I’m dreaming of creating an org for these projects.

In reality, I don’t have the time to realize this. I’m glad to assist and review if you want to help :)

from mochify.js.

m90 avatar m90 commented on May 27, 2024

So puppeteer/puppeteer#3652 got closed and it seems that it should now be possible to run tests against Firefox too (I also think ™️ I just got a test passing on my machine using Firefox following the instructions here: https://github.com/puppeteer/puppeteer/blob/v5.2.1/docs/api.md#puppeteerlaunchoptions).

The nice thing is that this can be achieved by passing a product parameter (i.e. mochify wouldn't need to introduce an extra dependency but only learn about a new option).

Parts that worry me about it though are:

  • The puppeteer version mochify is using is 4 major versions behind, will this require major changes?
  • There are lots of things in mochify that refer to chromium, should all of this be renamed if we'd add Firefox support?
  • Installing Firefox for puppeteer seems brittle right now. Is this something we'd leave up to users or try to have mochify do for them?

from mochify.js.

m90 avatar m90 commented on May 27, 2024

I looked into this a little further.

Upgrading to Puppeteer 5 seems to work with two caveats:

  • we'd have to drop Node 6 and 8
  • Puppeteer now uses the fs.promises API which means Node 10 will log a lot of warnings about its usage. Tests will need to be run with NODE_NO_WARNINGS=1 to silence this

As for running the tests in Firefox, this seems to work mostly, but sometimes Firefox will log unexpected things in addition, sometimes it times out and other times tests fail for reasons I don't understand. It also seems to be pretty slow. I'll look into it further when I find the time to do so.

from mochify.js.

mantoni avatar mantoni commented on May 27, 2024

Thank you for investigating. I'm currently too busy with other things. It would be great to support Firefox. But if it's too brittle, it can wait, I think. I'm not too keen having issues in Mochify that arn't related to the project itself.

My thoughts on your points:

  • Dropping older node versions with a new major release is fine. They're end of life. Especially if we're upgrading puppeteer majors anyway.
  • If puppeteer doesn't run without warnings in node 10 anymore, we should probably drop support for that version too.
  • Things that refer to chromium could be renamed to puppeteer. Should we introduce an additional argument which engine to use?

from mochify.js.

m90 avatar m90 commented on May 27, 2024

But if it's too brittle, it can wait, I think.

I totally share that sentiment. I can keep an eye on how the Firefox integration in Puppeteer evolves and whenever it seems to be mature enough, we can pull it into Mochify. It'd be especially important that you can install both Chromium and Firefox side by side without jumping through too many hoops (right now it's a lot of hoops still).

Should we introduce an additional argument which engine to use?

--engine with a default of chromium sounds fab.

from mochify.js.

m90 avatar m90 commented on May 27, 2024

I just looked into this again and it seems the issue we are seeing with Firefox <-> Puppeteer has not been resolved yet.

Looking for alternatives I tried swapping out Puppeteer with Playwright and this seems to bring us much closer to supporting Firefox. The APIs of the two libraries are mostly identical (18d9123#diff-8aa031d8dc1e01f5f5af954cda92a1e567897406df81a442fb1a494cdb9f3648) and most tests already pass when using Firefox (albeit it's much slower than chromium). There are some Chromium specific things (e.g. --web-security flag) Mochify would need to figure out still, but probably nothing too major.

Since you've been talking about a revamped Mochify @mantoni recently I am not sure however if the effort is worth it (especially considering this will likely bring some breaking changes for consumers in some cases). I'd be happy to spend some time looking into this further in the next few weeks, but I also don't have to.

from mochify.js.

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.