TotallyInformation / node-red-contrib-uibuilder

Easily create data-driven web UI's for Node-RED using any (or no) front-end framework.
https://totallyinformation.github.io/node-red-contrib-uibuilder/#/
Apache License 2.0
457 stars 87 forks source link

Webpack issues #14

Closed colinl closed 7 years ago

colinl commented 7 years ago

In the process of using uibuilder with webpack I have come across a few minor issues. I will detail these once I have sorted them all. I have a strange one though that I don't understand. In uibuilder.js there are many lines like debug && console.log(...) Strictly I think this should read self.debug && console.log(...) When not using webpack it works fine without the self. When using webpack to bundle everything up it does not work without the self. I always like to understand what is going on and (with webpack) if I do console.log(debug) I see debug function debug(type,msg) { if ( !uibuilder.get('debug') ) return let myLog = {} switch ( type ) { case 'error': myLog = console.error break case 'info': myLog = console.info break case 'dir': myLog = console.dir break default: myLog = console.log } myLog(msg) } Now I can't find that code anywhere. Does it make sense to you?

colinl commented 7 years ago

It's ok, I have found it (in uibuilderfe.js). Don't know why me search last time failed. Also don't know why it works ok when webpack not being used.

colinl commented 7 years ago

Aargh, just noticed you have changed all that code anyway. Will close this and start again. Sorry for the noise.

TotallyInformation commented 7 years ago

Sorry :-) yes, I've reorganised as you've seen. The new function is a lot cleaner.