Code Monkey home page Code Monkey logo

Comments (10)

sdetweil avatar sdetweil commented on August 24, 2024

see
https://forum.magicmirror.builders/topic/18852/magicmirror-regions

from magicmirror.

khassel avatar khassel commented on August 24, 2024

yes, the mentioned PR causes your problems.

AFAIR this was implemented to prevent crashes so we have less support.

@rejas @sdetweil from my side we could add an additional parameter in config.js to allow custom positions so that these (hopefully experienced) users don't have to fix this by changing our code.

from magicmirror.

sdetweil avatar sdetweil commented on August 24, 2024

@khassel yes prevent crashes but could be an optional property as u suggest. I also suggested code to do discovery, but could be trouble depending, on above

from magicmirror.

AryasDad avatar AryasDad commented on August 24, 2024

My vote would be to scan the index file for the regions when it does the check. It seems like this ability is already built-in somewhat to the codebase since it was able to use the custom regions before.

However, I always have to remember to replace the index file with my custom after an update, so having the alternative means to add these in via config or other means would also be good. Maybe a way to add a custom section similar to how you can do a custom CSS that gets injected into the index file automagically. That way if an update doesn't wipe out core manual updates.

from magicmirror.

sdetweil avatar sdetweil commented on August 24, 2024

before we we didn't validate the regions. but if it was wrong, there was a fatal error.. and MM didn't come up
we found a case with no module: and fixed that, and decided to validate the position names too.. this is what caught you..

I did write a sample bit of JS to extract the names from the index.html file.. and ad d them to the list to validate against.
if I can find it again..

from magicmirror.

sdetweil avatar sdetweil commented on August 24, 2024
const fs = require('fs')
const indexFile =   'index.html'

let lines = fs.readFileSync(indexFile).toString().split('\n')
let regionRegex = /"region ([^"]*)/i

lines.forEach(l =>{
        let results=regionRegex.exec(l)
        if(results && results.length>1){
           console.log("region='"+results[1].replace(' ','_')+"'")
        }
})

from magicmirror.

khassel avatar khassel commented on August 24, 2024

my above PR brings back the situation of v2.27.0, so this would solve this issue but still no solution for the index.html file.

We often had discussions about custom regions, but that was never implemented, e.g. #3231.

If we implement such a solution, it should be robust and not result in increased support.

from magicmirror.

sdetweil avatar sdetweil commented on August 24, 2024

well, your pr suspends checking. does not check new region names too.

from magicmirror.

khassel avatar khassel commented on August 24, 2024

as I said, brings back the situation of v2.27.0, not more

from magicmirror.

sdetweil avatar sdetweil commented on August 24, 2024

I thought you would make the property for an array of position names, to add/replace the default ones vs a flag to not check

from magicmirror.

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.