MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Details about Nunjucks templating system?

    Scheduled Pinned Locked Moved Development
    11 Posts 4 Posters 8.0k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      j.e.f.f Project Sponsor Module Developer @strawberry 3.141
      last edited by

      @strawberry-3-141 I forgot that that hook even existed! Maybe I can give that a try, but I wonder it means I’ll have stale data… if the module is suspended, does that mean it doesn’t respond to socket notifications from the helper, or even send socket notification to trigger a data pull?

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @j.e.f.f
        last edited by

        @j-e-f-f said in Details about Nunjucks templating system?:

        if the module is suspended, does that mean it doesn’t respond

        no… it just doesn’t get called at getDom()… least thats how my modules see it…
        you can’t present new info unless the getDom() method is called

        your module can call updateDom() to request the callback at getDom(), but you are suspended… so the callback never happens

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        J 1 Reply Last reply Reply Quote 0
        • J Offline
          j.e.f.f Project Sponsor Module Developer @sdetweil
          last edited by

          @sdetweil ok sounds like that’s the ticket then. I’m going to try updating DarkSky with the template system and see how it behaves. Will report back when I know more.

          1 Reply Last reply Reply Quote 1
          • J Offline
            j.e.f.f Project Sponsor Module Developer
            last edited by

            OK I’ve got a version of MMM-DarkSkyForecast using the Nunjucks templating system. Seems to be working well… will run it for a few days to observe. Funny thing is I didn’t need to put anything in the resume() hook… it just… works.

            You can see my work here:
            https://github.com/jclarke0000/MMM-DarkSkyForecast/tree/templated

            I original ran into the problem with my calendar module, which does a DOM update for each configured calendar, which results in a burst of DOM updates… I wonder if the issue has to do with frequent successive DOM updates.

            1 Reply Last reply Reply Quote 1
            • J Offline
              j.e.f.f Project Sponsor Module Developer
              last edited by

              Seems to be no issues. I’ve released v1.6 of MMM-DarkSkyForecast using the Nunjucks templating system. Seems like my way forward from here :)

              I’ll have to go back and revisit MMM-MyCalendar to see what caused the issue.

              1 Reply Last reply Reply Quote 2
              • 1
              • 2
              • 2 / 2
              • First post
                Last post
              Enjoying MagicMirror? Please consider a donation!
              MagicMirror created by Michael Teeuw.
              Forum managed by Sam, technical setup by Karsten.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy