It FINALLY happened
2:45
14 күн бұрын
Going weirdly deep on console.log
1:14
TypeScript 5.5 is a BANGER
9:16
7 ай бұрын
Everyone's talking about gql.tada
5:06
Declaring globals isn't that hard
3:50
The TSConfig Cheat Sheet
5:36
Жыл бұрын
'.js' files in TypeScript - why?!
3:16
TypeScript 5.3 First Look
6:25
Жыл бұрын
Everyone's talking about Valibot
4:42
Fix your useRefs with ElementRef
2:10
Will this code error?
1:56
Жыл бұрын
Пікірлер
@jenewland1999
@jenewland1999 14 сағат бұрын
Ths is awesome! Do you think you'll update your tsconfig package once TS 5.8 is generally available?
@timothyshiu2263
@timothyshiu2263 18 сағат бұрын
Amazing! Can one use the open source Deepseek?
@studiowebselect
@studiowebselect 18 сағат бұрын
i havent try with Deepseek with api, but you can install it with ollama. So you should be able to use the API. I just dont know for the <think> section and structured output.
@Nurof3n_
@Nurof3n_ 18 сағат бұрын
YESSSSSSSSSSSSS!!!!!!!!
@uthpalax
@uthpalax 19 сағат бұрын
Amazing tutorial. Thank you very much
@mohammadfallah3656
@mohammadfallah3656 21 сағат бұрын
Awesome
@maximilian0987654321
@maximilian0987654321 23 сағат бұрын
Thanks for this fantastic tutorial!
@hasst9261
@hasst9261 23 сағат бұрын
Thanks a lot
@alvingultiano7513
@alvingultiano7513 Күн бұрын
Do you accept apprentice ? master
@orterves
@orterves Күн бұрын
I want to default to using type but the bloody linter whinges and I'm not allowed to disable it
@orterves
@orterves Күн бұрын
Typescript, the only language where a simple keyword like enum is a pitfall and beginners are encouraged to create weird boilerplate in its place. And yet enum seems to work fine and the weird boilerplate throws syntax warnings.
@mattpocockuk
@mattpocockuk Күн бұрын
Lol TONS of languages have pitfalls a lot worse than enum
@orterves
@orterves Күн бұрын
@mattpocockuk yes but people don't pretend they are good But I read more about it and there's nothing actually wrong with typescript enums as long as they have a string definition, so that's cool
@LauriePoulter
@LauriePoulter Күн бұрын
What does structured data do if it can't find what are you ask it in the data? Would happens for instance if you pass it a blank invoice in your example, will it hallucinate?
@mattpocockuk
@mattpocockuk Күн бұрын
Great question! I'll think about that for the course.
@studiowebselect
@studiowebselect 18 сағат бұрын
You can make optional some field. So it wont fill when he dont find the value. Else, yes, it can hallucinate a lot. llama vision 3.2 hallucinate a lot more than chat gpt 4o
@w01dnick
@w01dnick Күн бұрын
Don't like it. There are constructive code generations. While enums (in TS) and namespaces aren't constructive, constructor parameters are. Also wish we had type to code generation, something like type MyType = 'foo' | 'bar'; let x: MyType; if (element.dataset.id in MyType) x = element.dataset.id; Because manually writing element.dataset.id === 'foo' || ... Is tiresome and error prone when you extend MyType later.
@dkazmer2
@dkazmer2 Күн бұрын
2 questions: What's wrong with that third example? And what is meant by "erasable"?
@kakschoen
@kakschoen Күн бұрын
Erasable means it can be stripped at runtime. Non-erasable typing actually affects how your code behaves, erasable typing is only visible to the developer/typescript compiler. Enums are non-erasable, as code gets generated in its place; they're a form of syntactic sugar.
@dkazmer2
@dkazmer2 Күн бұрын
@@kakschoen that was clear, thanks! I think they get stripped at compile time, though, no?
@mattpocockuk
@mattpocockuk Күн бұрын
Enums do not get stripped, they get compiled into a different form.
@dkazmer2
@dkazmer2 17 сағат бұрын
@@mattpocockuk makes sense now, thanks! Shoulda been calling "strippable..."
@NaR00W
@NaR00W Күн бұрын
Wtf I’m no longer a wizard?
@mattpocockuk
@mattpocockuk Күн бұрын
Everyone else got the normal greeting
@jelloace3097
@jelloace3097 Күн бұрын
You should probably explain what's the problem with enums and namespace rather than just calling them weird. I still don't understand what this flag for tbh. If you opt to disable, then what's the alternative?
@arvendrell
@arvendrell Күн бұрын
Hey Matt, do you know if it possible to work with a custom REST API instead of using any already integrated LLM? I am able to save the info, but do not see the stream response withouth refreshing the page. Thank you
@ZigaKrasovec
@ZigaKrasovec Күн бұрын
The image that you used for the imageUrl example is Lake Bled, Slovenia 🇸🇮 10mins away from my home town!
@ZigaKrasovec
@ZigaKrasovec Күн бұрын
🤦‍♂should have watched the next 5s of the video before posting the comment, of course LLM describe it for you lol
@mattpocockuk
@mattpocockuk Күн бұрын
Absolutely wild!
@thephoenixstudio
@thephoenixstudio Күн бұрын
Eh, enums are more readable, dont accept bare strings, and dont require 3 steps to create. So ill stick to them.
@2mbst1
@2mbst1 Күн бұрын
The link to the PR in the description needn’t and shouldn’t point to x, instead it should point to the PR directly.
@mattpocockuk
@mattpocockuk Күн бұрын
It should! Fixed.
@2mbst1
@2mbst1 13 сағат бұрын
@@mattpocockuk 💙🙏
@edgeeffect
@edgeeffect Күн бұрын
Nom! Nom! Nom! Very tasty! 🏁🏁🏁🏁🏁🏁🏁 😃
@jazzdestructor
@jazzdestructor Күн бұрын
nice wanted something like this as making agents with js was a pain. I am gonna try more stuff out, thanks a lot Matt
@Tommy-eu2fb
@Tommy-eu2fb 2 күн бұрын
1:20 Eeek I'm excited.. Need a weekend when I'm not going away to indulge in this!
@johnconnor9787
@johnconnor9787 2 күн бұрын
Why everyone says that enums are odd? Why exactly? Or it is just so.e tradition not to like it?
@pavolhejny
@pavolhejny 2 күн бұрын
For me enums, namespaces (and modules + references) are obvious nonos from day 0, but private and protected properties seems good practice to use together with _ prefix. Or am I somewhere wrong?
@mattpocockuk
@mattpocockuk Күн бұрын
Yes, private and protected properties are not going away - just the automatic assignation in the constructor.
@pavolhejny
@pavolhejny Күн бұрын
@mattpocockuk Yeah I know but still are they really bad practice to use? In your code, do you do this implicit assignment or assign values explicitly in the body of the constructors?
@pavolhejny
@pavolhejny Күн бұрын
@mattpocockuk `public` vs. `Object.assign` - This is a minor thing but underlying a major tradeoff: In my company, codebase readability is probably worth more than direct portability across the runtimes and configurations, or do you think that it is the other way?
@mattpocockuk
@mattpocockuk Күн бұрын
@ I assign values explicitly. And I don't understand why you're comparing public and Object.assign - they feel unrelated to me.
@duytdl
@duytdl 2 күн бұрын
Why didn't Node implement it though? Too hard or do they not like it?
@mattpocockuk
@mattpocockuk 2 күн бұрын
Because: - You need to ship source maps to make it work - It ties Node in somewhat to TypeScript's runtime syntax, which is not a dependency they want - especially when the TS themselves are signalling that it's not the future of TS.
@allan_archie
@allan_archie 2 күн бұрын
Why not just fix them?
@mattpocockuk
@mattpocockuk 2 күн бұрын
Sure, go for it
@aaronmorgan4466
@aaronmorgan4466 2 күн бұрын
Wasn't sure what your problem with enums is, I like them, particularly as semantic keys. But, I went and found your video on enums, as const from now on.
@zakir.nuriiev
@zakir.nuriiev 2 күн бұрын
What is the problem with enums?
@twigsagan3857
@twigsagan3857 Күн бұрын
It seems they dislike that those are checked runtime. But I have the same question. Because to me it is more important write clean code with the tools a language gives me than how the language supports such a feature.
@zakir.nuriiev
@zakir.nuriiev Күн бұрын
@twigsagan3857 Agree 👍
@zardify_
@zardify_ 22 сағат бұрын
​@twigsagan3857 same. And I think all of this is mostly about Node, and NOT browser. TypeScript doesn't really do anything at runtime in a browser... it's transpiled...
@Dxpress_
@Dxpress_ 17 сағат бұрын
I guess partly it's because union types exist that can do the same thing without any extra syntax overhead, while also still having intellisense capabilities. Sometimes enums can also be transpiled differently depending on how they're written. I can't remember exactly, but say if you wanted to get all the values of an enum type via Object.values(), it will return essentially the same values twice, but with the keys and values swapped. Something like: { 1: "ValueA", 2: "ValueB", "ValueA": 1, "ValueB": 2 }
@Felipe-53
@Felipe-53 2 күн бұрын
Your content is great, my friend. Thanks!
@TactileNoseButton
@TactileNoseButton 2 күн бұрын
Javascript is the weirdest language ever made. I still don't get how this mess has become the world standard for Web.
@ruimarcosjoao
@ruimarcosjoao 2 күн бұрын
very cool
@orderandchaos_at_work
@orderandchaos_at_work 2 күн бұрын
Great, now each and every dev can write their personal style of enums all over the code base.
@billgrant7262
@billgrant7262 2 күн бұрын
what bizzaro world is this? everyone wishes they had enums in languages that dont
@robertsandiford6223
@robertsandiford6223 2 күн бұрын
TypeScript is not a language, it's a type checker, so it goes against the modern standard that TS shouldn't be involved in runtime issues. Also enums are a little weird. You can code a typesafe Enum equivalent if you really want, or get similar results with simple things like objects.
@akikadze
@akikadze 2 күн бұрын
You still have an enum alternative. Something like this should work: const myEnum = { value: "value", value2: "value2" ...} as const; type MyEnumType = typeof myEnum[keyof typeof myEnum];
@mattpocockuk
@mattpocockuk 2 күн бұрын
I'd love enums in JavaScript. But TS enums are odd.
@thephoenixstudio
@thephoenixstudio Күн бұрын
​@@akikadzeThat's a lot more work than an enum
@twigsagan3857
@twigsagan3857 Күн бұрын
​@@robertsandiford6223to me it is a language since I don't consider Javascript to be up to the task of scaling software. Typescript gives you options to keep you code clean. And it shouldn't matter from that perspective whether they do stuff runtime VS compile time. Enums make your code more stable.
@bergerblancsuisse.
@bergerblancsuisse. 2 күн бұрын
1:48 would be great if you could link to the videos or create an updated video regarding the alternatives, please :)
@anonymous2596
@anonymous2596 2 күн бұрын
Alfons Åberg's dad became a developer, that's crazy.
@georgehelyar
@georgehelyar 2 күн бұрын
Imagine how happy you could be if you removed all the TypeScript features... and JavaScript quirks... and used a better language instead.
@weirdwordcombo
@weirdwordcombo 2 күн бұрын
parameter properties was a great achievement of C#, like async/await also. typescript copied lots of features. these features are such a success because they are very intuitive, very much used and very anti-boilerplate. nodejs team seems not to understand. they can support it. but i guess they like a "clean" "no effort" type-strip solution. sad.
@DemanaJaire
@DemanaJaire 2 күн бұрын
I would love it if not the constructor thing. But I don't use classes, so I guess I'm okay with it.
@weirdwordcombo
@weirdwordcombo 2 күн бұрын
stop saying DTOs are bad in comments. I use tsyringe as DI container. massive boilerplate incoming if i use this flag I guess. horrible. classes are used for much more than DTOs. this is a major issue if you are forced to use nodejs with native typescript support I guess. nodejs should support transpilation plugins like babel.
@MarkWiemer
@MarkWiemer 2 күн бұрын
Good thing the flag is optional :)
@weirdwordcombo
@weirdwordcombo 2 күн бұрын
but those parameter properties are very useful, because they reduce the amount of code i have to write. without those I'd need to assign each property manually in the constructor. i would also have to keep property and parameter name in sync manually, because I like consistent naming. any thoughts? or am I wrong? how can I otherwise reduce work and boilerplate if not with parameter properties? if babel supports it with plugins, so should nodejs. no excuse.
@robertsandiford6223
@robertsandiford6223 2 күн бұрын
Why would node support something that isn't in the Ecma Script spec?
@weirdwordcombo
@weirdwordcombo 2 күн бұрын
@@robertsandiford6223 nodejs should adopt all TS feature because there are TS devs who use them and they want to use them when they switch to vanilla nodejs also. That is a very practical down to earth argument, would you agree? What point would strictly following ecma spec have in this case? I agree that nodejs JS should follow ecma spec because its JS. But nodejs TS should follow TS spec. These are 2 different things.
@robertsandiford6223
@robertsandiford6223 Күн бұрын
@@weirdwordcombo TS has moved away from runtime features as that would create a clash between TS runtime features and new features added to JS itself. E.g. JS may one day have its own enums. We're not going to see further development of TS runtime features and support for them.
@omri9325
@omri9325 2 күн бұрын
This flag is like a deprecation for the non-eraseable syntax :)
@лилпипка
@лилпипка 2 күн бұрын
I wonder what will happen to using keyword now, they've added it not that far ago
@mattpocockuk
@mattpocockuk 2 күн бұрын
It's a JavaScript feature, so no need to erase it
@TheSublimeIbanez
@TheSublimeIbanez 2 күн бұрын
I wholly disagree with your perspective on this and the potential (extreme) edgecases aren't anywhere near enough of a deterrent for me. Furthermore, Enum.Key is very useful syntax and avoids maintenance issues down the line of "Where are they getting that value?" if you're passing in strings. Explication is a good thing and enums can provide that to some degree whereas raw JS struggles to.
@snatvb
@snatvb 2 күн бұрын
class constructor properties is really good :( enums bad, yep
@adnan7698
@adnan7698 2 күн бұрын
Rooter
@dasten123
@dasten123 2 күн бұрын
idk how I feel about this... I think it's more the job of a linter to enforce things like that, isn't it?
@dasten123
@dasten123 2 күн бұрын
but the class parameter properties thing is awesome, though
@8_ball_z
@8_ball_z 2 күн бұрын
lol! so cool
@rodrigonovais9624
@rodrigonovais9624 2 күн бұрын
So, Node, after more than a decade of existence decided will implement typescript but doesn't, so to fix it, typescript itself changes Wouldn't it be better to, ACTUALLY implement typescript instead of just rename the extensions form "ts" to "js" and pretend everything is fine?
@mattpocockuk
@mattpocockuk 2 күн бұрын
No, because I think everyone involved (Node and TS team) see this as a possible sea change moment to get rid of some features that they're not interested in supporting. TS's future is as JS + Types, not as its own language with runtime features.
@rodrigonovais9624
@rodrigonovais9624 2 күн бұрын
@mattpocockuk isn't it called JSDocs?
@ShinigamiZone
@ShinigamiZone 2 күн бұрын
FINALLY!