Meyerweb, (edited ) to random
@Meyerweb@mastodon.social avatar

Here’s a question: suppose I have bunch of HTML inputs (dropdowns, sliders, whatever), and I want their values to set the values of #JS variables, both on load and whenever changed. Is there a way to do that in a generic manner short of dumping all the variables into an object so I can use their member names using array-ish syntax, or pushing everything through an eval()? [shudder]

**Edited to add: **I don’t think I got the idea across, so here’s something tangible: https://codepen.io/meyerweb/pen/GRLyZWY

sil,
@sil@mastodon.social avatar

@Meyerweb @hi_mayank @kolya @joelanman ah, what you want can't sensibly be done in the way you're looking for, sadly. In the old days "var whatever" set window.whatever, but let (and const) variables aren't on the window object, and there's no way to set a let variable "dynamically" from code if you have its name in a string, at least not that I know of.

ctietze,
@ctietze@mastodon.social avatar

@hi_mayank @Meyerweb The form approach is pretty cool!

AndriiKuznietsov75, to Java Ukrainian
@AndriiKuznietsov75@social.kyiv.dcomm.net.ua avatar

Як працюють компіляція та виконання коду👇
🔸Компілювані мови (#C, C++, #Go)
Вихідний код перетворюється компілятором на машинний. Машинний код виконується безпосередньо процесором.
🔸Байт-код (#Java, C#)
Вихідний код компілюється у байт-код, а потім JVM виконує програму. Іноді JIT-компілятор компілює вихідний код у машинний, щоб прискорити виконання.
🔸Інтерпретовані мови (#Python, #JS, #Ruby)
Тут для виконання програми не потрібен машинний код, натомість програму рядково виконають інтерпретатори.

video/mp4

maxd,
@maxd@mastodon.social avatar

@tshirtman @AndriiKuznietsov75 IIUC that's also the case for Ruby. And of course, languages don't mandate a specific flow, it's an implementation detail. There's RubyMotion/DragonRuby compiled to native, or PyPy that JIT-compiles Python.

tshirtman,
@tshirtman@mas.to avatar

@maxd @AndriiKuznietsov75 yeah, i though it was probably the case for ruby as well, but i know much less about it, and didn't want to spend the time researching, but i would be a bit surprised if it's directly interpreted. And afaik JS is also JIT in most implementations. Direct interpretation certainly leaves a lot of performance on the table.

Jbasoo, to programming
@Jbasoo@mastodon.social avatar

I just want to buy a bath mat from a major UK retailer but half the elements won't hydrate, including the add to cart button. Excessive #JS was a mistake we just won't stop making.

iamdtms, (edited ) to javascript
@iamdtms@mas.to avatar
Simply DOM Preloader for not having issues with data loading delays  

https://codepen.io/iamdtms/pen/NWmgdmm

mrnhmath, to programming
@mrnhmath@mastodon.social avatar

Friendly reminder that XULRunner, the standalone Gecko runtime that once powered web-based applications like Songbird and that was abandoned by Mozilla Corporation has been revived and now builds atop Goanna. Learn more at the Pale Moon forums announcement: https://forum.palemoon.org/viewtopic.php?f=62&t=30913

CoBC, to cpp French

Si vous connaissez quelqu'un qui connaît quelqu'un qui a son oncle qui connaît quelqu'un dont le voisin recherche quelqu'un pour un poste de développeur soit web soit c++ (+ Qt éventuellement) je suis preneur. Boosts appréciés
#C++ #C

vanilla, to webdev
@vanilla@social.spicyweb.dev avatar

Sometimes #WebComponents need to know what’s happening inside of them.

Whether you’re working with the concept of “slots” or just plain ol’ #HTML, you may need to react to changes imposed from without.

Thankfully, the native platform provides a solution in the form of MutationObserver, an API which is so powerful it can beat at the heart of entire #JS frameworks (Stimulus being but one example).

#WebDev examples by @raymondcamden and @jaredwhite:

https://thathtml.blog/2024/03/more-fun-with-web-components-and-mutationobserver/

alephoto85, to javascript Italian
@alephoto85@livellosegreto.it avatar

WinterJS 1.0 · Blog · Wasmer

@programmazione

"WinterJS 1.0 è finalmente arrivato.

WinterJS è un runtime Javascript incredibilmente veloce, compatibile con WinterCG e scritto in Rust, che utilizza il motore SpiderMonkey per eseguire JavaScript e Tokio per gestire le richieste HTTP e il ciclo di eventi JS. Il runtime WinterJS può anche essere compilato in WebAssembly e come tale è il primo runtime[...]"

https://wasmer.io/posts/winterjs-v1

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

Hey folks, I just released Auto Encrypt Localhost* v8.4.0 with better async support and updated dependencies.

https://www.npmjs.com/package/@small-tech/auto-encrypt-localhost

  • My pure JavaScript module (no mkcert, certutil, etc., required) that automatically provisions and installs locally-trusted TLS certificates for Node.js https servers.

(There seems to be an issue with tests failing on macOS, will debug that tomorrow and likely post a patch release.)

aral,
@aral@mastodon.ar.al avatar

@serapath PS. Also, another thing it allows you to do is to test from other devices on your local network via IP address (the certificate automatically supports all local IP addresses your dev machine is reachable from). So you don’t need to use a VPN / ngrok / pagekite, etc., to test your sites with multiple devices if they use https-only features.

aral,
@aral@mastodon.ar.al avatar

Quick update: the failing tests were apparently because I had my VPN on on macOS (that was creating an additional IPv4 interface that was getting picked up by the tests that check that your server is accessible via a valid TLS certificate from all available local IPs).

So no patch necessary :)

alephoto85, (edited ) to programming Italian
@alephoto85@livellosegreto.it avatar

[Tutorial] Introduzione/Benvenutə in Svelte

@programmazione

Svelte è uno strumento per la costruzione di applicazioni web. Come altri framework per interfacce utente, consente di costruire l'applicazione in modo dichiarativo con componenti che combinano markup, stili e comportamenti.
Questi componenti sono compilati in piccoli ed efficienti moduli JS che eliminano il sovraccarico tradizionalmente associato ai framework UI.

#programmazione #js #svelte #dev @vikkio 🙏

https://learn.svelte.dev/tutorial/welcome-to-svelte

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

Recorded the first video with my new setup last night, about Kitten’s new Streaming HTML workflow.

(And, unlike most quick demos, it doesn’t ignore accessibility.)

It’ll be part of a long blog post dissecting exactly how it works, step by step.

Here’s a little peek before that.

Let me know what you think :)

:kitten: 💕

https://vimeo.com/920601063

(You can install Kitten and play along: https://codeberg.org/kitten/app#getting-started)

#Kitten #SmallWeb #StreamingHTML #accessibility #a11y #html #js #nodeJS #web #dev

aral,
@aral@mastodon.ar.al avatar

PS. I’ve tried my best to get a system together where I don’t have to edit videos after recording them. So that’s just one take, no edits, apart from to the transcript to fix automatic transcription errors and to add a bit more context about when I’m speaking versus when the screen reader is speaking.

aral,
@aral@mastodon.ar.al avatar

@bitnik Yay! Let me know how you get on with it. (And remember, it’s still pre-release.) :)

schizanon, to node

Node.js now has a built-in API for styling text

(similar to chalk, picocolors, etc)

https://nodejs.org/docs/latest/api/util.html#utilstyletextformat-text

shino, to php French
@shino@shelter.moe avatar

Dites-moi les developpeur PHP symfony et ceux qui font un peu de JS aussi.

J'ai mon serveur PHP qui me renvoie un JWT quand c'est correct.

J'ai lu qu'une bonne pratique consistait à envoyer le ou les tokens dans un cookies avec le secure à true. Seulement, j'en fait quoi moi après côté font en SvelteJS ?

#php #symfony #js

pablolarah, to webdev
@pablolarah@mastodon.social avatar

🦊 Readability.js
by @mozilla
A standalone version of the readability library used for Firefox Reader View.

https://github.com/mozilla/readability

nosherwan, (edited ) to javascript
@nosherwan@fosstodon.org avatar

:nodejs: :javascript: :typescript:

State of JS Runtime

I suggest we have a new survey similar to state of JS called state of JS runtime, to get an idea of which runtimes are most popular in the industry & what are they being used for. (its merely a question in StateOfJS)






🙋🏽‍♀️
Which runtime do you use & for what purpose?

sirber,
@sirber@fosstodon.org avatar

@nosherwan for my next js project, it will be deno. It's the real successor of node. But in the meantime, I'm with go 😁 and I love it.

sirber,
@sirber@fosstodon.org avatar

@nosherwan node hasn't fully embraced ES6 modules that came out almost ten years ago, let alone typescript. Bun is fast, yes, they support typescript, but that's about it. #Deno also has #typescript built-in, and adds extra security, a new package system, and lots of new features. I can even compile a binary.

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