cuchaz, to random
@cuchaz@gladtech.social avatar

Once again I get foiled by switching languages. :blobcatfacepalm2:

In Javascript, you have to compare strings with ===, not ==, or else you'll run into type coercion problems, because Javascript thinks 1 == "1" is a totally fine thing to be true. (it's not)

But in Kotlin, === compares identity not equality for strings. But in the JVM, string values are aggressively cached, so === actually does what you want most of the time. Unless your strings come from weird places, like JNI code. Then you get awful non-deterministic behavior that's incredibly hard to debug, but it totally goes away when you use the correct comparison operator == for strings.

sigh I'm not really as good at this whole programming thing as I should be by now.

happyborg,
@happyborg@fosstodon.org avatar

@cuchaz
Programming is hard.

A skill is choosing systems and tools that make it easier and making meta choices to enable you to maximise your agency in those choices.

I remember the pain I endured learning #nodeJS a decade ago, then looking at #Angular [shudder] and #React hmm.

Then the pleasure that followed learning to use #Svelte and #Rust. You'd have a hard time getting me to use anything else now. Not happening.

My debut Rust project is now part of debian / Ubuntu.

"===" 🤣
#RustLang

khalidabuhakmeh, to dotnet
@khalidabuhakmeh@mastodon.social avatar

