The Biggest TypeScript Update In Years

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ส.ค. 2024
  • I am so hyped for TypeScript version 5.5. I need all of these updates ASAP. What's your favorite?
    SOURCES
    devblogs.micro...
    x.com/mattpoco...
    Check out my Twitch, Twitter, Discord more at t3.gg
    S/O Ph4se0n3 for the awesome edit 🙏

ความคิดเห็น • 172

  • @RogerClotet
    @RogerClotet 2 หลายเดือนก่อน +186

    Finally someone acknowledges birds aren't real.

    • @bielarusajed
      @bielarusajed 2 หลายเดือนก่อน +6

      Everybody knows that the bird is the word

    • @owenwexler7214
      @owenwexler7214 2 หลายเดือนก่อน +4

      People are waking up.

    • @tyu3456
      @tyu3456 2 หลายเดือนก่อน

      Finally! Mainstream media doesn't dare to report on this!!

    • @goosydev
      @goosydev 2 หลายเดือนก่อน +1

      Exactly, I've been telling people its the drones but they think im crazy

    • @sergeylysenko2866
      @sergeylysenko2866 2 หลายเดือนก่อน

      yes, they are all dinosaurs!

  • @MrManafon
    @MrManafon 2 หลายเดือนก่อน +238

    year 99 of Hoping for pattern matching and curried pipe chains

    • @gusryan
      @gusryan 2 หลายเดือนก่อน +13

      I would give my soul for if expressions

    • @ononaokisama
      @ononaokisama 2 หลายเดือนก่อน +13

      I wouldn’t hold my breath for pattern matching in typescript better to wait for it to hit JavaScript than typescript

    • @rerere1569
      @rerere1569 2 หลายเดือนก่อน +6

      Try ts-pattern

    • @timchen8512
      @timchen8512 2 หลายเดือนก่อน +3

      Who is also the Rx lover ?😊

    • @carere
      @carere 2 หลายเดือนก่อน +3

      I use ts-pattern, it does the job 👍

  • @MichiganTypeScript
    @MichiganTypeScript 2 หลายเดือนก่อน +37

    for anyone interested in a deep dive with the PR author: we recorded an in-depth (more than an hour) video with Dan Vanderkam on his PR on inferred type predicates (the top feature) and it's launching later this week.

    • @kasper_573
      @kasper_573 2 หลายเดือนก่อน +1

      Heck yes! Looking forward to it!

    • @MichiganTypeScript
      @MichiganTypeScript 2 หลายเดือนก่อน +1

      @@kasper_573 thanks! we're really excited about it: we covered the whole story from how he got the idea all the way to the approach he took (Anders himself commented that it was a really unique technique compared to what else has been done in the compiler before).

    • @awave7710
      @awave7710 2 หลายเดือนก่อน +1

      hell yessss ❤

    • @MichiganTypeScript
      @MichiganTypeScript 2 หลายเดือนก่อน

      update: it's live!

  • @orionh5535
    @orionh5535 2 หลายเดือนก่อน +34

    Explaining modern frontend development to new devs is so hard because of all years of context to explain all the over engineering we've done.

    • @marcuss.abildskov7175
      @marcuss.abildskov7175 2 หลายเดือนก่อน +4

      It's hard because of all the garbage tech like React

  • @HuntingKingYT
    @HuntingKingYT 2 หลายเดือนก่อน +10

    "Undefined is no longer a valid variable name"
    WHY ONLY NOW

  • @amorto3420
    @amorto3420 2 หลายเดือนก่อน +2

    These types of video really keeps me up to date with the Javascript/Typescript world. Thank you Theo!

  • @MrManafon
    @MrManafon 2 หลายเดือนก่อน +27

    I loved when Theo said that he’d never seen the jsdoc import - but next and tw in t3 both use it 😂

    • @aLfRemArShMeLlOw
      @aLfRemArShMeLlOw 2 หลายเดือนก่อน

      He very much doesn't work on t3

  • @guilhermeraposo6080
    @guilhermeraposo6080 2 หลายเดือนก่อน +122

    function isBirdReal(bird: Bird) {
    return false;
    }

    • @funhaos
      @funhaos 2 หลายเดือนก่อน +6

      const isBirdReal = false;

    • @trappedcat3615
      @trappedcat3615 2 หลายเดือนก่อน +3

      return false as NoFlyLikeAnEagle

    • @1234macro
      @1234macro 2 หลายเดือนก่อน

      GetCategory("bird");
      > undefined

    • @magicalhobo3000
      @magicalhobo3000 2 หลายเดือนก่อน +5

      Error: "bird" is defined but never used

    • @brodacious1313
      @brodacious1313 2 หลายเดือนก่อน +1

      I love that we accept argument "bird" and just never actually consider it. TypeScript may give that an error, but that's pure logic in my eyes.

  • @hidoryy
    @hidoryy 2 หลายเดือนก่อน +18

    the mental gymnastics you need to go through just to have type "safety" but also be able to somewhat make use of polymorphism is crazy

    • @jaredsmith5826
      @jaredsmith5826 2 หลายเดือนก่อน +1

      I would totally agree for subtype polymorphism and totally disagree for ad hoc polymorphism. I never feel like I need gymnastic to e.g. implement traits in Rust code. But I definitely feel it when working on OO TS code.

    • @joshuatye1027
      @joshuatye1027 2 หลายเดือนก่อน +3

      It's not type safety, it's autocompletion. Instead of Typescript it should have been called AutocompletionScript

  • @OneOfThePetes
    @OneOfThePetes 2 หลายเดือนก่อน +3

    I like your voice, Theo. Kinda wish it was on my GPS system, criticising the state of the roads.

  • @abstractionGod
    @abstractionGod 2 หลายเดือนก่อน +4

    Typescript Is the one library I never think about and I think that’s a good thing

    • @epajarjestys9981
      @epajarjestys9981 2 หลายเดือนก่อน +4

      TypeScript is the one pile of shit I never use and I think that's a good thing.

    • @ArnoldsKtm
      @ArnoldsKtm 2 หลายเดือนก่อน +1

      @@epajarjestys9981 if you write javascript without typescript and you're proud about it... nothing good about it

  • @FeckOffTeaCup
    @FeckOffTeaCup 2 หลายเดือนก่อน +6

    Bird is bird, but is bird the word?

  • @ignrey
    @ignrey 2 หลายเดือนก่อน +1

    1:44 "All birds aren't real" indeed brother.

  • @ghandn
    @ghandn 2 หลายเดือนก่อน +1

    “All birds aren’t real” loved it 😂

  • @fantastic2503
    @fantastic2503 2 หลายเดือนก่อน +98

    At this point, just make JavaScript strongly typed

    • @somenameidk5278
      @somenameidk5278 2 หลายเดือนก่อน +16

      I wonder how much performance you could gain by doing that

    • @orionh5535
      @orionh5535 2 หลายเดือนก่อน +29

      Of course this wouldnt actually happen as it would break the internet, but I like to sometimes sit down an imagine the chaos that would ensure if javascript actually made a breaking change

    • @JannisAdmek
      @JannisAdmek 2 หลายเดือนก่อน

      @@orionh5535 typescript is a superset of javascript, right? (let's ignore enums) so it should work to - in theory - support it directly.

    • @Xemmness
      @Xemmness 2 หลายเดือนก่อน +28

      "use types" at the top of the file and we gucci

    • @Leonhart_93
      @Leonhart_93 2 หลายเดือนก่อน +7

      @orionh5535 I don't buy that. Files with a special "use ..." header and it's done. The more probable reason why it doesn't happen is that V8 would need to be reworked, and that costs many 10s of millions.

  • @Imaginativeone_DF
    @Imaginativeone_DF 2 หลายเดือนก่อน

    Even if I didn’t dev, I would still relish this channel! “…but we’re talking about undefined birds…”

  • @cyan2048
    @cyan2048 2 หลายเดือนก่อน +1

    What a coincidence, I was using lodash for my Sets, now there's a better option. Very neat!!!!

  • @matthewbramer7654
    @matthewbramer7654 2 หลายเดือนก่อน +2

    The real question is why it took a decade to get this landed?

  • @hamodeyDooba
    @hamodeyDooba 2 หลายเดือนก่อน

    Mate deserve some support in his channel.
    thanks Theo

  • @mykole.
    @mykole. 2 หลายเดือนก่อน +1

    Literally like an hour ago I was handling the undefined in arrays haha

  • @ericlindell3777
    @ericlindell3777 2 หลายเดือนก่อน

    Love these ts release note walkthroughs!

  • @benheidemann3836
    @benheidemann3836 2 หลายเดือนก่อน +3

    I don’t understand why people insist on seeing in black and white. The question of whether you should annotate your return type explicitly, clearly does not have a correct answer independent of context. Can we stop encouraging developers to accept simple answers and start encouraging nuance and critical thinking instead? 😩

    • @marcuss.abildskov7175
      @marcuss.abildskov7175 2 หลายเดือนก่อน +1

      You're expecting too much from web developers in 2024 lol

  • @berridgeab
    @berridgeab 2 หลายเดือนก่อน +1

    Everyone knows that bird === theWord.

  • @Xemmness
    @Xemmness 2 หลายเดือนก่อน +3

    still no throws keyword feelsbadman

  • @thatscute973
    @thatscute973 2 หลายเดือนก่อน

    The birds aren't real ref got me, can't watch past that. Iykyk.

  • @anon_y_mousse
    @anon_y_mousse 2 หลายเดือนก่อน

    Personally, I like the increase in type inference. It can be difficult to implement, but I think it's worth it. As I've been working on my own language I've slowly been working towards anonymous structs being basically just another tuple type and that leads me towards arrays not needing a type at all as I'm already using brackets for both tupling and arraying. Eventually, I may end up using braces only for code blocks, and I kind of like the thought of that.

  • @fakedevdutt
    @fakedevdutt 2 หลายเดือนก่อน

    Theo: auhh this is huge..! auhh thats nice...! auhh this also makes...!

  • @FrederikSchumacher
    @FrederikSchumacher 2 หลายเดือนก่อน +2

    Watching TypeScript and JavaScript develop is like watching somebody build a supercar by starting with bottlecaps, toothpicks and compressed air and fumbling along mindlessly.

  • @professormikeoxlong
    @professormikeoxlong 2 หลายเดือนก่อน +2

    8:10 yeah man tf this import syntax exists for like 2 years already

  • @nullbeyondo
    @nullbeyondo 2 หลายเดือนก่อน +1

    So basically the "type gymnastics" people used to complain about in Typescript are now gone. There's no excuse not to use typescript now lol.

  • @yiannis_p
    @yiannis_p 2 หลายเดือนก่อน

    God looks like ts monorepos pain won't be as as bad and it's getting better.
    Massive shoutout to Julius whose t3 turbo has a beautiful setup that just works!

  • @ordazgustavo
    @ordazgustavo 2 หลายเดือนก่อน

    here comes the return type annotation war again

  • @orionh5535
    @orionh5535 2 หลายเดือนก่อน +4

    Now my boss will expect me to identify if an image has a bird in less than 5 years and without a research team ;_;

  • @abbyh5158
    @abbyh5158 2 หลายเดือนก่อน

    I just want a way to mark that a function throws and interrupts the processing flow

  • @Lars16
    @Lars16 2 หลายเดือนก่อน +2

    5:20 "name" in user
    Hasn't this been a thing for a while in TS? I have been using this type narrowing quite a bit in my code.

    • @marcuss.abildskov7175
      @marcuss.abildskov7175 2 หลายเดือนก่อน

      It has. Theo is just a useless web developer who knows nothing 😂

    • @marcuss.abildskov7175
      @marcuss.abildskov7175 2 หลายเดือนก่อน

      The typical React developer 🤷‍♂️

  • @kris-lq4rw
    @kris-lq4rw 2 หลายเดือนก่อน +1

    nice shirt, nice video, nice update, do you think that there will ever be a day in which we can explicitly state that a function has a chance to throw an exception in TS? maybe it's fine the way it is with try/catch/JSDoc annotations but it always felt weird to me

    • @greyshopleskin2315
      @greyshopleskin2315 2 หลายเดือนก่อน +1

      If implemented in a backwards compatible way (which is a must) would not make too much sense.
      Like sure, for your own code, or newer versions of some libraries is nice.
      The problem is that all existing code has no exception info in the signature. Which means that every function can throw.
      Even so, when using internal code or updated libraries it is nice.
      Anyway, something which is way better than exceptions is return values.
      Think of Option (can be Some(value) or None)), Result (Ok(value) or Error(error_data)) and so on.
      For example, in Python errors as values and Optionals are not “native” but with the returns package you can do it very ergonomic.
      Given that what you want will probably never happen, you can use errors as values in your code today

    • @greyshopleskin2315
      @greyshopleskin2315 2 หลายเดือนก่อน

      Another option is to take a look at ReScript. It is very nice. There are a few vids on yt about it.

  • @deerawj
    @deerawj 2 หลายเดือนก่อน +2

    Too much Bird

  • @pierwszywolnynick
    @pierwszywolnynick 2 หลายเดือนก่อน

    bird is a word

  • @Bobbias
    @Bobbias 2 หลายเดือนก่อน +3

    And it's still just papering over JS's inadequacy.
    God I wish we could just deprecate JS entirely and use something else... WASM would be a good option since you can compile more or less anything to it, but they've explicitly designed it to not be a full on replacement for JS.

    • @bereck7735
      @bereck7735 2 หลายเดือนก่อน

      JavaScript is pretty much a curse, no ones likes it and there has been so much work to "improve" it, but in the end, we are left with a HUGE pile of over engineered spaghetti mess of tools, libraries, frameworks and god knows what and whats worse is that now its too late to do anything about it now.

  • @WilliamWelsh
    @WilliamWelsh 2 หลายเดือนก่อน +1

    not filtering out undefined is one of the most annoying errors

  • @kungfooman
    @kungfooman 2 หลายเดือนก่อน

    Was about time to fix basic errors like ESM resolution lol

  • @Brymcon
    @Brymcon 2 หลายเดือนก่อน

    It's big. Python should have this. Undefined

  • @MichaelKire
    @MichaelKire 2 หลายเดือนก่อน

    2:00 FINALLY

  • @Dude29
    @Dude29 2 หลายเดือนก่อน

    That viewer was right, this shit should have been 5.0

  • @cerulity32k
    @cerulity32k 2 หลายเดือนก่อน

    wait this is cool af

  • @wintercounter2
    @wintercounter2 2 หลายเดือนก่อน

    So now we know for sure that the bird is the word?

  • @shapelessed
    @shapelessed 2 หลายเดือนก่อน

    I watched this video and literally 30 minutes later I got annoyed by the same type type inference issue described in the video regarding array filtering...
    Well screw it, TS 5.5 is close enough I might as well use it already...

  • @ericjbowman1708
    @ericjbowman1708 2 หลายเดือนก่อน +2

    Why does AI have to suck at regex worse than I do?

    • @JerehmiaBoaz
      @JerehmiaBoaz 2 หลายเดือนก่อน +1

      Because regexes don't split up into multi character tokens for LLMs very well?

  • @anasouardini
    @anasouardini 2 หลายเดือนก่อน

    1:40 it's the opposite: TS wasn't smart enough.

  • @akam9919
    @akam9919 2 หลายเดือนก่อน

    This MS whistleblower must be protected at all costs.

  • @KristianTheDesigner
    @KristianTheDesigner 2 หลายเดือนก่อน

    i wonder…..have you heard….the word?

  • @izzy6865
    @izzy6865 2 หลายเดือนก่อน

    All I want is project wide type checking 😥

  • @manomancan
    @manomancan 2 หลายเดือนก่อน +4

    Hiya Theo! Thanks for the video; I'm a self-taught developer and I really feel like I'm part of your community with these! Quick question (and super sorry if this is inappropriate/unwarranted viewer comment): But why aren't the videos shorter in general, like say Fireship? Is it because they are extracts from Twitch streams? E.g. I loved this title and was very curious about what you had to say, but seeing the 30-minute time intimidated me a bit now. [Edit: Thanks for all your hard work!!]

    • @Darkstar159
      @Darkstar159 2 หลายเดือนก่อน

      "The biggest TS update in years"

    • @t3dotgg
      @t3dotgg  2 หลายเดือนก่อน +6

      Because I make videos the length I want to :)

    • @diadetediotedio6918
      @diadetediotedio6918 2 หลายเดือนก่อน

      Why you feel the need to state that you are a 'self-taught developer' when speaking? I mean, I'm not judging, I am as well, but this sounds like a very artificial behavior and I want to understand the rationals.

    • @manomancan
      @manomancan 2 หลายเดือนก่อน +1

      @@t3dotgg Of course! As you always should - I'm a fan and grateful for your videos. Huge apologies if I inadvertently annoyed you; genuinely came from a loving-viewer, good place.

    • @manomancan
      @manomancan 2 หลายเดือนก่อน +1

      @@diadetediotedio6918 Because it makes me more appreciative of creators like Theo, who create remote communities that I could not experience at a university. It feels good to be a part of a community.

  • @Matt23488
    @Matt23488 2 หลายเดือนก่อน

    I don't get jsdoc over ts. Like, I understand for maybe small scripts contained in a single module. But if you're getting to the point where you're needing to import things from other modules, I don't see why it's not just worth it to start with TypeScript. Unless you have a good reason that you can't use one of the many templates available, it doesn't take any effort to set up.

    • @jbeaudoin11
      @jbeaudoin11 2 หลายเดือนก่อน

      I've been using ts in jsdoc for a while now. It helps me to quickly add typing here and there and slowly help the code base. If i need to edit an old js file, i can enable ts-check, do my thing and disable it since 90% of the file is red. It sucks a bit but it's better than nothing. And forget migrating to ts, too much work, needs to be iterative.
      It's far from perfect like you need to have the file open for vscode to scream at you. That said there's an experimental feature for that but it's slow in huge code base and create a lot of noise.

  • @seeibe
    @seeibe 2 หลายเดือนก่อน

    Oh yeah that filter thing was so annoying. Nice!

  • @gkumartube
    @gkumartube 2 หลายเดือนก่อน

    Thanks

  • @kristianlavigne8270
    @kristianlavigne8270 2 หลายเดือนก่อน

    Larry Bird 🐦

  • @ckpioo
    @ckpioo 2 หลายเดือนก่อน

    the more i have been learning rust for the past year, the more im starting to hate ts

  • @James666Brown
    @James666Brown 2 หลายเดือนก่อน

    It's pronounced REJular expression

  • @stevenstark-com
    @stevenstark-com 2 หลายเดือนก่อน

    this is great, a lot of the things here are reasons why I often prefer to just use JS now over TS when I'm not working on a large library or framework.
    Now, it appears that I can jump into TS without needing to constantly add all the TS boilerplate things, and just jump into the code. love it!

  • @marwellus1
    @marwellus1 2 หลายเดือนก่อน +1

    All hail the bird: th-cam.com/video/9Gc4QTqslN4/w-d-xo.html

  • @jordanmancini
    @jordanmancini 2 หลายเดือนก่อน

    I tried to use Typescript twice in my discord bot project. Both times I ended up just manually writing the CommonJS equivalent after I confirmed that the TS could compile and was type safe because the packages I required weren't made for ES modules and as such I had conflicts in build. I want to update to ES modules and TS but because of the dependencies that aren't on ES I'm stuck on CommonJS until it either gets updated or I bite the bullet to rewrite it to migrate away from the outdated packages.

    • @igorordecha
      @igorordecha 2 หลายเดือนก่อน

      But typescript doesn't depend on ESM. You can easily use typescript and build to commonJS. Iirc it's the default.

    • @bereck7735
      @bereck7735 2 หลายเดือนก่อน

      You can set the build target to commonJS ( in tsconfig )and yes thats the default behaviour

  • @skitzskr
    @skitzskr 2 หลายเดือนก่อน

    finally ts got rid of this "is possibly undefined" sh*t

  • @ojaskavathe
    @ojaskavathe 2 หลายเดือนก่อน

    bird

  • @eslachance
    @eslachance 2 หลายเดือนก่อน

    Theo about to spark a debate on how you should pronounce "regex". Sorry Theo, I don't say "rejular expressions" so regex is "reg(ular) ex(pression)". You're pronouncing it wrong :P

    • @spartanatreyu
      @spartanatreyu 2 หลายเดือนก่อน

      Trying to enunciate "Reg Ex" a few times in a sentence when talking fast makes the sentence sound too stuttery because you need to add a pause between the G and E.
      The sentence needs to be more fluid and flow-y to feel natural and comfortable to speak.
      Sometimes we can shuffle things around by removing the first stress, removing the pause, and starting the second stress (which is now the only stress) one phoneme earlier, but that turns "Reg Ex" into "re'Gex" which is still too stuttering to be comfortable to say repeatedly.
      But the Hard G can then be slurred into a Soft G (J sound) turning "re'Gex" into "re'Jex", and now we can bring back the first stress (but keeping the second stress starting that one phoneme earlier to keep it comfortable) which turns "re'Jex" into "Re(h) Jex". Then the natural pace of talking fast when needed simply plucks out the unnecessary space turning "Re(h) Jex" into "ReJex".

  • @nikensss
    @nikensss 2 หลายเดือนก่อน

    Oh, please don't talk about "explicit return types". I completely disagree with you on that and the debate should not be brought up again 😂 I want to be the one deciding what my function returns, not TS. TS always infers something, even if I made a business-logic mistake. So yes, be explicit about what your intention is with the function.

    • @diadetediotedio6918
      @diadetediotedio6918 2 หลายเดือนก่อน

      You don't need to use implicit returns, but they are indeed useful. Sometimes for quick prototyping they are everything you need, and most of the times TS can correctly infer the return types based on what you effectively returned, so unless you are doing something very wrong (and are unable to hover the function to see what it infered or enable type hints) it should suffice.

  • @Vemu
    @Vemu 2 หลายเดือนก่อน +14

    JS is still years behind other languages.

    • @jackdanielson1997
      @jackdanielson1997 2 หลายเดือนก่อน +1

      How so?

    • @vitosnatios
      @vitosnatios 2 หลายเดือนก่อน

      not in libs tho

    • @majutsush1
      @majutsush1 2 หลายเดือนก่อน +3

      refuses to elaborate

    • @greyshopleskin2315
      @greyshopleskin2315 2 หลายเดือนก่อน

      @@vitosnatiosexample?

    • @themprsndev
      @themprsndev 2 หลายเดือนก่อน +1

      C# is so so so far ahead, it's laughable tbh the state JS is in considering it's the most used language in the world

  • @matej254sk
    @matej254sk 2 หลายเดือนก่อน

    strick: false

  • @Emin4egg
    @Emin4egg 2 หลายเดือนก่อน

    How annoying these antics on the preview

  • @paca3107
    @paca3107 2 หลายเดือนก่อน +1

    honestly I dont care

  • @skylark.kraken
    @skylark.kraken 2 หลายเดือนก่อน

    I was working on a library and I stopped working on it because of the type issues that should be fixed, get to dust that off and finish it

  • @okoiful
    @okoiful 2 หลายเดือนก่อน

    why do you always do a weirdo face on the thumbnails?

  • @user-jd7ub3tq2b
    @user-jd7ub3tq2b 2 หลายเดือนก่อน

    dude's reactions are fake asf lol. These updates are nowhere near good enough for such a enthusiastic response. I understand the peculiarities of the blogging profession, but the falseness is nauseating

  • @AntonioBrandao
    @AntonioBrandao 2 หลายเดือนก่อน +1

    Cringe thumbnail

  • @MinecraftHV
    @MinecraftHV 2 หลายเดือนก่อน +1

    First🎉

  • @aakarshan4644
    @aakarshan4644 2 หลายเดือนก่อน

    at this point just make a new freaking language than this shitty js ecosys.

  • @vcankeklik
    @vcankeklik 2 หลายเดือนก่อน

    can we please deprecate TypeScript altogether?

    • @th3n3rdman
      @th3n3rdman 2 หลายเดือนก่อน

      Why?

    • @diadetediotedio6918
      @diadetediotedio6918 2 หลายเดือนก่อน +1

      This is like a bot thing? Almost every video from every language there is 1 or 3 people like this that are just randomly stating the language should not exist like a generic hater.

    • @vcankeklik
      @vcankeklik 2 หลายเดือนก่อน

      th-cam.com/users/shortsksBNx1vBm_0?si=9SU5il2EnGxUO07M

  • @atxorsatti
    @atxorsatti 2 หลายเดือนก่อน

    They forget the "cia__spyOnCivilans" function on the bird type but ok