The Biggest TypeScript Update In Years

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ธ.ค. 2024

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

  • @MrManafon
    @MrManafon 6 หลายเดือนก่อน +240

    year 99 of Hoping for pattern matching and curried pipe chains

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

      I would give my soul for if expressions

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

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

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

      Try ts-pattern

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

      Who is also the Rx lover ?😊

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

      I use ts-pattern, it does the job 👍

  • @RogerClotet
    @RogerClotet 6 หลายเดือนก่อน +188

    Finally someone acknowledges birds aren't real.

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

      Everybody knows that the bird is the word

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

      People are waking up.

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

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

    • @goosybs
      @goosybs 6 หลายเดือนก่อน +1

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

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

      yes, they are all dinosaurs!

  • @HuntingKingYT
    @HuntingKingYT 6 หลายเดือนก่อน +13

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

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

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

  • @MichiganTypeScript
    @MichiganTypeScript 6 หลายเดือนก่อน +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 6 หลายเดือนก่อน +1

      Heck yes! Looking forward to it!

    • @MichiganTypeScript
      @MichiganTypeScript 6 หลายเดือนก่อน +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 6 หลายเดือนก่อน +1

      hell yessss ❤

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

      update: it's live!

  • @orionh5535
    @orionh5535 6 หลายเดือนก่อน +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 6 หลายเดือนก่อน +5

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

  • @guilhermeraposo6080
    @guilhermeraposo6080 6 หลายเดือนก่อน +121

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

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

      const isBirdReal = false;

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

      return false as NoFlyLikeAnEagle

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

      GetCategory("bird");
      > undefined

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

      Error: "bird" is defined but never used

    • @brodacious1313
      @brodacious1313 6 หลายเดือนก่อน +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.

  • @Lars16
    @Lars16 6 หลายเดือนก่อน +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 6 หลายเดือนก่อน

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

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

      The typical React developer 🤷‍♂️

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

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

  • @hidoryy
    @hidoryy 6 หลายเดือนก่อน +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 6 หลายเดือนก่อน +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 6 หลายเดือนก่อน +3

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

  • @MrManafon
    @MrManafon 6 หลายเดือนก่อน +28

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

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

      He very much doesn't work on t3

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

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

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

    Mate deserve some support in his channel.
    thanks Theo

  • @DomGarzaSR
    @DomGarzaSR 6 หลายเดือนก่อน +4

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

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

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

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

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

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

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

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

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

  • @bagfleet
    @bagfleet 6 หลายเดือนก่อน

    Love these ts release note walkthroughs!

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

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

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

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

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

    Bird is bird, but is bird the word?

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

    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.

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

    “All birds aren’t real” loved it 😂

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

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

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

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

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

    still no throws keyword feelsbadman

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

    At this point, just make JavaScript strongly typed

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

      I wonder how much performance you could gain by doing that

    • @orionh5535
      @orionh5535 6 หลายเดือนก่อน +30

      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 6 หลายเดือนก่อน

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

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

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

    • @Leonhart_93
      @Leonhart_93 6 หลายเดือนก่อน +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.

  • @nullbeyondo
    @nullbeyondo 6 หลายเดือนก่อน +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 6 หลายเดือนก่อน

    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!

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

    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

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

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

  • @kris-lq4rw
    @kris-lq4rw 6 หลายเดือนก่อน +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 6 หลายเดือนก่อน +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 6 หลายเดือนก่อน

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

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

    Was about time to fix basic errors like ESM resolution lol

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

    Everyone knows that bird === theWord.

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

    not filtering out undefined is one of the most annoying errors

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

    here comes the return type annotation war again

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

    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 6 หลายเดือนก่อน

      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.

  • @Bobbias
    @Bobbias 6 หลายเดือนก่อน +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 6 หลายเดือนก่อน

      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.

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

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

  • @benheidemann3836
    @benheidemann3836 6 หลายเดือนก่อน +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 6 หลายเดือนก่อน +1

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

  • @manomancan
    @manomancan 6 หลายเดือนก่อน +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 6 หลายเดือนก่อน

      "The biggest TS update in years"

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

      Because I make videos the length I want to :)

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

      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 6 หลายเดือนก่อน +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 6 หลายเดือนก่อน +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.

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

    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!

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

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

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

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

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

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

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

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

  • @vladimir_dev
    @vladimir_dev 15 วันที่ผ่านมา

    English is not my first language and for some reason pronouncing regex as "rejex" makes me think of the word "rejects" (even though the "re" part is different) 😄

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

    2:00 FINALLY

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

    bird is a word

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

    That viewer was right, this shit should have been 5.0

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

    This MS whistleblower must be protected at all costs.

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

    All I want is project wide type checking 😥

  • @orionh5535
    @orionh5535 6 หลายเดือนก่อน +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 ;_;

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

    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 6 หลายเดือนก่อน

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

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

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

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

    wait this is cool af

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

    It's big. Python should have this. Undefined

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

    Too much Bird

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

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

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

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

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

    Larry Bird 🐦

  • @FrederikSchumacher
    @FrederikSchumacher 6 หลายเดือนก่อน +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.

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

    It's pronounced REJular expression

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

    Thanks

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

    Oh yeah that filter thing was so annoying. Nice!

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

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

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

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

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

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

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

    bird

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

    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 6 หลายเดือนก่อน

      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 6 หลายเดือนก่อน

    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 6 หลายเดือนก่อน

      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 6 หลายเดือนก่อน

    strick: false

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

    How annoying these antics on the preview

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

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

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

    honestly I dont care

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

    Cringe thumbnail

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

    JS is still years behind other languages.

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

      How so?

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

      not in libs tho

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

      refuses to elaborate

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

      @@vitosnatiosexample?

    • @Bchvji647
      @Bchvji647 6 หลายเดือนก่อน +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

  • @Николай-г5т6ч
    @Николай-г5т6ч 6 หลายเดือนก่อน

    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

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

    First🎉

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

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

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

    can we please deprecate TypeScript altogether?

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

      Why?

    • @diadetediotedio6918
      @diadetediotedio6918 6 หลายเดือนก่อน +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 6 หลายเดือนก่อน

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

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

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