Only a few years ago, there was a considerable effort in to make interoperability with a thing... now it seems like all those projects are gone or woefully behind. Bummer :(

ehmicky, to programming
@ehmicky@fosstodon.org avatar

We just released Execa 9, which is our biggest release so far.

If you're currently using Execa, you should check out the new features! Also, if you're currently using zx or Bun shell, you might be interesting in this alternative.

https://medium.com/@ehmicky/execa-9-release-d0d5daaa097f

pawelgrzybek, to programming
@pawelgrzybek@mastodon.social avatar

Node.js 20.13 brought great improvements. My highlights:

► Watch mode is considered stable now
► The util.styleText now accepts an array of modifiers

Of course, I have articles about both of those features! I just updated both of them to reflect new announcements.

“TIL — Node v18.11.0 comes with a watch mode, so you might not need nodemon”
https://pawelgrzybek.com/til-node-v18-11-0-comes-with-a-watch-mode-so-you-might-not-need-nodemon/

“Node.js added utility for text formatting — you may not need chalk anymore”
https://pawelgrzybek.com/node-js-added-utility-for-text-formatting-you-may-not-need-chalk-anymore/

#nodejs

aral, (edited ) to programming
@aral@mastodon.ar.al avatar

This is a niche one but it might help someone in the future:

How to include multiple directories from different places in the file system hierarchy in an archive without including the whole directory structure for any of them.

https://codeberg.org/aral/gists/src/branch/main/how-to-include-multiple-directories-from-different-places-in-the-file-system-hierarchy-in-an-archive-without-including-the-whole-directory-structure-for-any-of-them.md

TL; DR: use symlinks.

aral, to javascript
@aral@mastodon.ar.al avatar

Just published a minor update (version 5.1.1) to JavaScript Database (JSDB) that optimises the custom data type¹ serialisation code by removing a redundant return statement:

https://www.npmjs.com/package/@small-tech/jsdb

This change is backwards compatible and shouldn’t require and updates to your projects, including the ones you have in Kitten (which uses JSDB internally).

¹ https://codeberg.org/small-tech/jsdb#custom-data-types
² https://codeberg.org/kitten/app

#JavaScriptDatabase #JavaScript #database #JSDB #Kitten #SmallWeb #NodeJS #web #dev

tanepiper, to programming
@tanepiper@tane.codes avatar

Anyone else seeing more segfaults with 22 and

Going to have to go back to LTS as pipeline keep failing now when installing dependencies when using caching.

ecmascript_news, to javascript
@ecmascript_news@mastodon.online avatar
joelanman, to programming
@joelanman@hachyderm.io avatar

any opinions on Node.js logging libraries like Winston or Pino? Or do you just write your own logging functions?

aral, to javascript
@aral@mastodon.ar.al avatar
casraf, to typescript
@casraf@fosstodon.org avatar
leanpub, to programming
@leanpub@mastodon.social avatar

P4NR - IoT Programmer https://leanpub.com/b/p4nr-iotprogrammer by Klaus Landsdorf (Iniationware, P4NR), Joel Krec, and Maryam Jalil is the featured bundle on the Leanpub homepage! https://leanpub.com

aral, to programming
@aral@mastodon.ar.al avatar

JSDB 5.0.0 published 🎉

• Custom classes must have a constructor that accepts a parameter object as its only argument. Constructors are run during deserialisation.

• Custom classes can now safely extend other classes (e.g., EventEmitter).

• Properties that begin with an underscore (_) are treated as private and ignored.

• Objects with null prototypes are supported. i.e., objects created with Object.create(null, …).

Full details: https://codeberg.org/small-tech/jsdb#migrating-from-earlier-versions-of-jsdf

#JSDB #NodeJS #database

aral,
@aral@mastodon.ar.al avatar

JSDB 5.0.1 published 🎉

• Fixes #14: Crash if DataProxy getHandler() called on object with null prototype. (https://codeberg.org/small-tech/jsdb/issues/14)

To install update:

npm install @small/jsdb@5.0.1

Learn more about JSDB:

https://codeberg.org/small-tech/jsdb#javascript-database-jsdb

#JavaScriptDatabase #JavaScript #database JSDB #JSDB5 #NodeJS #SmallTech #SmallWeb #web #dev

aral,
@aral@mastodon.ar.al avatar

JSDB 5.1.0 published¹ 🎉

• Forgetting to pass a custom class that’s persisted in your database in your JSDB.open() call now throws instead of corrupting your database by falling back to using an untyped object.

• Added JSDF ver. 2 to 3 database migration script (i.e., JSDB version 2-4 to 5)²

To install update:

npm install @small/jsdb@5.1.0

¹ https://codeberg.org/small-tech/jsdb/releases

² https://codeberg.org/small-tech/jsdb#version-2-to-3

#JavaScriptDatabase #JavaScript #database JSDB #JSDB5 #NodeJS #SmallTech #SmallWeb #web #dev

veganstraightedge, to rails
@veganstraightedge@ruby.social avatar

buildpack question

AFAIK, my app doesn't want/need

How do I tell Heroku to not install install the buildpack at all?

(and remediate this WARNING on every deploy)


WARNING:

Installing a default version (20.9.0) of Node.js.
This version is not pinned and can change over time, causing unexpected failures.
Heroku recommends placing the heroku/nodejs buildpack in front of
heroku/ruby to install a specific version of node

aral, to javascript
@aral@mastodon.ar.al avatar

100% test coverage doesn’t mean your code’s bug free but it did just lead me to find and fix an issue in JavaScript Database (JSDB)¹ with a code path that wasn’t being hit that I would have otherwise missed because it was causing the relevant test to pass.

¹ JSDB is a zero-dependency, transparent, in-memory, streaming write-on-update JavaScript database for the Small Web that persists to a JavaScript transaction log (an append-only log).

https://codeberg.org/small-tech/jsdb

aral,
@aral@mastodon.ar.al avatar

To really drive home the above 👆 point that 100% test coverage does not mean ‘bug free’, just found a bug in JSDB¹ 5.0.0 where running JSON.stringify() on a complex custom object (actually: the automatic Proxy of the custom object created by JSDB) results in an error.

Already have a failing test and about to implement fix.

(It’s at this point where the test harness is invaluable.)

¹ https://codeberg.org/small-tech/jsdb

jperkin, to programming
@jperkin@federate.me.uk avatar

We're hiring!

https://www.mnxsolutions.com/careers/senior-backend-developer

Come and help us maintain and enhance a fully open-source operating system and cloud stack that has been battle-tested in very large production environments.

There are plenty of interesting problems to solve, all the way from writing device drivers and debugging early boot issues, to writing new UIs in Rust.

I think we're a pretty friendly team to work alongside too ;)

Happy to answer any questions.

SceNtriC, to javascript Polish
@SceNtriC@101010.pl avatar

Pytanie do obeznanych z technologiami - czy kojarzycie jakiś framework, który w bardzo prosty sposób pozwala tworzyć CRUDy w celu budowania panelu administracyjnego/CMS-a dla istniejącej bazy (frontend i backend)?

aral, to javascript
@aral@mastodon.ar.al avatar

Realised last night that JavaScript Database (JSDB) doesn’t run the constructor on persisted custom objects (https://codeberg.org/small-tech/jsdb#custom-data-types) when deserialising them because I didn’t know that you apparently have to define your constructor manually when using Object.create().

Will fix it today but it’s something to watch out for if you’re using Object.create() directly.

For more info, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create

ecmascript_news, to javascript
@ecmascript_news@mastodon.online avatar

Node.js 22: require() ESM modules, --run package scripts, --watch files, fs.glob() and more
@nodejs
https://nodejs.org/en/blog/announcements/v22-release-announce

leanpub, to devops
@leanpub@mastodon.social avatar

Learn Kubernetes & Docker - .NET Core, Java, Node.JS, PHP or Python by Arnaud Weil is free with a Leanpub Reader membership! Or you can buy it for $11.99! http://leanpub.com/k8s

kraktoos, to web
@kraktoos@fosstodon.org avatar

Has anyone here tried "wasp lang" (https://wasp-lang.dev/) for full stack dev? Leave some feedback on how it was!

andros, to emacs
@andros@hostux.social avatar

I publish a new article: «Creating desktop applications using the Emacs core»
https://programadorwebvalencia.com/creating-desktop-applications-using-the-emacs-core/

In summary, I can use Emacs to create GUIs with an Elisp backend.

mjgardner,
@mjgardner@social.sdf.org avatar

@andros @marcolas The point is your architecture is the same as , replacing embedded and running with embedded running .

So every app using it has all of ’s disadvantages:
• lowest-common-denominator obviously foreign to the host OS
• non-portable shims to integrate with host OS features
• an individually bespoke runtime consuming storage, memory, and compute as if it were a separate virtual machine

mjgardner,
@mjgardner@social.sdf.org avatar

@boo_ @andros I didn’t foresee anyone turning Google’s browser engine V8 (2008) into the server (, 2009) and desktop (, 2013) runtimes that ate the world, but here we are.

And Electron was originally developed for ’s text editor (2008) before they were acquired by in 2018, subsequently discontinued in favor of in 2022.

Don’t tell me what you can’t see happening if you don’t remember what already did

  • All
  • Subscribed
  • Moderated
  • Favorites
  • anitta
  • InstantRegret
  • magazineikmin
  • hgfsjryuu7
  • ngwrru68w68
  • Durango
  • Youngstown
  • ethstaker
  • slotface
  • khanakhh
  • rosin
  • PowerRangers
  • kavyap
  • DreamBathrooms
  • modclub
  • everett
  • thenastyranch
  • tacticalgear
  • osvaldo12
  • tester
  • cisconetworking
  • mdbf
  • vwfavf
  • cubers
  • GTA5RPClips
  • normalnudes
  • Leos
  • provamag3
  • All magazines