@passle@mastodon.social
@passle@mastodon.social avatar

passle

@passle@mastodon.social

Amusing myself to death

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

DavidDarnes, to random
@DavidDarnes@mastodon.design avatar

Idea: Web Component which uses the CSS Highlight API to highlight code blocks

passle,
@passle@mastodon.social avatar

@bramus @DavidDarnes @Jbasoo This is cool, I recently created a syntax highlighting web component at work for our internal wiki thing, but it uses Shiki, not CSS Highlight.

Looking at Shiki, they do have a codeToTokens function, but it requires some internal (great naming 😀) thing to get passed to it which supposedly needs to initialize the langs/themes and I can't be bothered to figure that out right now, but seems like it should be doable

passle,
@passle@mastodon.social avatar
passle,
@passle@mastodon.social avatar

@bramus @DavidDarnes @Jbasoo Hm, can anybody point out to me what I'm doing wrong here? I would have expected 4 different colors in the output, but im seeing only 2?

https://lit.dev/playground/#project=W3sibmFtZSI6InNpbXBsZS1ncmVldGluZy5qcyIsImNvbnRlbnQiOiJpbXBvcnQgeyBjb2RlVG9Ub2tlbnMgfSBmcm9tICdzaGlraS9idW5kbGUvd2ViJztcblxuY29uc3QgeyB0b2tlbnMgfSA9IGF3YWl0IGNvZGVUb1Rva2Vucyhjb2RlLnRleHRDb250ZW50LCB7IFxuICB0aGVtZTogJ25vcmQnLCBcbiAgbGFuZzogJ2pzJ1xufSk7XG5cbmNvbnN0IGNvbG9yR3JvdXBzID0gdG9rZW5zLmZsYXQoKS5yZWR1Y2UoKGFjYywgY3VycikgPT4ge1xuICBjb25zdCByYW5nZSA9IG5ldyBSYW5nZSgpO1xuICByYW5nZS5zZXRTdGFydChjb2RlLmZpcnN0Q2hpbGQsIGN1cnIub2Zmc2V0KTtcbiAgcmFuZ2Uuc2V0RW5kKGNvZGUuZmlyc3RDaGlsZCwgY3Vyci5vZmZzZXQgKyBjdXJyLmNvbnRlbnQubGVuZ3RoKTtcbiAgY3Vyci5yYW5nZSA9IHJhbmdlO1xuICBhY2NbY3Vyci5jb2xvcl0gPSBbLi4uKGFjY1tjdXJyLmNvbG9yXSB8f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NvZGVcIj5cbiAgICBjb25zdCBmb28gPSAxO1xuICAgIGNvbnN0IGJhciA9IDI7XG4gIDwvZGl2PlxuICA8c2ltcGxlLWdyZWV0aW5nIG5hbWU9XCJXb3JsZFwiPjwvc2ltcGxlLWdyZWV0aW5nPlxuPC9ib2R5PlxuIn0seyJuYW1lIjoicGFja2FnZS5qc29uIiwiY29udGVudCI6IntcbiAgXCJkZXBlbmRlbmNpZXNcIjoge1xuICAgIFwibGl0XCI6IFwiXjMuMC4wXCIsXG4gICAgXCJAbGl0L3JlYWN0aXZlLWVsZW1lbnRcIjogXCJeMi4wLjBcIixcbiAgICBcImxpdC1lbGVtZW50XCI6IFwiXjQuMC4wXCIsXG4gICAgXCJsaXQtaHRtbFwiOiBcIl4zLjAuMFwiXG4gIH1cbn0iLCJoaWRkZW4iOnRydWV9XQ

image/png

passle,
@passle@mastodon.social avatar

@bramus @DavidDarnes @Jbasoo Oh lol, figured it out. i++ was in the wrong place, and the fourth color/token is whitespace

This is working nicely then! Very cool api, and nice to see that it can be integrated with shiki pretty easily. Would just have to adjust the stylesheet for the theme to accommodate, but you can probably automate that.

