Open AllanOricil opened 2 months ago
????
????
The way you wrote your node has a high chance of it being dead in a few browser/node releases, or not even work in firefox/safari. Most NR node developers are following the same trap because of lack of knowledge about web development, unfortunately. The NR docs for nodes doesn't explain how web dev changes fast.
Besides it, nodes built with the nrg framework have a way cleaner code. You write a lot less, because all the boilerplate code is generated at built time.
Using nrg will make your node future proof to browser and node changes. Nodes built with nrg have their javascript for both client and server automatically updated to the latest ecma specs. Stylesheets are also updated to include vendor specific css. Besides it, the outputed artifact has all js, css and html minified, which will make it run and load faster in the browser. It also enables debugging both client and server js and css with ease, using source maps, in the browser and in vscode.
nrg projects are way easier to maintain.
Just run
npm run install
and thennpm run start
to have a node-red environment with your custom nodes available.Use
npm run watch
if you want to have your code changes applied automatically after saving them. No more manual stop/start of node-red.https://github.com/AllanOricil/nrg-cli
Demo:
https://github.com/user-attachments/assets/62d690fa-5fb8-4fb2-a0cf-631e267b45db