JavaScript

khalidabuhakmeh,
@khalidabuhakmeh@mastodon.social avatar

I’m about to make many developers feel very old. Apologies in advance.

https://mootools.net/

nemeciii, (edited )
@nemeciii@mastodon.social avatar

@khalidabuhakmeh I was more into http://prototypejs.org/

When I started pushing web in 2002 we had none of these, just unstable JS and some poor CSS.

cspray,
@cspray@phpc.social avatar

One time I found some in an app that was constructing a full blown SELECT statement in SQL, sending it to the server, and then blindly executed on that server.

It is still the most glorious, beautiful code I've ever seen.

ramsey,
@ramsey@phpc.social avatar

@cspray This sounds like a Good Thing™.

simon,
@simon@simonwillison.net avatar

@cspray I did that once for a project as a joke (against a read-only SQL API) and found it was actually a really neat way to rapidly iterate on my project!

You can view source on https://sf-trees.com to see a demo of the pattern I built

baumannzone, Spanish
@baumannzone@techhub.social avatar
keithjgrant,
@keithjgrant@front-end.social avatar

@baumannzone This has to do with how floating point numbers are stored (essentially, they’re fractions, not decimals). This occurs in most programming languages, not just JS. Look up “floating point rounding error”

keithjgrant,
@keithjgrant@front-end.social avatar

@baumannzone Here's python doing the exact same thing

nucliweb,
@nucliweb@webperf.social avatar

Comprehensive guide to JavaScript performance analysis using Chrome DevTools

https://blog.jiayihu.net/comprenhensive-guide-chrome-performance/

ricmac,
@ricmac@mastodon.social avatar

This was the top performing post on @TheNewStack last week, so it seems there is a tremendous amount of interest in a post-React future among web developers. Maybe my Gmail analogy wasn’t far off after all ;) https://thenewstack.io/from-react-to-html-first-microsoft-edge-debuts-webui-2-0/ https://mastodon.social/@ricmac/112531029962000384

ecmascript_news,
@ecmascript_news@mastodon.online avatar

fetch-in-chunks: fetching large files in chunks, with parallel downloads, progress tracking and request abortion
@tomayac
https://github.com/tomayac/fetch-in-chunks/

jesus,
@jesus@mastodon.gamedev.place avatar
joelanman,
@joelanman@hachyderm.io avatar

given delete is a keyword in JavaScript, what word do you use for a function that deletes in your own code? del, destroy, other?

joelanman,
@joelanman@hachyderm.io avatar

@yatil ha ha I like it

joelanman,
@joelanman@hachyderm.io avatar

@jscholes I'm writing it in a file that is then imported, so something like

function delete (id) { // do deletion }

module.exports = { create, delete, update }  

then elsewhere

const myThing = require('myThing')

myThing.delete(id)  
mikestreety,
@mikestreety@hachyderm.io avatar

Diving back into a project that used Vue and it seems to be throwing an error when I add a data- attribute to a HTML element. It's a static string which I use for something else.

Is there a way I can tell Vue to just ignore it?

#Vue #vuejs

mikestreety,
@mikestreety@hachyderm.io avatar

Solved by moving everything into Vue and not using the data attributes elsewhere

ricmac,
@ricmac@mastodon.social avatar

With frontend development, is it better to start simple and build on top of standard HTML, CSS and JavaScript? Or do you need a swiss army knife framework, like Next.js or Angular? I looked at recent Vue developments and found a lot to like about its "progressive framework" approach. https://thenewstack.io/want-out-of-react-complexity-try-vues-progressive-framework/ #vue #vuejs #javascript #frontend

librenews,
@librenews@mastodon.social avatar

@ricmac FYI, there is a link in the article in the Progressive Frameworks section to vue.js - think it's supposed to be vuejs.org

ricmac,
@ricmac@mastodon.social avatar

@librenews good catch, thanks! I have updated the link.

32bitkid,
@32bitkid@mstdn.social avatar

Spent a bit of time early this morning to knock out the most basic vector editing features in my SCI0 pic editor. The SCI0 pic byte-code is very terse; it doesn't even have closed polygons, just lines that happen to touch each other when rendered to the frame-buffer.

I'm sure this whole UI layer will need a refactor soon, but its definitely another step in a "useful" direction. Just a few core features left before a "beta" is viable.

#JavaScript #Vue #RetroComputing #SierraOnLine

video/mp4

javedAB,

#people want fast-loading pages

one way to achieve this is by loading only the necessary #javascript initially

load the rest on hover or button click for a smoother experience

#webdesign #ux #coding #frontend #webdevelopment

aeveltstra,
@aeveltstra@mastodon.social avatar

@javedAB Other ways to achieve it include removing Javascript altogether and replacing it by server-side scripting, as well as serving most if not all of your sources over a fast CDN.

javedAB,

@aeveltstra server side rending is a valid approach. i started with @astro and @solid_js . however, from what i guess, server side rendering is more cost intensive than static html

fast cdn can be combined with lazy loading #js

m0rpk,
@m0rpk@mastodon.radio avatar

Looking for help from and / or Apple Mac people.

I have before me an old MacBook Pro running 10.13.6. It can't be upgraded because of hardware constraints.

No browser on this device will render the schedule here: https://www.emfcamp.org/schedule/2024

I see JS console errors like "TypeError: Object.groupBy is not a function"

I've tried , , and .

Is it possible a script on that page relies on an OS feature this machine lacks?

penginn,

好きなだけおちんちん祭りを続けることができてしまったのです。

目に見えない文字を悪用してサイトを好き放題荒らされた話 [ - Qiita ]
https://qiita.com/laineus/items/2d168a57fdbf7cd7c9c3

siblingpastry,
@siblingpastry@mastodon.world avatar

Here's a very-niche but then-very-useful trick I realized today -- you can create empty text-nodes to use as node references, for things like DOM insertion, range boundaries, or whatever.

I needed this to set the end of a range immediately before an element's closing tag, when references to existing child nodes might be invalidated by race conditions.

You don't even need to persist the references for removal, since a single call to context.normalize() cleans them all away.

ollicle,
@ollicle@mastodon.social avatar

@siblingpastry I took the time to look up normalize and answered my own question.

Comments might be a little easier to spot in dev tools, but certainly more fuss to tidy.

siblingpastry,
@siblingpastry@mastodon.world avatar

@ollicle Oh you were asking about dealing with sibling text nodes? Yeah, that :-) Normalizing isn't something you tend to need very often, but it's uniquely useful when you do.

That's a good point about spotting in dev tools, I guess it would depend on what you needed. If the nodes need to be around for a while, it would be more useful to be able to inspect them. My use-case is very transient, they're added and gone again in the space of a synchronous function call.

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