Echo JS 0.11.0

<~>

tracker1 comments

tracker1 1926 days ago. link 2 points
Even then... most modern JS is written in modules (cjs or esm)...

    //module singleton...
    let numProcess = 0;

    export default { // or module.exports for cjs
      increment: () => numProcess++,
    };

Can still have the internal numProcess private.
tracker1 1926 days ago. link 1 point
Nice tutorial... SVG in React has been incredibly useful.  I would make a minor suggestion, and that would be to just embed the styles into the component render directly, instead of CSS for this type of component, if making it for a reusable case.

This is also a really good approach for something like simple pie charts, etc... most of the frameworks that provide charts/graphs are very big, when all you might need is a little SVG.  I've also used SVG for scalable content display and overlays...  Inside the SVG, you can use the actual image (say from a scan) dimensions, where outside, you use the containing sizes.

React + SVG = <3
tracker1 1927 days ago. link 3 points
No... no, no, no, no...

It's either a string, or a literal object... there's NO SUCH THING as a JSON Object in JS.

JSON is a serialization format for Objects... the syntax matches the JSON literal syntax with certain restrictions (double quotes around object keys, etc).

When it's a literal, it's just Object Notation, not a JSON object.
tracker1 1927 days ago. link 2 points
Interesting... looked to check... should probably note in the Readme that this is NODE ONLY, not for browser use... my first concern is that someone might put this in a browser exposing their API access.
tracker1 1928 days ago. link 1 point
https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity

You can think of the specificity of a rule as similar to a multi-part number (A.B.C.D).

A. sum of identity selectors
B. sum of class selectors
C. sum of type selectors
D. order of rule matching the given weight

!important will override a prior directive, later !important likewise.  it should be used only as a last resort, and you should re-think your structure if you ever need it.
tracker1 1928 days ago. link 1 point
One comment on the use... this isn't the best way to use dotenv... the way tfa is using it is as a configuration file, not as a system environment helper.  You should combine the .env loading with your system environment and single out the environment variables you are using.  The way the it is being used will hinder use of a container or orchestration system like docker and/or kubernetes and just bypasses the intent of how .env files should work, mostly for local development.

Aside: just not a big fan of ORMs for use with scripted languages... I prefer implicit queries against the data store.  From there it's easy enough to transform to/from your typescript class/interface based structures.  In fact, with template string processors, it can be much, much cleaner and simpler to just use SQL for your queries, without the level of boilerplate or impedance that an ORM introduces in a scripted language.
tracker1 1928 days ago. link 1 point
Reminds me a bit of Joi, which is what I've been using for my API interface validation as a Koa extension.
tracker1 1928 days ago. link 1 point
I just clicked the allBrowser, and download on the website, I was curious what the bundle size would be... after download, Windows Defender isolated the download with that marker.
tracker1 1928 days ago. link 1 point
Did a browserAll build...

Trojan:JS/Foretype.A!ml
[more]