remusao / broxy

Your Privacy Bro!
1 stars 1 forks source link

Display Cliqz module list #18

Closed chrmod closed 6 years ago

chrmod commented 6 years ago

This PR attempts to list Cliqz modules in the Elm app.

chrmod commented 6 years ago

Elm type generator does not handle type Array<string>, it throws this error:


    ERROR in ./src/elm/Broxy.elm
    Module build failed: Error: Compiler process exited with error Compilation failed
    -- NAMING ERROR ---------------------------------- ./src/elm/TsElmInterfaces.elm

    Cannot find variable `decodeJEncode`

    46|         |: JDecode.field "modules" decodeJEncode.Value_is_not_implemented
                                           ^^^^^^^^^^^^^

    Detected errors in 1 module.

        at ChildProcess.<anonymous> (/home/chrmod/Projects/cliqz-oss/broxy/node_modules/node-elm-compiler/index.js:141:27)
        at emitTwo (events.js:125:13)
        at ChildProcess.emit (events.js:213:7)
        at maybeClose (internal/child_process.js:927:16)
        at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
     @ ./src/static/renderer.ts 6:14-37
remusao commented 6 years ago

@chrmod Regarding the type generation, that looks like a bug. I'll fix it.

remusao commented 6 years ago

@chrmod Interestingly, it seems that the typescript parser does not handle Array<string> and string[] the same way, although they should be equivalent. Also, it seems the typescript linter discourages the use of Array<string> (for some reason that I don't know). So as a work-around, I would suggest we use string[] instead, which is supported by the type generation. I will come up with a fix anyway.