Page MenuHomePhabricator

Wikimedia Hackathon 2026: Cool new things in JS + CSS
Closed, ResolvedPublic

Description

Project title: Cool new things in JS + CSS
Brief summary: This session will give an overview of newly available features in JavaScript and CSS that can be used by Wikimedia developers, including in core/extensions/skins as well as on-wiki gadgets and user scripts/styles. The goal is not just to introduce people to new features, but also to make them aware which features they can use nowadays, thanks to advances in the Wikimedia context like bumping browser requirements (e.g. T288287) and JavaScript versions (e.g. T178356, T381537).
Expected outcomes: As above; also, there will be a slide deck that people can refer to later, as a companion to Cool new things in PHP (T331275) and Cool new things in MediaWiki code (T331276).
Skills preferred: General familiarity with JS + CSS ought to be helpful.
Experience level: beginner
Project leads: @Lucas_Werkmeister_WMDE
Starting tasks: N/A, this is a session
Why are you proposing this project? Because it seems like a useful thing to do and several people in the Telegram/IRC group indicated interest in the topic.
What is the expected impact? People will use more modern JavaScript code.
Any other additional information for contributors: N/A, I think


Raw session notes

Unconference session: Cool new things in JS + CSS (T423292)
Contact: Lucas Werkmeister (WMDE)
Slides: https://docs.google.com/presentation/d/13rag-ujgI26wQEV0mR7mLNmbeUWVg69fs2DgH2fyzZQ/edit

This is a new set of features that we can use recently because we dropped support for old browsers like IE that were slowing us down in new features.

Already available:

Promise: Aync + Await.

Template literals, now we have template strings.

Template strings can be multiple lines.

Q: What happens if you remove the spaces between the brackets there?
A: Nothing.

To replace the old let/const we now have arrow functions.

For the old Class Syntax. we were doing arcane magic but now we can use legit JS class syntax and we can define method names and parameters, it's a nice way to write classes.

Methods: We don't need to declare key-values for methos, we can just define the name and it'll infer the variable name.

We can now destructure values into two different values instead of doing it manually, this is a good way to import many things wihtout having to declare them.

Rest + Spread syntax. The code was very hard to understand and confusing, the syntax improved to make it more readable. It takes parameters as an array and spreads them across the foundation becoming the arguments for the functoin. [Like Go's variadic arguments).

Map and Set, I dind't find any goog examples, but they exist :shrug:,

Includes is now actually intuitive to read.

For-of and for-in have been enabled forever.

[Slides now talk about CSS]

Now the CSS parts.

It was harder to find examples for previous CSS and current CSS code.

More notably, examples of code changes can be seen in the Vector 2020 theme.

Flex and Grids are good example of this.

CSS Calc, you can make calculations.

We also have CSS @supports to define a clause for specific features some browsers may or not support.

In my [Lukas] opinion Async Generators are the most important things.

Event Timeline

I might split this up into JS and CSS parts; depends on how much material I come up with once I start putting together the slides, probably.

Sharing some CSS-related resources in my to-read/to-watch list, which may be useful:

I have a feeling those might all still be too new for us (but I could mention some of them as “upcoming”), but thanks!

Meanwhile, very WIP slides, if anyone wants to take a look in advance: https://docs.google.com/presentation/d/13rag-ujgI26wQEV0mR7mLNmbeUWVg69fs2DgH2fyzZQ/edit?usp=sharing

Session tentatively scheduled for 15:15–15:45 CEST in Space 5 (Floor 1).

Did a practice run of my slides (see above – they’re not done yet but getting there), currently at 19½ minutes (out of a 30-minute slot), and that’s with me probably talking somewhat too fast and without any questions or anything :D

We’ll see how it goes on Saturday ^^ in the meantime I’ll keep working on the slides.

(At least on the JS side, the “upcoming” part might actually be a lot shorter than the “already available” part – it turns out most of the cool stuff is already available!)

From the slides:

regex stuff (not sure I care)

If I may, I'd personally find that pretty interesting! Assuming that means the lookbehind, named capture groups and single-line mode features mentioned in T395347 :)

@waldyrious do you have a usage example that could demonstrate why those regex features are useful, by any chance? :)

(I’ve been finding a lot of other examples through codesearch but some of this syntax will be trickier to find that way)

Edit: I’ve found something for most of the regex features mentioned in T395347, except /s which defeats codesearch.

Alright, I think my slides are done! I’ll put them on Commons later, in case I find any issues in the meantime (I’m hoping to do at least one more practice run if I can find the time).

Looking forward to the session on Saturday :)

Okay, practice run for the full slides clocked in at 29 minutes :D so that’ll be fun on Saturday 😇️