Coder Social home page Coder Social logo

Comments (3)

IlyaSemenov avatar IlyaSemenov commented on May 24, 2024

I think that time-fix-plugin could be not doing its stuff properly. I added a few console logs:

    compiler.watch = function () {
      console.log(`[${new Date()}] time-fix-plugin compiler.watch`)
      watching = watch.apply(this, arguments)
      console.log(`[${new Date()}] time-fix-plugin compiler.watch created watching`)
      return watching
    }

    compiler.hooks.watchRun.tap('time-fix-plugin', () => {
      console.log(`[${new Date()}] time-fix-plugin watchRun watchin ${watching && new Date(watching.startTime)}`)
      if (watching) {
        watching.startTime += this.watchOffset
        offsetApplied = true
      }
    })

and the output is:

❯ ../../bin/cli.js dev|tee /dev/null
>>> writing create app file
>>> writing create app file complete
[Mon Oct 15 2018 17:07:01 GMT+0700 (Novosibirsk Standard Time)] time-fix-plugin compiler.watch
[Mon Oct 15 2018 17:07:01 GMT+0700 (Novosibirsk Standard Time)] time-fix-plugin watchRun watchin undefined
[5:07:01 PM] Compiling client
[Mon Oct 15 2018 17:07:01 GMT+0700 (Novosibirsk Standard Time)] time-fix-plugin compiler.watch created watching
[Mon Oct 15 2018 17:07:01 GMT+0700 (Novosibirsk Standard Time)] time-fix-plugin compiler.watch
[Mon Oct 15 2018 17:07:01 GMT+0700 (Novosibirsk Standard Time)] time-fix-plugin watchRun watchin undefined
[5:07:01 PM] Compiling server
[Mon Oct 15 2018 17:07:01 GMT+0700 (Novosibirsk Standard Time)] time-fix-plugin compiler.watch created watching
(node:4165) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
[5:07:02 PM] Compiled server in 730ms
report-change
[17:7:2] Rebuilding due to changes made in .ream/create-app.js
[5:07:02 PM] Compiled client in 876ms

  App running at:

  - Local: http://localhost:4000
  - Network: http://172.22.10.217:4000
report-change
[17:7:1] Rebuilding due to changes made in .ream/create-app.js
[Mon Oct 15 2018 17:07:02 GMT+0700 (Novosibirsk Standard Time)] time-fix-plugin watchRun watchin Mon Oct 15 2018 17:07:02 GMT+0700 (Novosibirsk Standard Time)
[5:07:02 PM] Compiling server
[5:07:02 PM] Compiled server in 28ms

  App running at:

  - Local: http://localhost:4000
  - Network: http://172.22.10.217:4000
[Mon Oct 15 2018 17:07:02 GMT+0700 (Novosibirsk Standard Time)] time-fix-plugin watchRun watchin Mon Oct 15 2018 17:07:02 GMT+0700 (Novosibirsk Standard Time)
[5:07:02 PM] Compiling client
[5:07:02 PM] Compiled client in 24ms

  App running at:

  - Local: http://localhost:4000
  - Network: http://172.22.10.217:4000

you can see that during the first watchRun hook invocation, watching is still undefined (because watch.apply has not completed). This probably (?) leads to the false positive.

However it's not not necessary the cause because when I add a 1 second pause to writeCreateAppFile(), it never rebuilds multiple times:

❯ ../../bin/cli.js dev|tee /dev/null
>>> writing create app file and pausing 1 second
>>> writing create app file complete
[Mon Oct 15 2018 17:12:51 GMT+0700 (Novosibirsk Standard Time)] time-fix-plugin compiler.watch
[Mon Oct 15 2018 17:12:51 GMT+0700 (Novosibirsk Standard Time)] time-fix-plugin watchRun watchin undefined
[5:12:51 PM] Compiling client
[Mon Oct 15 2018 17:12:51 GMT+0700 (Novosibirsk Standard Time)] time-fix-plugin compiler.watch created watching
[Mon Oct 15 2018 17:12:51 GMT+0700 (Novosibirsk Standard Time)] time-fix-plugin compiler.watch
[Mon Oct 15 2018 17:12:51 GMT+0700 (Novosibirsk Standard Time)] time-fix-plugin watchRun watchin undefined
[5:12:51 PM] Compiling server
[Mon Oct 15 2018 17:12:51 GMT+0700 (Novosibirsk Standard Time)] time-fix-plugin compiler.watch created watching
(node:4554) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
[5:12:52 PM] Compiled server in 696ms
[5:12:52 PM] Compiled client in 818ms

  App running at:

  - Local: http://localhost:4000
  - Network: http://172.22.10.217:4000

@egoist thoughts?

from deprecated.

IlyaSemenov avatar IlyaSemenov commented on May 24, 2024

@egoist please see the suggested fix: egoist/time-fix-plugin#2

I can't say I'm 100% sure in the fix, but it fixes this issue and doesn't break watching. I could be missing something of course.

from deprecated.

IlyaSemenov avatar IlyaSemenov commented on May 24, 2024

🎉 This issue has been resolved in version 3.3.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

from deprecated.

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.