The Biggest TypeScript Update In Years

Поділитися
Вставка
  • Опубліковано 9 чер 2024
  • I am so hyped for TypeScript version 5.5. I need all of these updates ASAP. What's your favorite?
    SOURCES
    devblogs.microsoft.com/typesc...
    x.com/mattpocockuk/status/179...
    Check out my Twitch, Twitter, Discord more at t3.gg
    S/O Ph4se0n3 for the awesome edit 🙏
  • Наука та технологія

КОМЕНТАРІ • 171

  • @MrManafon
    @MrManafon 21 день тому +237

    year 99 of Hoping for pattern matching and curried pipe chains

    • @gusryan
      @gusryan 21 день тому +13

      I would give my soul for if expressions

    • @ononaokisama
      @ononaokisama 21 день тому +13

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

    • @rerere1569
      @rerere1569 21 день тому +6

      Try ts-pattern

    • @timchen8512
      @timchen8512 21 день тому +3

      Who is also the Rx lover ?😊

    • @carere
      @carere 21 день тому +3

      I use ts-pattern, it does the job 👍

  • @RogerClotet
    @RogerClotet 21 день тому +178

    Finally someone acknowledges birds aren't real.

    • @bielarusajed
      @bielarusajed 21 день тому +5

      Everybody knows that the bird is the word

    • @owenwexler7214
      @owenwexler7214 20 днів тому +4

      People are waking up.

    • @tyu3456
      @tyu3456 20 днів тому

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

    • @goosydev
      @goosydev 18 днів тому +1

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

    • @sergeylysenko2866
      @sergeylysenko2866 17 днів тому

      yes, they are all dinosaurs!

  • @orionh5535
    @orionh5535 21 день тому +33

    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.

  • @MichiganTypeScript
    @MichiganTypeScript 20 днів тому +36

    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 20 днів тому +1

      Heck yes! Looking forward to it!

    • @MichiganTypeScript
      @MichiganTypeScript 20 днів тому +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 20 днів тому +1

      hell yessss ❤

    • @MichiganTypeScript
      @MichiganTypeScript 18 днів тому

      update: it's live!

  • @guilhermeraposo6080
    @guilhermeraposo6080 21 день тому +121

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

    • @PHPLITHIUM
      @PHPLITHIUM 20 днів тому +6

      const isBirdReal = false;

    • @trappedcat3615
      @trappedcat3615 20 днів тому +3

      return false as NoFlyLikeAnEagle

    • @1234macro
      @1234macro 20 днів тому

      GetCategory("bird");
      > undefined

    • @magicalhobo3000
      @magicalhobo3000 20 днів тому +5

      Error: "bird" is defined but never used

    • @brodacious1313
      @brodacious1313 20 днів тому +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.

  • @HuntingKingYT
    @HuntingKingYT 20 днів тому +9

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

  • @amorto3420
    @amorto3420 20 днів тому +2

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

  • @MrManafon
    @MrManafon 21 день тому +27

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

  • @hidoryy
    @hidoryy 20 днів тому +17

    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 20 днів тому +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 19 днів тому +3

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

  • @FujiLivz
    @FujiLivz 20 днів тому

    I wish I could get as excited about anything at all the way you get excited for typescript. Great video, the passion comes through on this one ^^

  • @fantastic2503
    @fantastic2503 21 день тому +98

    At this point, just make JavaScript strongly typed

    • @somenameidk5278
      @somenameidk5278 21 день тому +16

      I wonder how much performance you could gain by doing that

    • @orionh5535
      @orionh5535 21 день тому +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 21 день тому

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

    • @Xemmness
      @Xemmness 21 день тому +28

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

    • @Leonhart_93
      @Leonhart_93 21 день тому +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.

  • @OneOfThePetes
    @OneOfThePetes 20 днів тому +3

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

  • @matthewbramer7654
    @matthewbramer7654 20 днів тому +2

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

  • @domthefounder
    @domthefounder 21 день тому +4

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

    • @epajarjestys9981
      @epajarjestys9981 20 днів тому +4

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

    • @ArnoldsKtm
      @ArnoldsKtm 10 днів тому +1

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

  • @ericlindell3777
    @ericlindell3777 20 днів тому

    Love these ts release note walkthroughs!

  • @FeckOffTeaCup
    @FeckOffTeaCup 21 день тому +6

    Bird is bird, but is bird the word?

  • @cyan2048
    @cyan2048 20 днів тому +1

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

  • @kris-lq4rw
    @kris-lq4rw 21 день тому +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 21 день тому +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 21 день тому

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

  • @Imaginativeone_DF
    @Imaginativeone_DF 21 день тому

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

  • @hamodeyDooba
    @hamodeyDooba 20 днів тому

    Mate deserve some support in his channel.
    thanks Theo

  • @ignrey
    @ignrey 20 днів тому +1

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

  • @ghandn
    @ghandn 20 днів тому +1

    “All birds aren’t real” loved it 😂

  • @mykole.
    @mykole. 20 днів тому +1

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

  • @Xemmness
    @Xemmness 21 день тому +3

    still no throws keyword feelsbadman

  • @anon_y_mousse
    @anon_y_mousse 20 днів тому

    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.

  • @yiannis_p
    @yiannis_p 21 день тому

    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!

  • @Lars16
    @Lars16 20 днів тому +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.

  • @abbyh5158
    @abbyh5158 19 днів тому

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

  • @gkumartube
    @gkumartube 21 день тому

    Thanks

  • @berridgeab
    @berridgeab 20 днів тому +1

    Everyone knows that bird === theWord.

  • @ordazgustavo
    @ordazgustavo 20 днів тому

    here comes the return type annotation war again

  • @WilliamWelsh
    @WilliamWelsh 20 днів тому +1

    not filtering out undefined is one of the most annoying errors

  • @deerawj
    @deerawj 21 день тому +2

    Too much Bird

  • @professormikeoxlong
    @professormikeoxlong 20 днів тому +2

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

  • @thatscute973
    @thatscute973 19 днів тому

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

  • @orionh5535
    @orionh5535 21 день тому +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 ;_;

  • @wintercounter2
    @wintercounter2 21 день тому

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

  • @squishy-tomato
    @squishy-tomato 19 днів тому

    I just dropped by to see what TS was shipping, and I'm leaving happy for not having to use it.
    It seems like a well-intentioned language that inherits a lot of garbage from JS and has to implement tens of workarounds because of that.

  • @fakedevdutt
    @fakedevdutt 20 днів тому

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

  • @pierwszywolnynick
    @pierwszywolnynick 19 днів тому

    bird is a word

  • @cerulity32k
    @cerulity32k 11 днів тому

    wait this is cool af

  • @FrederikSchumacher
    @FrederikSchumacher 20 днів тому +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.

  • @MichaelKire
    @MichaelKire 20 днів тому

    2:00 FINALLY

  • @nullbeyondo
    @nullbeyondo 17 днів тому +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.

  • @Dude29
    @Dude29 20 днів тому

    That viewer was right, this shit should have been 5.0

  • @akam9919
    @akam9919 20 днів тому

    This MS whistleblower must be protected at all costs.

  • @shapelessed
    @shapelessed 21 день тому

    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...

  • @izzy6865
    @izzy6865 21 день тому

    All I want is project wide type checking 😥

  • @anasouardini
    @anasouardini 20 днів тому

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

  • @kungfooman
    @kungfooman 17 днів тому

    Was about time to fix basic errors like ESM resolution lol

  • @KristianTheDesigner
    @KristianTheDesigner 19 днів тому

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

  • @Matt23488
    @Matt23488 21 день тому

    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 20 днів тому

      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.

  • @benheidemann3836
    @benheidemann3836 20 днів тому +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? 😩

  • @Bobbias
    @Bobbias 20 днів тому +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 10 днів тому

      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.

  • @manomancan
    @manomancan 21 день тому +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 21 день тому

      "The biggest TS update in years"

    • @t3dotgg
      @t3dotgg  21 день тому +6

      Because I make videos the length I want to :)

    • @diadetediotedio6918
      @diadetediotedio6918 21 день тому

      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 20 днів тому +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 20 днів тому +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.

  • @ericjbowman1708
    @ericjbowman1708 21 день тому +2

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

    • @JerehmiaBoaz
      @JerehmiaBoaz 21 день тому +1

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

  • @Brymcon
    @Brymcon 20 днів тому

    It's big. Python should have this. Undefined

  • @kristianlavigne8270
    @kristianlavigne8270 20 днів тому

    Larry Bird 🐦

  • @ojaskavathe
    @ojaskavathe 21 день тому

    bird

  • @marwellus1
    @marwellus1 21 день тому +1

    All hail the bird: ua-cam.com/video/9Gc4QTqslN4/v-deo.html

  • @James666Brown
    @James666Brown 20 днів тому

    It's pronounced REJular expression

  • @jordanmancini
    @jordanmancini 20 днів тому

    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 20 днів тому

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

    • @bereck7735
      @bereck7735 10 днів тому

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

  • @seeibe
    @seeibe 19 днів тому

    Oh yeah that filter thing was so annoying. Nice!

  • @ckpioo
    @ckpioo 9 днів тому

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

  • @eslachance
    @eslachance 21 день тому

    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 20 днів тому

      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".

  • @skitzskr
    @skitzskr 18 днів тому

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

  • @nikensss
    @nikensss 21 день тому

    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 21 день тому

      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.

  • @matej254sk
    @matej254sk 21 день тому

    strick: false

  • @Vemu
    @Vemu 21 день тому +14

    JS is still years behind other languages.

    • @jackdanielson1997
      @jackdanielson1997 21 день тому +1

      How so?

    • @vitosnatios
      @vitosnatios 21 день тому

      not in libs tho

    • @majutsush1
      @majutsush1 21 день тому +3

      refuses to elaborate

    • @greyshopleskin2315
      @greyshopleskin2315 21 день тому

      @@vitosnatiosexample?

    • @themprsndev
      @themprsndev 21 день тому +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

  • @okoiful
    @okoiful 20 днів тому

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

  • @Emin4egg
    @Emin4egg 20 днів тому

    How annoying these antics on the preview

  • @MinecraftHV
    @MinecraftHV 21 день тому +1

    First🎉

  • @paca3107
    @paca3107 20 днів тому +1

    honestly I dont care

  • @vcankeklik
    @vcankeklik 21 день тому

    can we please deprecate TypeScript altogether?

    • @th3n3rdman
      @th3n3rdman 21 день тому

      Why?

    • @diadetediotedio6918
      @diadetediotedio6918 21 день тому +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 19 днів тому

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

  • @user-jd7ub3tq2b
    @user-jd7ub3tq2b 13 днів тому

    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

  • @stevenstark-com
    @stevenstark-com 20 днів тому

    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!

  • @AntonioBrandao
    @AntonioBrandao 20 днів тому +1

    Cringe thumbnail

  • @aakarshan4644
    @aakarshan4644 20 днів тому

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

  • @precumming
    @precumming 17 днів тому

    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

  • @atxorsatti
    @atxorsatti 20 днів тому

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