JavaScript

stefan,
@stefan@stefanbohacek.online avatar

I've been really enjoying working with Wikidata lately, setting up automated accounts like @libraries, @parks, and @lighthouses.

To see what else you can do with Wikidata, and to learn how to use it, check out a tutorial I put together: https://stefanbohacek.com/blog/making-a-map-of-unesco-world-heritage-sites/

HistoPol,
@HistoPol@mastodon.social avatar

@stefan

Excellent idea, Stefan. 👍

What is really missing in this global is a map of active and formerly prominent politicians per country with a Fedi presence (self-updating, preferably.)
I think, though, data is hard to come by (tried this 2 yrs ago for the US and EU for the DeadBirdSite, but stopped.)

@libraries @parks @lighthouses

ainali,
@ainali@social.coop avatar

@HistoPol @stefan @libraries @parks @lighthouses
Not for individual politicians or parties, but @govdirectory is aiming to get all public organizations (like government agencies and authorities) in the world and their contact data in one place, through Wikidata.

zalasur,
@zalasur@mastodon.surazal.net avatar

It's been almost a decade since I've done a live coding stream. This will be fun!

Today I'll be migrating my website from React to Lit, which is a lightweight framework built around web components. I have the scaffolding set up mostly, so now it's time to get this done.

Come watch. Ask questions in chat! You don't need to create an account, just a username is needed to participate.

https://video.surazal.net/w/5S7FPXJMZh1i1eqZLY9mcV

craigabbott,
@craigabbott@a11y.info avatar

I was today years old and 4 hours down when I learned you cannot deep clone an instance of a #JavaScript class 😩

craigabbott,
@craigabbott@a11y.info avatar

@joelanman tried lodash, it cloned some properties but not methods etc. ☹️

joelanman,
@joelanman@hachyderm.io avatar
MaxArt2501,
@MaxArt2501@mastodon.social avatar

A response to @cferdinandi 's recent post(s) on JavaScript and Web Components:
https://dev.to/maxart2501/javascript-is-not-the-problem-k4e

I know he didn't explain his position in details, so a 1800-word article sounds a little unfair, but I think dry and sharp statements need adequate context and analysis.

cferdinandi,
@cferdinandi@mastodon.social avatar

@MaxArt2501 @simevidas Sorry, re-reading this and realizing what you're asking. Payloads of that size are very common with React apps. Do they need that much? Of course not. But it would mean rebuilding them without React.

And back to my original point: a lot of that HTML doesn't and shouldn't require JS at all. JS is in fact the problem.

callionica,
@callionica@mastodon.social avatar

@cferdinandi @MaxArt2501 @simevidas I think Massimo is generally making the point that some web sites require JS for core activities, not as a design choice, but out of technical necessity. (My own example: media player). Once you accept that JS is required on a site, you make different decisions about web component design. Designing WCs so there’s a noJS fallback - as you promote, Chris - is a valid choice, it’s just not the only sensible choice.

siblingpastry, (edited )
@siblingpastry@mastodon.world avatar

Writing to handle browsing is interesting.

Since keydown only fires for targets that can be activeElement, the event target from caret navigating plain text is always <body>.

However you can identify which element contains the caret, by evaluating the range data, which you can also do from selectionchange events.

And get this -- Safari still fires those events, even though it doesn't support caret browsing ... because it actually does, it just doesn't show the caret!

aardrian,
@aardrian@toot.cafe avatar

@siblingpastry That’s exactly the test I was going to try when I get home.

I look forward to updating my blog post about caret browsing.

siblingpastry,
@siblingpastry@mastodon.world avatar

@aardrian Just noting that it doesn't bring focus with it, you still have to Tab to those.

YurkshireLad,
@YurkshireLad@mastodon.social avatar

These questions/answers make me glad I'm not working with #javascript anymore! #dev

"lydiahallie/javascript-questions: A long list of (advanced) JavaScript questions, and their explanations"

https://github.com/lydiahallie/javascript-questions

