51
1
submitted 4 years ago* (last edited 4 years ago) by AgreeableLandscape@lemmy.ml to c/javascript@lemmy.ml

This is of course assuming you don't have to maintain support for extremely old browsers that actually require semicolons in JavaScript, which you probably don't. Basically, a semicolon and a newline character (edit: I should clarify that I mean the Unix-style LF as opposed to Windows's CRLF, every reasonably modern web browser should understand the former even if it's on Windows) take up the same amount of bytes in both ASCII and UTF-8, so does it really matter if each statement in a minified file is separated by a new line or a semicolon? There is also a benefit to using new lines where it's at least somewhat human readable (albeit without indents) instead of almost completely unreadable if everything was on one line. So why aren't there any minifiers that produce new line separated files?

52
1
53
1
submitted 4 years ago by maakuuu@lemmy.ml to c/javascript@lemmy.ml

Each time I debug JS events I find myself fumbling together event listeners of which I forgot the syntax waaay too often.

It just takes too long.

Recently, I noticed that there is a handy API built into Chrome Developer Tools that makes debugging and logging JS events to the console a brease: The monitorEvents API...

Read how to log all JS events to the console with this new, built-in API.

54
1
55
1
56
1
submitted 4 years ago by jsgohac@lemmy.ml to c/javascript@lemmy.ml

It would be an overstatement to say Microsoft now has an iron grip on JavaScript, a view that is rooted in fear among those who remember the time when Microsoft was openly hostile to open source, Murphy added.

"How you package for Node.js is hardly controlling the future of JavaScript," he said. "Microsoft does have a large play in JavaScript as a whole, but it is an open community."

57
1
58
1
59
1
Announcing TypeScript 3.9 (devblogs.microsoft.com)
60
2
submitted 4 years ago by yogthos@lemmy.ml to c/javascript@lemmy.ml
61
2
submitted 5 years ago* (last edited 5 years ago) by mlaunois@lemmy.ml to c/javascript@lemmy.ml

NodeGUI is an open-source library for building cross-platform native desktop applications with JavaScript and CSS like styling. NodeGui apps can run on Mac, Windows, and Linux from a single codebase.

NodeGUI is powered by Qt 5 which makes it CPU and memory efficient as compared to other chromium based solutions like electron.

Features:

  • Cross platform. Should work on major Linux flavours, Windows and macOS
  • Low CPU and memory footprint. Current CPU stays at 0% on idle and memory usage is under 20 MB for a "hello world" program.
  • Styling with CSS (includes actual cascading). Also has full support for Flexbox layout.
  • Complete Node.js API support (currently runs on Node v12.x - and is easily upgradable). Hence has access to all Node.js compatible npm modules.
  • Native widget event listener support. Supports all event available from Qt / Node.js.
  • ... and many more!

Try it out

git clone https://github.com/nodegui/nodegui-starter
cd nodegui-starter
npm install
npm run build
npm start

Project information

GitHub: https://github.com/nodegui/nodegui
NPM registry: https://www.npmjs.com/package/@nodegui/nodegui
License: MIT
Written in: C++, TypeScript and Python

62
1
submitted 5 years ago by mlaunois@lemmy.ml to c/javascript@lemmy.ml

Testing best practices for JavaScript and Node.js by Yoni Goldberg

63
4
submitted 5 years ago* (last edited 5 years ago) by mlaunois@lemmy.ml to c/javascript@lemmy.ml

If you are new here, welcome to the JavaScript community! This community is entirely dedicated to the JavaScript language.

What is JavaScript?


JavaScript (a dialect of ECMAScript) is a high-level, dynamic, multi-paradigm, object-oriented, prototype-based, weakly-typed, and interpreted language traditionally used for client-side scripting in web browsers. JavaScript can also be run outside of the browser with the use of a framework like Node.js, Nashorn, Wakanda, or Google Apps Script. Despite the name, it is unrelated to the Java programming language and shares only superficial similarities.

What you can do


  • Ask questions about the JavaScript language
  • Ask questions about JavaScript code
  • Ask questions about the ECMAScript standard
  • Compare different ECMAScript versions
  • Share JavaScript code you made
  • Share JavaScript lessons
  • Post nearly everything about JavaScript, or which contains JS code

What you can't do


  • Ask questions about usage of browser Developer Tools
  • Ask questions about code editor usage
  • Post content that is: rude, spam, aggressive, NSFW

Do you have questions?


Post them as comments to this thread!

JavaScript community

829 readers
2 users here now

A community about JavaScript, the ECMAScript standard, and programs that make use of JS such as Node.js.

founded 5 years ago
MODERATORS