Giter Site home page Giter Site logo

Comments (5)

bdukes avatar bdukes commented on June 7, 2024

I've been doing some testing on this, and it appears to be related to gaze taking forever to start watching all the files. If I adjust the glob that's passed to avoid including elm-stuff/, then it takes about a minute to get started, otherwise I've left it running for tens of minutes without the server starting. One small help would be to start gaze asynchronously, so it doesn't block the server starting when it's trying to find everything. I'm not sure if there's a safer default glob to pass, maybe if it was possible to configure the glob (so you could point to a particular directory)?

from elm-live.

bdukes avatar bdukes commented on June 7, 2024

Looks like I exaggerated to myself a bit. I added some timing, and it takes 7-8 minutes to start when elm-stuff is included.

from elm-live.

bdukes avatar bdukes commented on June 7, 2024

Are you attached to using gaze? Since budo has watching built in, I looked at what it's using, chokidar, and it appears to work much better (probably mostly because it's async, not blocking). I can submit a PR with that change, so long as there's not a specific reason you were using gaze.

from elm-live.

tomek-he-him avatar tomek-he-him commented on June 7, 2024

Hi @bdukes, and thanks for all your investigation. I’m absolutely not attached to using gaze and I’ve seen other fine libs and programs use chokidar. I’ll have a look at how it works right away.

However, I’m a bit surprized the gaze call blocks. Have a look at source/elm-live.js:111 – the server should start right away, even before gaze starts looking for files – and gaze is an enchancement which should come later. Is the initial build successful? Perhaps your issue points at a deeper problem?

By the way, disabling elm-stuff/ by default and letting people configure it may be the way forward. I didn’t want to exclude it without making it configurable, because I sometimes develop more than one project in parallel. And I didn’t want to make it configurable as long as it just works. But it seems like it doesn’t just work anymore. 😉

from elm-live.

bdukes avatar bdukes commented on June 7, 2024

Based on what I've seen, the server doesn't start connecting until later (i.e. it's using asynchronous APIs). Since the gaze call blocks, control isn't returned to the event loop to allow the server a chance to do the rest of its work. The timing of it was that the first build does succeed, and I could log the server instance created from calling budo, but the server wouldn't start up (nothing logged, no browser opened, etc.) until after the gaze call, which would take minutes to complete.

It does probably make sense for the watch glob to be configurable, but using chokidar, it does "just work" for me, so that's now a lower priority, from my perspective.

from elm-live.

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.