domhabersack,
@domhabersack@mastodon.social avatar

You can turn off the “x packages are looking for funding” messages that get logged with each npm install by setting

fund = false

in your project’s or user’s npmrc file.

https://domhabersack.com/blog/npm-fund-false

#javascript

amxmln,
@amxmln@mastodon.design avatar

@domhabersack that’s a neat little trick! I’m not too bothered by the message, but it’s good to know there’s a way to turn it off if that ever changes. 😊

henrikjernevad,
@henrikjernevad@mastodon.social avatar

Another leak in the JavaScript single-threaded facade (or a bug in Jest, really).

Asserting expect(...).toStrictEqual(...) fails with two structurally identical objects created by two different Node worker threads because their prototypes are not the same (though identical). Asserting expect(structuredClone(...)).toStrictEqual(structuredClone(...)) works.

henrikjernevad,
@henrikjernevad@mastodon.social avatar

Perhaps I should add it to the list in https://henko.net/blog/death-by-a-thousand-inconsistencies/ 🙃

underlap,
@underlap@fosstodon.org avatar

@henrikjernevad Have you looked at Elm?

Last time I looked, the docs were like "Elm for JavaScript developers" or at least "Elm for front-end developers", hence opaque to me. But the language has a lot of promise.

davidbisset,
@davidbisset@phpc.social avatar

Five Basic Things About That Will Help Non JavaScript-Focused Web
https://frontendmasters.com/blog/5-things-designers-can-do-with-javascript/

eikun_0903, Japanese
@eikun_0903@fedibird.com avatar
ecmascript_news,
@ecmascript_news@mastodon.online avatar

Node.js and its many, many new features with Matteo Collina [89-min. video]
@mcollina @jlengstorf
https://www.youtube.com/watch?v=evCnOaVaOTo

#ECMAScript #JavaScript #NodeJS

Floppy,
@Floppy@mastodon.me.uk avatar

experts, I need advice. I'm trying to extend a class in order to override a method or two. It defines everything in its constructor, and I can't work out how to use anything in the original class from my new one.

Could anyone suggest to me how syntactically I should minimally replace onKeyDown and handleKeyDown with my own versions, while still being able to use functions and properties from the base class? I'd really appreciate the guidance!

Code: https://github.com/mrdoob/three.js/blob/885c2dbab575e6528464e096784680d19914c3f3/examples/jsm/controls/OrbitControls.js

almostobsolete,
@almostobsolete@mastodon.me.uk avatar

@Floppy yeah unfortunately I think that’s the only option for those bits not exposed on the the this object

Floppy,
@Floppy@mastodon.me.uk avatar

@Krazov no, all the scopes were screwed up. Think I've got a solution now though!

rauschma,
@rauschma@fosstodon.org avatar

If you were to write flash cards for (as standardized via ECMAScript)—what would you put on them?

Ideas:
– Standard library API—e.g.: What does Array.prototype.splice() do?
– Functionality: How to destructively add a value at the end of an Array?

nosherwan,
@nosherwan@fosstodon.org avatar

@rauschma my 2 cents worth; flash cards should state small best practices.

For example:

  • How to do map and filter together.
  • How to loop over an object vs array.
  • best way to flaten list of nested objects without utility packages etc.
medicalbilling,
@medicalbilling@mstdn.social avatar

Can I hit 200 followers today?

I am looking to #Connect with people who are interested in:
Coding
Web Development
Front End
Back end
React/Nextjs
Javascript/Typescript
Tailwind CSS
UI/UX
Open Source
Software Development

#letsconnect #buildinpublic #javascript #development

sirber,
@sirber@fosstodon.org avatar

Nice! runtime works on non AVX2 cpu now!

nosherwan,
@nosherwan@fosstodon.org avatar

@sirber what are you using non AVX2 cpu for.

sirber,
@sirber@fosstodon.org avatar

@nosherwan my crappy netbook doesn't have it. It's a Celeron N4020.

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