https://lit.dev/playground/#project=W3sibmFtZSI6InNpbXBsZS1ncmVldGluZy5qcyIsImNvbnRlbnQiOiJpbXBvcnQgeyBjb2RlVG9Ub2tlbnMgfSBmcm9tICdzaGlraS9idW5kbGUvd2ViJztcblxuY29uc3QgeyB0b2tlbnMgfSA9IGF3YWl0IGNvZGVUb1Rva2Vucyhjb2RlLnRleHRDb250ZW50LCB7IFxuICB0aGVtZTogJ25vcmQnLCBcbiAgbGFuZzogJ2pzJ1xufSk7XG5cbmNvbnN0IGNvbG9yR3JvdXBzID0gdG9rZW5zLmZsYXQoKS5yZWR1Y2UoKGFjYywgY3VycikgPT4ge1xuICBjb25zdCByYW5nZSA9IG5ldyBSYW5nZSgpO1xuICByYW5nZS5zZXRTdGFydChjb2RlLmZpcnN0Q2hpbGQsIGN1cnIub2Zmc2V0KTtcbiAgcmFuZ2Uu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2h0KGMpIHtcbiAgICAgIGNvbG9yOiBncmVlbjtcbiAgICB9XG4gICAgXG4gICAgOjpoaWdobGlnaHQoZCkge1xuICAgICAgY29sb3I6IHB1cnBsZTtcbiAgICB9XG4gIDwvc3R5bGU-XG48L2hlYWQ-XG48Ym9keT5cbiAgPGRpdiBpZD1cImNvZGVcIj5cbiAgICBjb25zdCBmb28gPSAxO1xuICAgIGNvbnN0IGJhciA9IDI7XG4gIDwvZGl2PlxuICA8c2ltcGxlLWdyZWV0aW5nIG5hbWU9XCJXb3JsZFwiPjwvc2ltcGxlLWdyZWV0aW5nPlxuPC9ib2R5PlxuIn0seyJuYW1lIjoicGFja2FnZS5qc29uIiwiY29udGVudCI6IntcbiAgXCJkZXBlbmRlbmNpZXNcIjoge1xuICAgIFwibGl0XCI6IFwiXjMuMC4wXCIsXG4gICAgXCJAbGl0L3JlYWN0aXZlLWVsZW1lbnRcIjogXCJeMi4wLjBcIixcbiAgICBcImxpdC1lbGVtZW50XCI6IFwiXjQuMC4wXCIsXG4gICAgXCJsaXQtaHRtbFwiOiBcIl4zLjAuMFwiXG4gIH1cbn0iLCJoaWRkZW4iOnRydWV9XQ

passle,
@passle@mastodon.social avatar

@scrwd havent looked at those things yet - make it work, then make it pretty

passle, to random
@passle@mastodon.social avatar

Maybe this is more clear

The question is: when can you get rid of the service worker removal code?

image/png

passle,
@passle@mastodon.social avatar

@steveworkman That confirms my thinking as well. Alternatively, you could have the service worker check in with the client (send a ping/pong) to check whether or not it should stay alive. Then if you want to get rid of the service worker, you just remove the pong sent from the client, and if no pong was received by the SW, unregister itself

passle,
@passle@mastodon.social avatar

@steveworkman > which in reality, no one ever thinks about

Isn't that what we're doing here right now 😛

passle, to random
@passle@mastodon.social avatar

@erikKroes you doing okay there bud? 😂

passle,
@passle@mastodon.social avatar

@erikKroes the only real way you know if something is working or not

passle, to random
@passle@mastodon.social avatar

shes judging my code :(

passle, to random
@passle@mastodon.social avatar

Made some nice improvements on @thepassle/module-graph, support multiple entrypoints, fixed circular dependencies, added ignoreExternal config option, and some better error handling for plugins

passle,
@passle@mastodon.social avatar

@tanepiper can you show an example of what you mean? You mean turning the graph into something thats query-able with graphql?

passle, to random
@passle@mastodon.social avatar

Please take 10 seconds out of your day to sign this

https://letter.open-web-advocacy.org/

passle, to random
@passle@mastodon.social avatar

It still blows my mind that google just dropped workbox without any transparency or communication about it

passle, to random
@passle@mastodon.social avatar

Im so annoyed, Ive built a bunch of pwas mostly for myself that I use quite a bit (games, reddit, other stuff) and it all looks like ass now because of the safari ui >:(

passle, to random
@passle@mastodon.social avatar

The new Node.js logo looks like a cartoonized version of Great Britain to me

passle,
@passle@mastodon.social avatar
passle, to random
@passle@mastodon.social avatar

dog brings so much joy

jaffathecake, to random
@jaffathecake@mastodon.social avatar

Really sad that the Navigation API isn't being included in interop 2024. This API makes a night-and-day difference to handling navigations. It cannot be polyfilled, and cannot really be used as progressive enhancement. We need it yesterday. https://github.com/web-platform-tests/interop/issues/435#issuecomment-1921896911

View transitions isn't being included either, but I'm less sad about that, because it can be used as progressive enhancement. https://github.com/web-platform-tests/interop/issues/437#issuecomment-1921897450

passle,
@passle@mastodon.social avatar

@jaffathecake @tbroyer @jpzwarte That sounds like it might be fine? Polyfills generally do some hacky stuff, but if it means that today you can use a polyfill based on the history API, and in the (hopefully near) future you can drop that polyfill while keeping the behavior the same by using the native navigation api, that should be OK for SPA's, right?

passle, to random
@passle@mastodon.social avatar

Twitter truly sometimes makes me lose my mind.

"Loading less modules != performant"

passle,
@passle@mastodon.social avatar

@erikKroes the lord knows I try but damn does that place make it hard

passle, to random
@passle@mastodon.social avatar

Slides for my talk are coming along.

passle, to random
@passle@mastodon.social avatar

Alright, I think I have my OG images setup correctly now.

Some arent working on twitter, but I think it caches them forever or something, so it probably has a non-working og image cached. Does anybody know if theres a way to bust the cache? Slap a query param on the OG image?

https://thepassle.netlify.app/thoughts/on-bun

passle,
@passle@mastodon.social avatar

@zachleat Sorry for tagging, but I feel like you're the kind of person who would know how that works/if thats possible

passle,
@passle@mastodon.social avatar

@zachleat cool, thank you!

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