-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Abstract Production vs Development #429
Conversation
* This is pre-approved by sizzle ... insert into every project .js file * Redirect existing conditionals to use these properties * The debug library may be improved separately in another issue but needs to and should remain the same property usage * Manual fix some of the missing/extra semi-colons found thanks to @jerone since in here ... this is probably incomplete and needs another go around * Manual fix **some** styleguide conformance found by @jerone with missing space * Remove one of my stale line notes Tested on dev okay Closes OpenUserJS#428
Abstract Production vs Development Auto-merge
Did you just bloat every single file with 3 lines? All to import 3 globals (basically what they are) you're not using because they're not even needed in that file? |
Just a note in case someone is new to debug mode... it can be invoked by: (correction here) $ node debug app.js then type UPDATE 2021 04 17 $ node inspect app.js Same commands available for continuous etc. See also: |
Yes we did... start using them... sizzle is open to debug/dev messages, within limits of course, and more specific production console messages... eventually these could be tracked in a request log from morgan. It's also not our fault that V8 is still in the dark ages with ES5 strict and doesn't support ES6 destructuring arrays/objects yet... in which it would most likely be one line... anywho ... this is also useful for testing/debugging/development and production... obviously use at your discretion but the time of only a few coders understanding the flow of our project is over... this was discussed for many weeks and was one of the primary reasons why some ppl (including initially myself) are/were confused on our project. If you are thinking we should have used the Anyhow... use it if you need it otherwise learn to "ignore" it much like the Hungarian App notation. |
Btw eventually we'll have a little more modification to this but the base structure is this... and you'll probably hate it but I think you'll learn to love it. ;) :) |
Node 11 which isnt the stable release has your fancy es6 stuff. Dictionary unpacking wouldnt make this any better becuase itd still be bloating up files with 1 useless line. My point is dont import it in files that do not use it. Adding bloat doesnt solve the code organisation problems. |
I appreciate your feedback on this but this is something that has been in the works since day one (and probably before)... and especially for the flow of the program. Having a select few understand this is unacceptable... a new issue or more is going to be created shortly to add to this but the base structure stays. If you can find a secure method of doing this cleaner that is fine but the structure must be compatible with ES6 destructuring and obviously not in everyone elses scope. This is part of the _template.js and all .js for now. Both sizzle and I knew you would have an issue with this but I've been debugging code for over 3 decades now and this is integral to application development and is highly absent in nodes infancy coding. |
Ive already solved this twice in two different branches. I made settings.json into config.js mainly to be able to add comments, but also to include logic. 1 inport (on files that actually need it otherwise its dead code). Which you can access with |
Well I took the perceived mutual idea to sizzle and he wants to keep Firstly we need to get |
Making it a js file allows us to write comments for our silly hardcoded numbers and strings. https://github.com/Zren/OpenUserJS.org/blob/pushdescription/config.js Env variables are a requirement. You dont hard code sensitive info into the project. ever. It also allows you to test in a different env easier. |
An example config.js from a welll written project. https://github.com/jedireza/drywall/blob/master/config.example.js |
I wasn't planning on hardcoding anything other than localhost and 8080 in an additional .json... the precedence could still be environment variables (which are a security risk due to server side exploits) but I'm willing to yield if you are that adamant about using it for your bash configuration scripts... then the .json... then hard-coded (which it already is this part). |
Regarding this... the "secrets" are stored as environment variables on nodejitsu (which resembles a .json btw)... so I'm not entirely sure that can work. |
If you want default values if an env var is undefined, just use |
Yes there is and environment variables are highly vulnerable to server side exploits (and they are already stored as .json like as I said above)... but like I said above that can be an upcoming issue... just wanted some preliminary input from you since I think you are the one that requested it months back for running the app on your intranet. |
* Add visible distinction for debug and development modes... using short entries in case font is blocked so it doesn't bust layout... applies to OpenUserJS#429 * Assume pro as default... also pro can be kicked into debug mode which is one of the reasons this has been separated * Some STYLEGUIDE.md conformance * Remove line note... while `aFn` is still non-descript this is an exception for lack of better naming... try to avoid these though. * This also is an additional perk for @TimidScript or others to reuse the `span` attribute for better site integration... consider this a sub-brand to maintain the integrity of the OUJS brand.
* Also at some point *node* changed the way to detect if debugging was in process. Updated original comment at OpenUserJS#429 (comment) Been a while since I've been in this mode for deep debug examination. * Fix missing custom headers for UA. This is optional but didn't know this until now that it had that option for the *github* dep. Post OpenUserJS#1753 Applies to OpenUserJS#1705 Ref(s): * https://nodejs.org/api/inspector.html#inspector_inspector_url * https://nodejs.org/api/debugger.html
* Also at some point *node* changed the way to detect if debugging was in process. Updated original comment at #429 (comment) Been a while since I've been in this mode for deep debug examination. * Fix missing custom headers for UA. This is optional but didn't know this until now that it had that option for the *github* dep. Post #1753 Applies to #1705 Ref(s): * https://nodejs.org/api/inspector.html#inspector_inspector_url * https://nodejs.org/api/debugger.html Auto-merge
Tested on dev okay
Closes #428