@tbroyer@piaille.fr avatar

tbroyer

@tbroyer@piaille.fr

Web development (frontend, Web APIs), Web app security, build tools, Java, Kotlin, Gradle, etc.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

b0rk, to random
@b0rk@jvns.ca avatar

i've been hearing a lot from folks on here who are frustrated with git (for many good reasons!)

but I'm curious about the opposite perspective: if you've worked with more than one version control system over the years and you prefer git, I'd love to know:

a) what other systems have you worked with? (hg? svn? p4?)
b) why do you prefer git?

notes:

  • please no replies about why you think git is worse
  • interested in answers other than "because I have no choice"
tbroyer,
@tbroyer@piaille.fr avatar

@b0rk Totally agree. I've used CVS two decades ago, then SVN for years, then tried Git with git-svn, and finally switched to Git. When Google Code hosted hg repositories I tried that (if only to contribute to OSS projects) but it never "clicked". I can't really remember what I had trouble understanding in hg (branching? tagging? working with others/remotes?) but I just couldn't get it, and was happy when "everyone" switched to Git.

jw, to random
@jw@jakewharton.com avatar

The consistency, clarity, and discoverability of Gradle KTS APIs remains unmatched.

tbroyer,
@tbroyer@piaille.fr avatar

@jw While I can totally understand the first (you already gave at least one argument in your last post), I'm very curious about the other two!

b0rk, (edited ) to random
@b0rk@jvns.ca avatar

poll: do you prefer git fetch or git pull?

(no lectures about why you think git pull is bad please but if you use both I'd be curious to hear in what cases you use fetch!)

tbroyer,
@tbroyer@piaille.fr avatar

@b0rk I've been using git remote update though I admit I forgot the difference with git fetch and am not sure which one I should use.
Most of the time I use git pull rather than git rebase to later bring the changes in my local branch even though I already have the most recent commits (as of a few seconds ago) ๐Ÿคท

scottjehl, to random
@scottjehl@mstdn.social avatar

Lost-cause decisions in standards and browsers can be reversed when the community makes a strong, persistent case. I've seen it happen first-hand with responsive <video>, and responsive images before that.

One decision I want to see reversed is Webkit's lack of IS attribute support, which lets us write Web Components that customize built-in HTML elements. IS is a standard. Works in Chromium & Firefox. It's a great pattern for applying enhancements, especially in forms.

https://github.com/WebKit/standards-positions/issues/97

tbroyer,
@tbroyer@piaille.fr avatar

@scottjehl I don't know, I think custom attributes are actually a better approach (composition over inheritance)
Something is needed, but maybe not customized built-in elements with the is="" attribute.

tbroyer,
@tbroyer@piaille.fr avatar

@scottjehl Then maybe documentation is (still) not clear enough that you shouldn't use it (unless maybe you're building intranet apps or Electron/whatever apps where you have some control on the browser engines)

tbroyer,
@tbroyer@piaille.fr avatar

@scottjehl There's a difference between trying extending HTMLButtonElement rather than HTMLElement and going all the way to using is="" and the extends option when registering the element.
โ€ฆand https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define clearly does a bad job and should relegate customized built-in elements to separated subsection (or even page) that would clearly call out the discrepancy (and possibly even suggest that this might be replaced by another approach, so should be regarded as being deprecated, or experimental)

tbroyer,
@tbroyer@piaille.fr avatar

@scottjehl I was talking from the POV of someone who'd like to "extend a built-in" without knowing how it could work: you'd most probably start by extending HTMLButtonElement in hope that you'd inherit at least the button's behavior, then when seeing that it indeed doesn't work only do your research and learn about the extends option and is attribute. My point being that you don't "discover" it but "learn" about it, so if you "accidentally" make something that doesn't work in Safari it's your learning source's fault for not telling you.

tbroyer,
@tbroyer@piaille.fr avatar

