Upcoming JS Features You Need To Know

Поділитися
Вставка
  • Опубліковано 6 лют 2025

КОМЕНТАРІ • 152

  • @JinKee
    @JinKee 3 місяці тому +329

    All languages eventually become Rust because on a long enough timeline everything evolves into crab. 🦀

    • @lalithrockz
      @lalithrockz 3 місяці тому +16

      Bruh this is the exact same comments on the struct video

    • @cooltrashgamer
      @cooltrashgamer 3 місяці тому +4

      Thankfully not C

    • @anotherelvis
      @anotherelvis 3 місяці тому +2

      Many languages could add sum-types.

    • @Melvin420x12
      @Melvin420x12 3 місяці тому +1

      @@lalithrockz 100% a bot, this comment will be some weird ai tool or a crypto scam in a few days

    • @MercurySteel
      @MercurySteel 3 місяці тому +6

      All roads lead to C

  • @phendan
    @phendan 3 місяці тому +65

    Lot of cool stuff, just wish the pipeline operator hadn't been stalled for the past like 3 years

    • @ryzzlas
      @ryzzlas 3 місяці тому +9

      Yeah, this is something that would make chaining much more readable and upgrade the language so much, IMO.

    • @victornpb
      @victornpb 3 місяці тому +1

      but we got reverse ahh function calls with destructuring 💀

  • @penguindrummaster
    @penguindrummaster 3 місяці тому +13

    Completely unrelated to the video topic, but I want to say to Theo if you're reading this, I'm really glad the shift to a more open sponsorship policy has seemingly worked out for you. Sure, I liked the mostly no-ads approach to your older videos, but I respect the work you put into making these sponsorships not only work into the video, but often remaining relevant to your audience. Haven't made it more than 60 seconds into the video, but I just wanted to say as a relatively new viewer that I appreciate the work you do. Keep it up my dude!

  • @zwanz0r
    @zwanz0r 3 місяці тому +24

    @Theo I believe stage 2.7 is not "spec not ready, but feel free to implement". It is "spec is ready, but the tests are not done yet. Implementation is risky"

  • @omri9325
    @omri9325 3 місяці тому +3

    I really like the `import defer *`, this is such a good idea.
    I remember always contemplating which way would perform better because of network waterfalls being just as big of a pain as heavy initialization

  • @Efecretion
    @Efecretion 3 місяці тому +14

    @17:00 -- just learn how to manage your own freaking scope. I hate the cycle of 'asynchronous hard, make look like synchronous with async / await' --> new devs learn less as details are glossed over --> 'what even is scope management??' --> new features to hide scope management, like closures --> 'what even is scope?!?!' --> new features to make devs need to think even less. Stop providing features that make it so people don't learn, ffs.

    • @RD-eh3tz
      @RD-eh3tz 3 місяці тому +4

      I was baffled seeing the example they gave. If they think devs find it difficult to understand that calling an async fn in a sync context won't block, then good luck teaching them their proposed solution.

  • @Fam-m4i
    @Fam-m4i 26 днів тому

    As a Leetcode guy who solves problems with JS, we want Stack , Queue, Dequeue, Heap, TreeMap, TreeSet in the language by default as JS has a huge community

  • @thefreeze6023
    @thefreeze6023 3 місяці тому +15

    I don't understand the Extractor thing at all

    • @maimee1
      @maimee1 3 місяці тому +7

      Looks so damn confusing. Some features are simply not necessary and encourages writing worse code. Why does it seem like this would be one of those.

    • @ceigey-au
      @ceigey-au 3 місяці тому

      Basically you have a "function" (or a secret method of some particular protocol a class implements) operate on a value just before it's assigned to the current scope. Which normally is not so useful (since you could do `let variable = somefn(value)`), but in function arguments and destructuring is kind of cool, but a bit niche. But other than that the rest is just specifics/details.
      Actually, there's discussion about whether this would essentially enable runtime type checking, e.g. function add(Number(x), Number(y)) { return x + y }, assuming here Number has that secret method implemented to do the validation before destructuring.

  • @yapet
    @yapet 3 місяці тому +73

    The vid is full of inaccuracies. As someone who follows the TC39 process closely, I can assure that.
    The research feels too rushed and doesn’t do most of the proposals justice. As such is likely to mislead people of the real problems being solved.
    Also, I feel like the more thorough review would’ve elicited more scepticism for the many of the proposals, which is always more entertaining to watch :).

    • @Seedwreck
      @Seedwreck 3 місяці тому +5

      Yessss,
      So much jumping, and skipping.
      It feels like an abstract of a crash-course 😂😂

    • @Colwc
      @Colwc 3 місяці тому +2

      @@alexandermason4229 If Theo wants to please his audience, by presenting shorter videos with less content - that's ok. But doing a shorter video with the same amount of content doesn't work. If you're in it for the views, you can make shorts. Content shouldn't suffer.

    • @fldrmaus
      @fldrmaus 3 місяці тому +4

      Do you have a few examples of these inaccuracies?

    • @dadqqader
      @dadqqader 3 місяці тому +1

      ​@@alexandermason4229 I don't think anyone would mind a long content if said content is at appropriated length such as this.
      There's reason why some people are pissed on PrimeAgent making 50 minutes video out of 15 minutes clip.

    • @anakinskywalker192
      @anakinskywalker192 3 місяці тому

      @@Colwc His content were longer than it needed to be. I don't have time for 20+ min videos every day so i like that he's trying to cut them down in length

  • @IgnacioGiri
    @IgnacioGiri 3 місяці тому +3

    This is like the 10th video where Javascript changes forever. I can't keep up.

    • @LongJourneys
      @LongJourneys 3 місяці тому +1

      Welcome to the last 16 years 😂

  • @ivlis.w
    @ivlis.w 3 місяці тому +3

    I hope they don't mess up the import syntax anymore and just use the import attributes that were created for exactly that reason, like
    import foo from 'bar' with { source: true }
    import foo from 'bar' with { defer: true }
    Instead of "import source" or "import defer"

    • @arimaniac
      @arimaniac 3 місяці тому

      or maybe { type: "source" }?

  • @cseckler
    @cseckler 3 місяці тому +3

    I love it! More learning! Wooo! Haha jk, keeps me young. @Theo can you make a video that covers the possible implications of having native JS support an enum keyword as well as TS files? You touched on it in the the video and you seemed to have more to say. Thanks for all your hard work! Your content is awesome!

  • @JohnSmith-gu9gl
    @JohnSmith-gu9gl 3 місяці тому +5

    They call it JavaScript, but with these new features we have to rename it to RustScript

    • @CoDEmanX47
      @CoDEmanX47 3 місяці тому +6

      Probably has to be CrabScript due copyright, trademark, and CoC issues.

  • @YouBetterBeJedi
    @YouBetterBeJedi 3 місяці тому +1

    there are good concepts in rust and other languages that would also suit javascript well. Pattern matching for example

  • @manuel_g_g
    @manuel_g_g 3 місяці тому

    🥺... this seems really good for the JS ecosystem... ADT types, Enums, Options to handle errors, pattern matching, zips, maps, monadic patterns to parallelize operations... and a lot of FP stuffs, would be great for all levels of the JS lang, devs should love this even if they just use Options and Enums (adt types)... hope to be able to play these characteristics.
    .
    .
    .
    .
    it just rn .. i feels really 😞htf this whole...

  • @kirillvoloshin2065
    @kirillvoloshin2065 3 місяці тому +1

    decimals are huge!

  • @Exilum
    @Exilum 3 місяці тому +4

    I really like the idea behind asyncVar but the syntax...

  • @rns10
    @rns10 3 місяці тому +23

    Video title: big changes coming.
    Content: most functions can be written in utils by devs to be reused in project.
    Since there are so many browser engines, who may or may not implement these. Relying on your own implementation or a utils library is better.

  • @zenpool
    @zenpool 3 місяці тому +5

    yes but we still dont have pattern matching and pipes😥

  • @ristekostadinov2820
    @ristekostadinov2820 3 місяці тому

    10:19 damn Js have this method proposed now, i remember in college i was so happy when i could do it in PHP and just iterate on front end and have perfect grid

  • @josephvictory9536
    @josephvictory9536 3 місяці тому

    The array zip one is dope.

  • @Seedwreck
    @Seedwreck 3 місяці тому +7

    I’ll be waiting for the day moving functions to the timeout queue inside a promise with a timeout of 0 is replaced with an actual parallelism implementation

    • @PaulSebastianM
      @PaulSebastianM 3 місяці тому +1

      Moving CPU bound code to the "timeout queue", as you call it, does not make JS run it immediately nor can it ever run such code in parallel.

    • @Matt-ji9ut
      @Matt-ji9ut 3 місяці тому +2

      @@PaulSebastianM Of course, they didn't imply otherwise... What the timeout queue does enable: 'yielding' to the browser to prevent blocking the main thread if/when doing lots of work.

    • @Seedwreck
      @Seedwreck 3 місяці тому +1

      @@PaulSebastianM actually, it moves it off the sync main thread, nothing else or more
      Not real parallelism cause that’s not real in JS.
      That’s why you wrap a promise.
      This usually makes it so that they are deferred and if not awaited, these threads handle at the end of function as well, but in order.

    • @Seedwreck
      @Seedwreck 3 місяці тому +1

      @@PaulSebastianM this kind of things is useful if you say; make a for loop that pushes to a promise bucket to await all of, And you don’t want any sync gen code being ran until ready (by undeferring)

  • @eparizzi
    @eparizzi 2 місяці тому

    Hey Theo, can you make a video about Effect? I'm thinking of using it for a project but I get a lot of mixed feedback. What's your take?

  • @dinhero21
    @dinhero21 3 місяці тому +1

    It would be so cool if js was less messy (JS0?), then we could have insane optimizations for running at near-native speeds (and near-interpreted latencies!)

  • @grumpylibrarian
    @grumpylibrarian 3 місяці тому

    Promise.try=f=>(async()=>f())();
    Seems a little much to go through TC39 to replace one line shim.
    For that matter, compare these equivalent expressions:
    Promise.try(f).then(...);
    (async()=>f())().then(...);
    The finished product reduces your code length by TWO characters. Totally worth shoving through a JS proposal, eh?
    Oh, you prefer the semantics of the first? It's super easy, barely an inconvenience to do the second expression, and not hard at all to see what it's doing. I've used this pattern for years.
    This also works for promise-or-value variables:
    (async()=>x)().then(...);
    While the Promise.try is actually 4 characters LONGER in this case, and puts an extra function call on the stack:
    Promise.try(()=>x).then(...);
    Some of these proposals are both useful and necessarily in the engine. Others should have been a module import at most.

  • @aLfRemArShMeLlOw
    @aLfRemArShMeLlOw 3 місяці тому

    The "import source" would be perfect for native modules (.node, .dll, etc) and would make bundling them easy-peasy.

  • @justingolden87
    @justingolden87 3 місяці тому

    Temporal will be huge. I don't mind if it takes a while so they get everything right.

  • @clarkflavor
    @clarkflavor 3 місяці тому

    I most indeedly understood -most- _some_ of this

  • @JohnWilliams-gy5yc
    @JohnWilliams-gy5yc 3 місяці тому

    WG21 : Despite c# and the ecma, people still complain that our 3-years iteration is a bit too frequent.

  • @gioven187
    @gioven187 3 місяці тому

    Array zip is useful for making government api responsive usable

  • @MattChinander
    @MattChinander 3 місяці тому

    Maybe I’m dumb, but some practical examples would be helpful to understand the usefulness of some of these.

  • @calebpanza
    @calebpanza 3 місяці тому +1

    The Regex team doesn't get paid enough to talk about Regex 😂

  • @deatho0ne587
    @deatho0ne587 3 місяці тому

    7:14 - not a fan of putting functions on side of the creation of the variables. Allow .then() on everything not just observables or could make .destruct() that basically works the same on any of destructible things.

  • @helleye311
    @helleye311 3 місяці тому +3

    I really wanted array zip for a while, happy to see it's moving up.
    Not sold on the destructuring transformers syntax, it looks super weird to me to wrap things in what looks like a function call on the left side of the = sign.
    Also iterator methods. Might finally start using those. iterators/generators are a cool concept but it's hard to work with when they're missing features from arrays.
    Still waiting for custom operator overloading though. I wouldn't use it too often but sometimes writing thing1 + thing2 just makes so much sense. JS is the only language I use that doesn't have it. Maybe next time.

    • @ivlis.w
      @ivlis.w 3 місяці тому

      I don't know if the power of operator overloading should be trusted to JS devs..
      But hey it's always fun to throw stuff and see what happens 😹
      Or maybe it's just me that the only place I saw it was in C++ and already an incomprehensible mess sometimes
      If it only applied to the same class instances I guess it could not be that bad

    • @helleye311
      @helleye311 3 місяці тому

      @@ivlis.w I've used it successfully in Rust and C#, and it's also available in python. So lots of high and low level languages do it, why not JS. I think ideally you'd use it with [Symbol.add]: (value1, value2)=>{...}, seems reasonable. Could even be used on plain objects

  • @AndrewEddie
    @AndrewEddie 3 місяці тому

    So, um, any other TDD warriors thinking what I'm thinking after watching the sponsor message? ;)

  • @Danielo515
    @Danielo515 3 місяці тому

    Object extractors looks awesome

  • @chm10323
    @chm10323 3 місяці тому

    if JS is trying go struct that far to Rust, then why not create a new version of Type struct like Typescript but run it natively?

  • @wayluke
    @wayluke 3 місяці тому

    I want tot see the increate of the enum right now

  • @NithinJune
    @NithinJune 3 місяці тому +1

    chapter timestamps would be nice

  • @boblol1465
    @boblol1465 3 місяці тому

    feels like a fucking fever dream, js people please go see lua

  • @Apasstrife
    @Apasstrife 3 місяці тому

    every week is a crazy week in javascript. such a messy language.

  • @janmachala6511
    @janmachala6511 3 місяці тому

    so still nothing new on pipe operator?

  • @codeChuck
    @codeChuck 3 місяці тому

    Extractor pattern is bull, not usable, because it is more symbols to type and very hard to understand. const should be followed by the name, not function call.

  • @leandro.menezes
    @leandro.menezes 3 місяці тому +1

    CodeRabbit yaps too much

    • @NatoBoram
      @NatoBoram 3 місяці тому +1

      You can disable individual yapping sections and tools that makes it yap more. You can also customize prompts and ask it to yap less. Or to swear like a pirate or something.

  • @zwanz0r
    @zwanz0r 3 місяці тому +5

    "import source". Why not "import a from '' with { type: 'source' }"

  • @4ndrs_dev
    @4ndrs_dev 3 місяці тому

    i tried bullying code rabbits pr comments because of you theo, but it started posting crying emojis with bunnies😭

  • @aleatoriedades975
    @aleatoriedades975 3 місяці тому +1

    Csharpzation of js

  • @namenloss730
    @namenloss730 3 місяці тому

    I'd love iterators to be more efficient.
    They are terrible at the moment (or I f*ed up my benchmarking)

  • @last_fanboy_of_golb
    @last_fanboy_of_golb 3 місяці тому

    2:30 Theo a human supremacist

  • @inversemetric
    @inversemetric 3 місяці тому

    I hate most of these proposals. Might move to webassembly :/

  • @PaulSebastianM
    @PaulSebastianM 3 місяці тому +1

    No real fixes tho

  • @AndrewErwin73
    @AndrewErwin73 3 місяці тому

    ...and no one will ever use them cuz they are all still trying to learn ES6!

  • @marcusmors8485
    @marcusmors8485 3 місяці тому +1

    I feel more reluctant to program and learn javascript, like php, every time javascript decides to add things that could be done before with new sintaxis and keep supporting previous features.
    It's like watching c++1993 compared to modern C++, but 30 times worse.

  • @IAmOxidised7525
    @IAmOxidised7525 3 місяці тому +6

    Those big changes we cannot completely use , until every major browser, decides to implement and ship it

    • @oso1248
      @oso1248 2 місяці тому

      Did something change? It’s always been like that, so I was wondering if you heard that somehow they figured out how to reverse the implement->use process to a use->implement process.

  • @Danny1986il
    @Danny1986il 3 місяці тому

    Decimal + Extractors = const Decimal128(dec) = "1.25";

  • @inversemetric
    @inversemetric 3 місяці тому

    The JS structs proposal is terrible.

  • @binarybulletin
    @binarybulletin 3 місяці тому

    Make a videos on express.js v5

  • @elvispalace
    @elvispalace 3 місяці тому

    you didnt liked the tweet

  • @Drayken
    @Drayken 3 місяці тому +1

    Dear TC39 homies,
    I humbly request that you let me hijack styling, button text and callbacks on each button from the browser default alert() and confirm() methods
    signed,
    jesusTakeTheWheel™

  • @УмидМусаев-й5ч
    @УмидМусаев-й5ч 3 місяці тому

    There is a new model of llama 3.1 neurotron from NVIDIA appeared a few days ago, that should be more powerful than 4o from chat gpt. Will you make a video on that?

  • @zlatkoiliev8927
    @zlatkoiliev8927 3 місяці тому

    I don't like this, JavaScript is slowly becoming Java, but much more unorganised in terms of syntax!

  • @robertholtz
    @robertholtz 3 місяці тому +5

    Temporal is pronounced with the emphasis on the first syllable not the second: TEMPoral not TemPORal. Like "Temporary" not "Tempura."

  • @scottl4422
    @scottl4422 3 місяці тому +17

    These features all sound good on their own but the language just feels like it's getting too big.

    • @b_two
      @b_two 3 місяці тому +6

      It’s funny seeing people complaining about this at the same time as people complaining javascript doesnt have all the syntaxes / std library features they wish it did
      (I’m not saying anything about who’s right or wrong though, just appreciating the irony of the fact)

    • @froozenalex
      @froozenalex 3 місяці тому +5

      On the contrary, the more it has, the less data you'll have to transfer over the internet

    • @froozenalex
      @froozenalex 3 місяці тому +3

      And you can always not use the features

    • @doc8527
      @doc8527 3 місяці тому

      @@b_two haha, I got the exact same feeling, keep watching people who either have to code with js everyday or people who just barely code anything for the web complaining the both side.
      I was too busy to tackle problems, the only thing I more care about it's just the consistency, javascript is infamous for its inconsistency of builtin functionalities in the past. And I'm suffer a lot from it and have to create lots of functions that mimic the std lib from other languages that are supposed to be the behavior of some of current functions.
      It seems like I rarely see people talking about it except the date lib, and finally they address it.

  • @abcq1
    @abcq1 3 місяці тому +3

    Poor Theo. Here, take this and save it, have a relief until native chunks come.
    const chunkify = (arr, size) => {
    const result = []
    let index = 0
    while(index < arr.length){
    result.push(arr.slice(index, index + size))
    index += size
    }
    return result
    }

    • @essamal-mansouri2689
      @essamal-mansouri2689 3 місяці тому +8

      It is ironic that you're making fun of how simple it is to implement, while also simultaneously implementing it wrong?
      The one in the video operates on streams, not arrays, meaning you can chunk data without first reading it all into memory. Your example will read everything into memory first and then create new slices from it.

    • @essamal-mansouri2689
      @essamal-mansouri2689 3 місяці тому +1

      I also do agree that this is not some insane mind-blowing thing where people couldn't have just implemented themselves.

    • @kif_95
      @kif_95 3 місяці тому

      @@essamal-mansouri2689 well said

  • @the-old-channel
    @the-old-channel 3 місяці тому

    Why the F are your ads so useful? 0_o

  • @thewayfaringshadow
    @thewayfaringshadow 3 місяці тому

    I work in realms all the time. I think it is fun!

  • @ET_AYY_LMAO
    @ET_AYY_LMAO 3 місяці тому

    Im sorry but i hate this. The only purpose for such a feature creep is to make it impossible to create competitors to the established browsers, specs should be simple and minimal, if you can implement it in JS there is no need for a standardization of the feature. You are killing the free and open internet with feature creep. You will make it impossible to implement a browser by a small dedicated team...

  • @TesterAnimal1
    @TesterAnimal1 3 місяці тому

    13:18 just .isError?
    Why not .is generally?
    They’re not thinking far enough.
    isDate, isUrl, isMyClassName etc.
    Nobody contributing thought of extending the concept further? 😳

  • @MrMediator24
    @MrMediator24 3 місяці тому

    Me, a Rustecean: "Odd, but starting to feel like home"

  • @v1Broadcaster
    @v1Broadcaster 3 місяці тому

    hi theo!

  • @fulcanelly
    @fulcanelly 3 місяці тому

    why we need AsyncContext when AsyncLocalStorage exist ?

  • @しめい-l4m
    @しめい-l4m 3 місяці тому +1

    it's not JS anymore, it's J#++ust

    • @RustIsWinning
      @RustIsWinning 3 місяці тому

      That's all my favourite languages in one haha :D

  • @jalbers3150
    @jalbers3150 3 місяці тому

    100% bloat

  • @ryzzlas
    @ryzzlas 3 місяці тому

    If JSON does not also support the decimals, it is hardly of much use in APIs ...

  • @prerit714
    @prerit714 3 місяці тому

    We live in a time where you need a vscode fork which uses AI to imports instead of an actual LSP. Bro.

  • @TheRealMangoDev
    @TheRealMangoDev 3 місяці тому

    js is becoming a worse clone of rust. but js still sucks

  • @user-abc855
    @user-abc855 3 місяці тому

    I want extractors so bad

  • @XxFab5Mas13rxX
    @XxFab5Mas13rxX 3 місяці тому +1

    Earliest I’ve ever been lol

  • @seanfilimon
    @seanfilimon 3 місяці тому +2

    First here

    • @Seedwreck
      @Seedwreck 3 місяці тому

      @@nonefvnfvnjnjnjevjenjvonej3384 Save your career by being a little more mindful!
      You spelt it wrong!

  • @nitsanbh
    @nitsanbh 3 місяці тому +1

    People lost the ability to write simple functions.
    10:15 You want "chunks" so bad? man, it's literally 2 lines to implement

    • @nostalgia5031
      @nostalgia5031 3 місяці тому +1

      Why so serious?

    • @spht9ng
      @spht9ng 3 місяці тому

      Yeah but we love language features.

    • @Exilum
      @Exilum 3 місяці тому +5

      The difference is it's going to be optimized for you at a deeper level.
      On top of that, rather than copy pasting an implementation, even 2 lines, from project to project, anyone would be happier with it being a language feature. Why would you not want that to be a feature?
      In C#, Linq is literally every dev's favorite built-in library, and all it contains is a bunch of functional helper functions for data handling. A better standard makes for a better language.

    • @b_two
      @b_two 3 місяці тому

      Why don’t you implement your own String data structure?

    • @essamal-mansouri2689
      @essamal-mansouri2689 3 місяці тому

      @@Exilum ​ That's not a real comparison at all because Linq does a lot in terms of performance and when it comes to using something like Entity Framework, things like defining the conditions for a query is only possible as native comparisons because Linq can be used to translate them into actual queries at runtime. That said, things like chunking or stream and array operators in general should generally be part of the standard library so I'm not mad about that. But Theo will always exaggerate things like this like "ohhh this would make X and Y so much easier I had to struggle with A, B, C" is basically a speech pattern for him. It's a streamer thing, I think.

  • @ErickRodrCodes
    @ErickRodrCodes 3 місяці тому

    SECOND

  • @furlz
    @furlz 3 місяці тому

    First

  • @aayushpayusbh
    @aayushpayusbh 3 місяці тому

    First