@scottjehl Wrt your last point, we're not in a "has yet to gain Safari support" situation: this will never happen, partly because there are better proposals that IIRC have traction in all browser engines. So we're more in a "has yet to be precisely spec'd then implemented" situation regarding custom attributes.
I might be missing something though (it's been a while since I looked into this tbh)

tbroyer,
@tbroyer@piaille.fr avatar

@scottjehl I mean, would you have advocated for a browser to implement AppCache once Web Workers had been suggested as a better alternative, just because other engines already implemented it? (this is a hypothetical situation, that's not how it happened)
We should push custom attributes forward and formally deprecate customized built-in elements.

tbroyer,
@tbroyer@piaille.fr avatar

@scottjehl Start here and follow links: https://github.com/w3c/tpac2023-breakouts/issues/44

(note that I personally do not have use cases for customized built-in elements, so I can't tell how custom attributes can replace them, and how to possibly handle other use cases not covered; and as I said I haven't followed the discussions since last fall)

rauschma, to node
@rauschma@fosstodon.org avatar

1/ package scripts: Windows vs. Unixes.

On macOS, Iโ€™m using these scripts:
"build": "npm run clean && tsc && npm run chmod",
"clean": "shx rm -rf ./dist/*",
"chmod": "chmod u+x ./dist/src/cmd.js",

Alas, the last script wonโ€™t work on Windows. Whatโ€™s a good way to fix this?

tbroyer,
@tbroyer@piaille.fr avatar

@rauschma Would shx chmod work? (by ignoring the requested change IIUC)

pablolarah, to CSS
@pablolarah@mastodon.social avatar

๐Ÿ–๏ธ Taming the Shadow DOM: Injecting Global Styles with Adopted Stylesheets
by Ben Voran at @Southleft

https://southleft.com/insights/development/adopted-stylesheets/

tbroyer,
@tbroyer@piaille.fr avatar

@matuzo @dutchcelt @pablolarah This is using textContent so no, but I suppose you could "just" adopt the &lt;style&gt; or &lt;link&gt;'s .sheet instead (and it would probably perform faster as it wouldn't have to parse the CSS again)

tbroyer, to random
@tbroyer@piaille.fr avatar

"Gradle toolchains are rarely a good idea. But thatโ€™s a topic for next weekโ€ฆ"
Yes please!
https://mastodon.jakewharton.com/@jw/112090423224676666

leaverou, to random
@leaverou@front-end.social avatar

If you are working on two npm packages, on of which depends on the other (say B depends on A), what is your process for making changes to A and trying them out on B without npm publish?

So far the best Iโ€™ve found is changing the package specifier to point to the local repo + npm install but there must be something faster and less error-prone? (so many times I forgot to change it back and committed the package.json with the local specifier!)

tbroyer,
@tbroyer@piaille.fr avatar

@leaverou I'd say this is where npm link is supposed to be helpful, but I think I'd rather change the package.json

https://docs.npmjs.com/cli/v10/commands/npm-link

(as for the "commit the package.json with the change", this is why I always use git-gui for making my commits, equivalent to always using git add -p and never git add alone: self-review your changes when making your commits)

tbroyer,
@tbroyer@piaille.fr avatar

@leaverou @westbrook @kieranmcguire I don't like "global" side effects (npm link somehow "installs" the A package globally). Same reason I never npm add -g.

tbroyer,
@tbroyer@piaille.fr avatar

@jpzwarte Sorry for hijacking the thread but any reason to use yarn workspaces over npm workspaces? (any reason to use yarn over npm these days? yarn pnp maybe?)

kornel, to random
@kornel@mastodon.social avatar

#HTTP content negotiation has some unwritten rules for images. Accept: image/png, */* technically allows image/avif, but thatโ€™s not a wise interpretation.
Except what a caching proxy is supposed to do when the origin only sends AVIF?

tbroyer,
@tbroyer@piaille.fr avatar

@deshipu @kornel isn't that what CDNs are?

zachleat, to random
@zachleat@zachleat.com avatar

Itโ€™s absolutely wild that for years the React community has made the claim that interactions on Single Page Applications are faster!

Iโ€™m reminded of these: https://www.zachleat.com/twitter/1259834737390161922

But Interaction to Next Paint is showing the opposite to be true. If anything, to me it suggests that Virtual DOM is trading slower page interactions for marginal improvements to page navigations.

tbroyer,
@tbroyer@piaille.fr avatar

@zachleat @hi_mayank fwiw, I entirely agree. SPA by definition is about navigation (and doesn't even imply client side rendering). Yet because we're talking about avoiding a form submission, i.e. page load, I understand this could fall in a blurry zone (I wouldn't categorize it as SPA personally though: this is what we did with jQuery 20 years ago, and more importantly it doesn't involve a router)
https://blog.ltgt.net/naming-things-is-hard-spa-edition/

nolan, to random
@nolan@toot.cafe avatar

Vitest is pretty nice compared to Jest. I'm still not sold on testing a fake browser (jsdom, happy-dom), but at least it runs fast, has a nice UI, and no more CommonJS vs ESM zaniness.

tbroyer,
@tbroyer@piaille.fr avatar

@nolan Have you looked at Modern Web's Web Test Runner? https://modern-web.dev/docs/test-runner/overview/
(might not be comparable, I admit not knowing much about testing tools but it worked well for my needs)

rauschma, to node
@rauschma@fosstodon.org avatar

If an package has "exports", it can โ€œself-referenceโ€ them via its package name. Thatโ€™s useful for tests (which demo how importing packages would use the code).

// util_test.js
import {helperFunc} from 'my-package/misc/util.js';

https://nodejs.org/api/packages.html#self-referencing-a-package-using-its-name

tbroyer,
@tbroyer@piaille.fr avatar

@rauschma I did find about it just yesterday!

tbroyer, (edited ) to random
@tbroyer@piaille.fr avatar

Yesterday I was at a restaurant with this artwork on the wall. Can you find the three films whose posters were used here? (hint: two of them are french)

melix, to random French
@melix@mastodon.xyz avatar

Heritage du grand pรจre. Et j'en ai plein comme รงa !

tbroyer,
@tbroyer@piaille.fr avatar

@melix D'aprรจs Google traduction, le titre en russe est juste "dictionnaire franรงais russe"

matuzo, to random
@matuzo@front-end.social avatar

Do you use Threads? Does anyone use Threads? At least in Austria it seems as if it has absolutely no relevance.

tbroyer,
@tbroyer@piaille.fr avatar

@matuzo A few people (artists) I follow on Instagram post sometimes on Threads, but most other accounts I follow on Threads just post the same there than on their other social accounts, so I only check once in a while. Near useless.

brucelawson, to random
@brucelawson@vivaldi.net avatar

I'm watching TV show about the church of the latter day saints. It's interesting because the stuff they believe is incomprehensible to me. Yet I have met many Mormons and, without exception, each has been a really good human being.

tbroyer,
@tbroyer@piaille.fr avatar

@brucelawson Proselytism bothers me though.

rauschma, to javascript
@rauschma@fosstodon.org avatar

1/ Promisesโ€”the following code used to work but doesnโ€™t anymore (not shown: resolveAfter()).

function timeout(timeoutInMs, promise) {
return Promise.race([
promise,
resolveAfter(timeoutInMs,
Promise.reject(new Error('Operation timed out'))
),
]);
}

Why? If promise settles before the other .race() value, JS will complain about an unhandled Promise rejectionโ€”the argument of resolveAfter().

Itโ€™s a useful safety check but it also broke old code of mine.

tbroyer,
@tbroyer@piaille.fr avatar

@rauschma API design is hard ๐Ÿ˜‰

Maybe handle rejection in the timeout() function then:

function timeout(timeoutInMs, promise) {
const timedOut = Promise.reject(new Error('Operation timed out'));
// Avoid unhandled rejection when 'promise' resolves before the timeout
timedOut.catch(()=>{});
return Promise.race([
promise,
resolveAfter(timeoutInMs, timedOut),
]);
}

โ€ฆor as you did, a rejectAfter with clear expectations.

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