Facebook wrote a language just for React (it's pretty cool)

Поделиться
HTML-код
  • Опубликовано: 8 апр 2024
  • I know Flow isn't exactly cool, but these changes absolutely are. TypeScript may not adopt them but let a dev have some hope.
    SOURCES
    / announcing-component-s...
    Check out my Twitch, Twitter, Discord more at t3.gg
    S/O Ph4se0n3 for the awesome edit 🙏
  • НаукаНаука

Комментарии • 251

  • @vcankeklik
    @vcankeklik Месяц назад +568

    Why don't you guys write a browser and even a new OS for React? That would be so Meta...

    • @ArcticPrimal
      @ArcticPrimal Месяц назад +29

      A browser that truly, fully doesn't cache anything when you disable caching would be great. There have been many instances when you save, and no changes are reflected

    • @vcankeklik
      @vcankeklik Месяц назад +6

      ​@@ArcticPrimal Probably not happening soon, maybe a "VDOM is dead" article instead?

    • @kanbekan
      @kanbekan Месяц назад +10

      But there's ReactOS already...

    • @vcankeklik
      @vcankeklik Месяц назад +3

      @@kanbekan and it looks good

    • @kasper369
      @kasper369 Месяц назад +4

      its all fun and games until some one does it

  • @wlockuz4467
    @wlockuz4467 Месяц назад +158

    We have put a bandaid on the bandaid that was supposed to stop the bleeding from the previous bandaid so that you don't have to put more baindaids yourself over the bandaids you already have put.

    • @SamualN
      @SamualN Месяц назад +3

      this is how engineering works in every industry

    • @terjeber
      @terjeber Месяц назад +2

      Meta is the only company I know that thinks that you can fix a decapitation with bandaids.

    • @salvimateus
      @salvimateus Месяц назад +2

      hater detected

  • @dstick14
    @dstick14 Месяц назад +52

    Prime is foaming at the mouth right now

  • @everyhandletaken
    @everyhandletaken Месяц назад +104

    I don't know how to react

    • @theblackquill5921
      @theblackquill5921 Месяц назад +35

      go with the flow

    • @MikeMonji
      @MikeMonji Месяц назад

      @@theblackquill5921 am sure TypeScript will "render" flow useless

    • @victor38542
      @victor38542 Месяц назад

      @@theblackquill5921 not my type

    • @soyitiel
      @soyitiel Месяц назад +18

      just don't get too hooked on it

    • @R0cky0
      @R0cky0 Месяц назад +6

      Let's all remix!

  • @gavr_sas
    @gavr_sas Месяц назад +55

    Btw there is rescript, that has the same type system as Flow (H-M type inference, sound)

    • @Nellak2011
      @Nellak2011 Месяц назад

      Exactly!

    • @SamualN
      @SamualN Месяц назад +3

      hindley-milner my beloved

    • @NamanGoel34
      @NamanGoel34 Месяц назад

      It’s not the same type system. It’s a Hindley-Milner type system. It’s safer but also much more constrained. No true unions for example.

    • @_trepz
      @_trepz Месяц назад +2

      Rescript was the thing that convinced me to try react (when it was ReasonML+ReasonReact), it's just a javascript skin for OCaml with nice react bindings, was enjoyable to write but I don't know why they didn't go in on it harder. I remember reading they were refactoring the messenger frontend into it, but then not much since then.

  • @ryry79261
    @ryry79261 Месяц назад +2

    It's so nice to have this information explained quickly, concisely, without too much decoration. I've been in front end over a decade now, and I'm annoyed I haven't found this channel sooner.

    • @happyjohn1656
      @happyjohn1656 Месяц назад +2

      All he's doing is reading the article lol

    • @ryry79261
      @ryry79261 Месяц назад +1

      @@happyjohn1656 and talking around the points of the article with context.

  • @PhilipAlexanderHassialis
    @PhilipAlexanderHassialis Месяц назад +35

    Typescript is a general purpose language that transpiles to JS. It's not made (nor should it) obey the whims of a specific community or the perceived needs of any library, however popular it is. Also also, "I want this, I want this now", sure, move fast and break things but we are now past a certain point of maturity in frontend development, where React and Typescript are the Java of frontend. You have to move carefully in very small very unobtrusive steps.

    • @angeloceccato
      @angeloceccato Месяц назад

      Then, Typescript is not React... flow yes....

    • @benheidemann3836
      @benheidemann3836 Месяц назад

      The latter point is more true of TypeScript than React. React is very replaceable, TypeScript (currently) has no real competition.

    • @benheidemann3836
      @benheidemann3836 Месяц назад +1

      What would you think about upstreaming something like ts-patch to allow frameworks to move fast and add the language features they need on top of typescript without impacting TS?

  • @farzadmf
    @farzadmf Месяц назад +48

    I personally think that Typescript helped React have more momentum, and the nice thing about React is (was?) that you could use a "normal" language you already know to work with it. If it goes with the route of a custom language, then it becomes a burden to work with it.

    • @eldarshamukhamedov4521
      @eldarshamukhamedov4521 Месяц назад +9

      React already heavily relies on JSX, which is either a different language, or an extension to JS, depending on how you look at it. Facebook experimenting with JS syntax is not new

    • @deadchannel8431
      @deadchannel8431 Месяц назад +7

      It just gives you better linting. The new syntax is like two extra keywords

    • @xorlop
      @xorlop Месяц назад

      @@deadchannel8431 plus new rules for how you call and use the function… you now have to context and know that this component keyword pre-processes your props and turns it into an object. I am not sure *another* way to call functions is a good idea, especially when it is not clear that this component keyword is doing all that magic.

    • @dashingammar9747
      @dashingammar9747 Месяц назад

      Jsx is just like html​@@eldarshamukhamedov4521

    • @d3fau1thmph
      @d3fau1thmph Месяц назад +2

      GOOD! Fewer people will use this crap.

  • @hecate6834
    @hecate6834 Месяц назад +10

    Didn't they already do that before with ReasonML or ReScript don't remember, might have just been the guy who made React not sure

  • @NestorCustodio
    @NestorCustodio Месяц назад +26

    When your framework is *so* convoluted and requires *so* much code to get working that you end up creating *two whole languages* to make it more palatable. 🤦

    • @soyitiel
      @soyitiel Месяц назад +1

      asm & C?

    • @saintgalgo
      @saintgalgo Месяц назад +1

      this is such a weird thing to complain about. most frameworks have some kind of dsl

    • @NestorCustodio
      @NestorCustodio Месяц назад

      @@saintgalgo That's fair, but not all frameworks that introduce a DSL do so in a way that requires an intermediate transpilation step. Many just leverage the already existing syntax to create helpers and/or abstractions without turning your code into something else entirely.

  • @user-qq7yc1qp8z
    @user-qq7yc1qp8z Месяц назад +49

    I've been working for a 5 years now, on a front end it seems like we have 10 new different ways to do the same fucking thing each year. That's why I work as a backend engineer now, I'm tired to learn new framework every half a year.

    • @tempestalle
      @tempestalle Месяц назад +3

      you mean learn new framework every two months

    • @SamualN
      @SamualN Месяц назад +10

      literally every industry has this "issue". you will not escape this "problem" by switching to backend. it's not even a problem. nobody's asking you to learn every new framework. employers to this day are still asking for php and python experience.

    • @fionnbracken
      @fionnbracken Месяц назад

      Unless you work at Facebook you don't need to learn this.

    • @scottpageusmc
      @scottpageusmc Месяц назад +3

      That's called competition and it's a part of life no matter the industry.
      Without it we wouldn't have a choice and would be stuck with one really bad product to choose from.
      I've been programming since 1986, and know that it can be frustrating having so many choices, but we're not forced into using all of them. Just pick one and stick with it.

    • @cyrus01337
      @cyrus01337 Месяц назад

      Do you, just know you were never forced into it.

  • @lunarwitch1967
    @lunarwitch1967 Месяц назад

    funny thing is that the recommended way of starting with react is by using a framework built on top of it like nextjs, yet there's not a word about flow in next's docs

  • @MrGarkin
    @MrGarkin Месяц назад +1

    Are ts compiler plugins (a la babeljs) a thing in current timeline?
    I remember there was couple issues about it. Mostly because of stalled Ecmascript committee features.
    This would fit like a glove.

  • @keithjohnson6510
    @keithjohnson6510 Месяц назад +4

    Someone in your chat log said "What if you want to use prop type as a whole?"..
    Your response was, but it's not something you do a lot.. But it's still very handy-> things like -> `ColorProp`, `DatasourceProps`, very handy to keep components consistent.
    eg. props: ColorProps & DatasourceProps. For very large apps having consistent prop types & names is very useful. I just destructure the props on the first line, const {color, datasource} = props; to save doing "props.color" etc, also having props is handy for prop drilling anyway, (but I try to avoid, if they get deep).

    • @untlsn
      @untlsn Месяц назад

      I think that props.color is more readable, because in longer components you know that props.color is from parent

    • @adtc
      @adtc Месяц назад

      @@untlsn It shouldn't be necessary to know whether `color` comes from parent, or from somewhere else (like a data fetch), or it's a local variable. The code of the component should behave the same regardless of the source of its value. It's also much easier to refactor when you want to change the source.

    • @untlsn
      @untlsn Месяц назад

      @@adtc I tell it from my experience. When I see wrong data on page and >{props.someValue}< in code, I know that issue is not in this component but in parent immediately

    • @keithjohnson6510
      @keithjohnson6510 Месяц назад

      @@untlsn Object destructuring , or any other code shortcuts do indeed need to be used with care. Sometimes like you say that extra dot notation can give extra context, as a coder that's something you need to decide.

  • @gnaarW
    @gnaarW Месяц назад +70

    seeing as Facebook tabs regularly take >2gigs of RAM I shall skip this video. thanks.

    • @hoaisan9540
      @hoaisan9540 Месяц назад +8

      and it freezes every time until you decide to reload the page, huge downfall since they introduced e2e encrypted messages

    • @chervilious
      @chervilious Месяц назад +4

      How is it 2GB? I haven't opened facebook in a while but it only takes 36.7MB even after opening multiple chat and scrolling down a bit. A fresh youtube page use 219MB and this youtube as of this writing takes 500+ MB

    • @TheGusMP
      @TheGusMP Месяц назад

      Facebook uses PHP

    • @korigamik
      @korigamik Месяц назад +4

      WhatsApp web is shit

    • @n-0-1
      @n-0-1 Месяц назад +3

      ​@@cherviliousyeah, he's either getting hacked, or exaggerating.

  • @gustavbw
    @gustavbw Месяц назад +1

    5:50 ->, thats y you always define an interface so that you can break it out like this "export default function HomeScreen({var1, var2, var3}: INTERFACE)" and make it so much nicer

  • @Jamiered18
    @Jamiered18 Месяц назад

    Pretty cool. Certainly cuts down on the excess syntax and is clearer. The `renders` keyword is something sorely missing. Though the rest of it is pretty much already handled by the rules of React ESLint package elsewhere

  • @danieljanjanocha7178
    @danieljanjanocha7178 Месяц назад

    7:39 it looks like comparing function that takes object as only parametr vs function that takes multiple parameters. What if I want to pass 3 parameters that are all strings? Imo the first one is always easier to work with because when invoking the function (or rendering the component) I just open curly braces and see autocomplete and see what qre the props names instead of thinking "should I put userId, transactionId or other string first?"

  • @AdamM
    @AdamM Месяц назад +5

    Big problem with Flow is searching up anything about it. What a horrible name for SEO.

    • @HappyCheeryChap
      @HappyCheeryChap Месяц назад +4

      I'm constantly amazed at the poor names chosen re searchability for all software and libs etc. surprising how little thought people seem to put into that.
      "Go" was especially ridiculous, given it came from a Google employee.

    • @AdamM
      @AdamM Месяц назад

      @@HappyCheeryChap at least Go you can search Golang and get good results.

    • @anon_y_mousse
      @anon_y_mousse Месяц назад +1

      @@HappyCheeryChap Only makes it worse that a Go language had already existed before they created theirs too. The first Go developer tried to sue Google and because his was more of a DSL he lost, but I wish he had won and they'd used another name.

  • @xorlop
    @xorlop Месяц назад +2

    one of the advantages of the prop-based methods was that order does not matter. now, it looks like order might matter, so that kind of sucks

    • @DubiousNachos
      @DubiousNachos Месяц назад +2

      From what I can tell, the order still doesn't matter, but the fact that things are basically the same just isn't obvious
      When you have a component declaration, you pass the arguments in like traditional order-based arguments for functions, but that gets compiled down to an object and name-based arguments/props
      I think it's a really bad idea. React devs are already used to doing things one way, so to not only break from that, but also add ambiguity around how the declaration even works isn't worth saving a handful of characters

  • @thkhabhaii2217
    @thkhabhaii2217 Месяц назад +3

    Fun fact. No matter how many frameworks or languages are created for writing clean code and easy to read code most of the startups I worked for write shitty code that is disgusting and very hard to understand. Doing stupid things such aa declaring multiple components in one fuckin componets, creating context with fuckin createElement , no seperation of concerns putting everything in one big fuckin .js file , not following proper folder structure , horrible variable naming, hooks, components and the list goes on. Frontend is pain in the ass especially if you work for a shitty company that pays bare minimum to survive. 😪

    • @CIBI
      @CIBI Месяц назад +2

      I agree buddy i accidentally opened the js file in my office it's larger than 30k lines(angular) ...

    • @untlsn
      @untlsn Месяц назад

      Many components in one file is not bad when components are small and connected (e.g component and it's wrapper)
      But yes when file have over 200 lines we should split it

    • @thkhabhaii2217
      @thkhabhaii2217 Месяц назад

      @@untlsn That's acceptable but they put all related components in one place making it big and hard to understand.

    • @joeportnoy-qh9en
      @joeportnoy-qh9en Месяц назад +1

      the issue is that there are too many ways to do things in javascript. i'm not a fan of elm, but we need a new language like that. where the language is designed around a specific pattern and also specifically designed to be used to build ui's. there are also too many dependencies and tooling you need to do anything in javascript. typescript is closer to a linter than a statically typed language. the whole ecosystem is like a band aid that's barely holding together. you can feel the clunkiness.

    • @thkhabhaii2217
      @thkhabhaii2217 Месяц назад

      @@joeportnoy-qh9en Yes. But the ecosystem is too vast to get replaced. So many are dependent on js and we cannot simply replace it soon. Typescript is more like a linter , you are definitely correct on this one. But companies can simply implement good practices and avoid writing shitty code , which I think even if we create a new language they wont implement, they just want to get things done.

  • @CarlosEstebanLopezJaramillo
    @CarlosEstebanLopezJaramillo Месяц назад

    The props thing is more tedious than you imagine, in Nrwl Nx, for some tools like StoryBook you need the props to be named "props", otherwise the tools can't find it and extract the props interface to generate StoryBook boilerplate based on that component, so in Nrwl Nx you need to destructure props inside the function body.

  • @reeceward5573
    @reeceward5573 Месяц назад +13

    I don't think TypeScript should include it BUT it would be cool if you could "extend" the compiler with these features

    • @luciascarlet
      @luciascarlet Месяц назад +1

      agreed; that'd also be immensely helpful for other frameworks that may want to introduce convenient syntax. TypeScript itself should remain general-purpose

    • @collinoly
      @collinoly Месяц назад

      It would be cool. But that sounds extremely difficult if not impossible

    • @reeceward5573
      @reeceward5573 Месяц назад

      @@collinoly babel exists

    • @untlsn
      @untlsn Месяц назад +1

      I think that native named args would be nice in typescript itself

    • @izzei-1614
      @izzei-1614 19 дней назад

      yeah and we will get React TS, Vue TS, Angular TS which will be different languages

  • @MrMassaraksh
    @MrMassaraksh Месяц назад

    And no one still fixed issue, when you open fb at mobile safari, through the some app, it throws an alert at your face.

  • @MrGarkin
    @MrGarkin Месяц назад

    Every framework could use domain specific language extension features.
    Expecially fullstack, something like TS extensions for NextJS.

  • @enesmalikterzi7086
    @enesmalikterzi7086 Месяц назад +1

    we should have stop at two way binding.

  • @zenpool
    @zenpool Месяц назад

    can we have a typescript syntax plugins just like babel had with js

  • @pasizdobrekuce
    @pasizdobrekuce Месяц назад

    One can do crazy (read nonsense) stuff when unlimited resources are available.

  • @theblackquill5921
    @theblackquill5921 Месяц назад +1

    "I want this in typescript and I want it in typescript now"

    • @theblackquill5921
      @theblackquill5921 Месяц назад

      also just convince them by giving them a cookie :)

  • @fricze
    @fricze Месяц назад +3

    If you're at the level of creating new language just for React, there's already ClojureScript, Elm, PureScript, and ReasonML. Creating another JavaScript-but-not-exactly just for React is silly. It also shows that Reacts' model, while cool, has the issue of JavaScript not being the best language to implement it.

    • @cyrus01337
      @cyrus01337 Месяц назад +1

      I wouldn't say JS is not the best language for React despite the many pitfalls in the language, it's more that React seems to be doing too much. Originally it was great to have HTML and JS in one file (and if you use Tailwind you get the whole package), now it's bastardised itself with great additions in theory that provide far too much mental overhead even when adjusting to it incrementally, and all forbid you do any of this in a large project.
      The problem seems to be less with the language and more with the framework, JS is already fast and React was fine since function components. Additions to this simply haevn't been helpful, though what this video covers is definitely implicitly useful for the ecosystem.

    • @fricze
      @fricze Месяц назад +2

      @@cyrus01337 Well, I still think it's not the bet language for React model and that's why React is fighting with JS.
      JS doesn't have immutable data (while Elm, ClojureScript, ReasonML, and PureScript do) so whole VDOM comparison process is not as performant as it could be with immutable data. JS doesn't have Algebraic Effects (or similar advanced flow-control primitives), so hooks are implemented in a "hacky" way, with special "rules of hooks" that you need to adhere to if you don't want to blow up your application. They look like functions but they're not functions. They work only in the React world. They're implemented via functions only because JS lacks better primitives for them.
      That's why React team is building compiler that is supposed to work out where to put useMemo and useCallback, etc... That's a sign that language they're using is not giving them tools they need.

    • @tuananhdo1870
      @tuananhdo1870 Месяц назад

      Sure. Javascript is not the best. THats why we have typesscripy and its pretty good

    • @tuananhdo1870
      @tuananhdo1870 Месяц назад

      Buy javascript is still better than some languages like java php... plenty good

  • @blessedpigeon6304
    @blessedpigeon6304 Месяц назад

    9:20 it is very common when building stuff like a ui kit for example

  • @lawrencejob
    @lawrencejob Месяц назад

    Can you just use @hook and @component in TS if that's what you want?

  • @kuhluhOG
    @kuhluhOG 19 дней назад

    This kinda feels like Meta Build Systems (or Build System Generators) like CMake or Meson.
    Trying to solve the problem at the wrong level.

  • @Juloass
    @Juloass Месяц назад +3

    Lets replace export default function !! Okay .. what about .. export default component ?
    Yeah we really needed to keep that public static void main(String[] args) type of stuff

    • @untlsn
      @untlsn Месяц назад

      exp def fn!

  • @jondoe79
    @jondoe79 Месяц назад

    React is all about hype every quarter. We should name react as Hype Framework

  • @matheusmacielleao5570
    @matheusmacielleao5570 Месяц назад +2

    sorry htmx pilled here

  • @thisweekinreact
    @thisweekinreact Месяц назад

    I want this now!

  • @junit1606
    @junit1606 Месяц назад +4

    More code rewrite? no thanks

  • @fifty6737
    @fifty6737 Месяц назад

    im now interested in flow

  • @benheidemann3836
    @benheidemann3836 Месяц назад

    I don’t think TypeScript should be adding React specific syntax. However, it would be really interesting to see if something like ts-patch could be upstreamed into TS. Technically this isn’t meant to support new syntax, but in practice as long as it can be parsed into an AST, it would be possible to do so. This would also allow implementing “real” typescript diagnostics for react (or any other framework) errors. The issue here though is that it leaves behind alternative compilers, as they all use different AST representations under the hood so it would be very difficult to implement this.

  • @kobibr9362
    @kobibr9362 Месяц назад +2

    Facebook is slower everyday 😅

  • @tokiomutex4148
    @tokiomutex4148 Месяц назад

    What do you think of ReasonML?

  • @adtc
    @adtc Месяц назад

    What about stuff that's not props, like forwardRef? How would you pass that in?

  • @joshuathomasbird
    @joshuathomasbird Месяц назад

    i could see like an swc plugin or an esbuild plugin to do this

  • @JimmayVV
    @JimmayVV Месяц назад

    I just want these features to come to TypeScript

  • @fwsuperhero1
    @fwsuperhero1 Месяц назад

    Has anyone tried Flow and Rescript in recent months and can you compare?

  • @brennan123
    @brennan123 Месяц назад

    Ugh, you got me with the "clickbait" again. lol
    I was hoping it was something like Reason ML.

  • @SpeakChinglish
    @SpeakChinglish Месяц назад +2

    This is the equivalent of seeing a todo app then recreating it from scratch just to add a small improvement on top.

  • @FlorianWendelborn
    @FlorianWendelborn Месяц назад +1

    I hope this never gets into TypeScript, it’s too framework-specific. It would be great if there’d be some sort of more web standards based alternative in TS though

  • @shadeblackwolf1508
    @shadeblackwolf1508 Месяц назад

    Given that the whole JS ecosystem is transpilers, you can create a new language variant that has this and transpiles to standard TS.

  • @geooot
    @geooot Месяц назад

    we ain't beating the allegations buds

  • @Nellak2011
    @Nellak2011 Месяц назад

    I haven't looked into this at all, so take what I say with a grain of salt.
    It appears that Flow is different to ReScript due to the render types, but is otherwise mostly the same idea as ReScript, but with additional React Linting and a new syntax.
    Correct me if I am wrong in the comments.

  • @ArnarF
    @ArnarF Месяц назад

    it could be done in the same way svelte handles TS perhaps?

  • @ktappdev
    @ktappdev Месяц назад

    Export default const?

  • @shadowpenguin3482
    @shadowpenguin3482 Месяц назад

    Shouldn’t it be possible to implement this via annotations? I know typescript supports annotations eg in angular

  • @Awesomo4000
    @Awesomo4000 Месяц назад +1

    I haven't used React in a while. Every time I hear something about React it sounds like the "meta" changed, which makes it very unappealing.

  • @cornheadahh
    @cornheadahh Месяц назад +1

    I'm kind of tired of the youtube thumbnail face, I guess on paper it does boost engagement though

    • @deadchannel8431
      @deadchannel8431 Месяц назад

      It honestly makes me not want to watch it lol

  • @nekogami87
    @nekogami87 Месяц назад +1

    Mandatory XKCD comic strip number 927 :D (looks like a full link auto delete the comments :( )
    edit: before anyone gets buthurt, that's a joke, it just made me think of the meme of the "new shiny js tooling of the week"

    • @anon_y_mousse
      @anon_y_mousse Месяц назад

      I don't see how anyone could disagree. It really is what they do with JavaScript and every offshoot thereof.

  • @abhayvashokan8675
    @abhayvashokan8675 Месяц назад

    Which is Theo's VSCode theme?

  • @Sindoku
    @Sindoku Месяц назад

    Want it in TS and I want it NOW! lol.

  • @jfftck
    @jfftck Месяц назад

    JavaScript should add a component keyword as syntactic sugar to web components, maybe that would reduce the clunky nature and improve adoption.

  • @vorant94
    @vorant94 Месяц назад

    I don’t want typescript to bang on react features… typescript isn’t about react, but javascript. React already influences the js world enough so devs dunk on classes, mutable data structures and so on

  • @untlsn
    @untlsn Месяц назад

    React should embrace own files like .vue, .svelte at this point

  • @additionaddict5524
    @additionaddict5524 Месяц назад

    7:03 something on your mind Theo?

    • @pablomayobre
      @pablomayobre Месяц назад +1

      Flutter is taking Theos mind lol

  • @asdrian-sykes
    @asdrian-sykes Месяц назад +1

    13:33 "Refs are getting an overhaul soon"
    I'm out of the loop, what's the overhaul?

    • @hmerritt
      @hmerritt Месяц назад

      React 19 (not yet released) removes the need for forwardref, and just makes ref a regular prop

    • @asdrian-sykes
      @asdrian-sykes Месяц назад

      @@hmerritt Oh that's neat, thanks for the info!

  • @codeChuck
    @codeChuck Месяц назад

    Theo, are you saying even authors of the blog do not understand what some eslint rules are doing in React? What? They supposed to be the authors? No?
    They are the source of truth?

  • @kasper_573
    @kasper_573 Месяц назад

    I think it would be unwise to add react specific features to typescript. If a framework wants its own DSL it should take ownership of that DSL and/or compiler, like solidsj or svelte

  • @hacktor_92
    @hacktor_92 Месяц назад

    sooo... basically, flow is a DSL-ish on top of JS for React? just like Vala is built on top of GObject

  • @joshuathomasbird
    @joshuathomasbird Месяц назад

    honestly that props thing is kinda wierd. In normal fns params are positional, but here they are not.
    Would have preferred to keep the curly braces to keep those semantics

  • @adtc
    @adtc Месяц назад

    Um, why are you looking to the side and not at the camera? Lol

  • @Wielorybkek
    @Wielorybkek Месяц назад

    wow, writing a domain specific language looks nicer than adapting to an existing standard. shocker.

  • @GrumpyGrebo
    @GrumpyGrebo Месяц назад +7

    How many frameworks and layers of abstraction can you possibly need just to create the same UI/UX that other websites already have? Frontend is such a deadweight sector.

    • @untlsn
      @untlsn Месяц назад

      How many layers of abstraction and rules will the meta add before it admits that React is a framework

    • @GrumpyGrebo
      @GrumpyGrebo Месяц назад

      @untlsn Show me a Web fronted that is not written in Javascript HTML and CSS. React is a framework, as is anything which takes away the ability to actually produce the end result without the intermediate tools.

    • @untlsn
      @untlsn Месяц назад

      @@GrumpyGrebo i know, but many peoples say that react is just a library

    • @GrumpyGrebo
      @GrumpyGrebo Месяц назад

      @untlsn It's a fun argument, and a trick. React is a domain specific language distributed as a library, with best practices and use patterns that make it more of a framework than comparable libraries. But it is not a full framework and can be integrated into full frameworks ie Next.js. You can just use React in a basic standalone HTML file, so it is technically a library. But you will be almost definitely be carving out the presentation layer of your application and building components which consume props using JSX, data bound to providers, component hooks, etc.
      React is a library, building in React makes it a framework. Infinite argument.

  • @AbstruseJoker
    @AbstruseJoker Месяц назад

    Why not just reserve this syntax to tsx only?

  • @HikaruAkitsuki
    @HikaruAkitsuki Месяц назад

    The only wish that React have is to get rid imports, it have only one job but it doesn't mean it should pile up on your source files.

    • @keithjohnson6510
      @keithjohnson6510 Месяц назад +1

      "get rid import", what do you mean here?, if it's just `import * as React from "react"` , that's already possible, if you mean for all other imports, then no that's not a good idea.

  • @miiky976
    @miiky976 Месяц назад

    it looks like compose .-.

  • @williamlim672
    @williamlim672 Месяц назад

    Will decorator be a good option?

    • @benheidemann3836
      @benheidemann3836 Месяц назад

      Decorators don’t support functions other than methods at present. But yeah, they could be used as annotations to help a linter understand your code. They won’t add new syntax though so only would help with a very narrow subset of what was discussed here.

  • @AndrewTaylorPhD
    @AndrewTaylorPhD Месяц назад

    I'm in favour of this. I didn't think i would be because generally I'm pro "just copying the files onto a server and calling it a build process", but I think if you've already got JSX then you might as well commit to the bit and make a whole new language, and this seems nice. But yes, not switching to flow over this 🙃

  • @FrostsorrowGaming
    @FrostsorrowGaming Месяц назад

    For the love of all that is holy can we please please please use dark mode for reading web pages like this... you light mode users are destroying the eyes of so many of us night dwellers..

  • @vinitjain7
    @vinitjain7 Месяц назад

    FR

  • @jonniem
    @jonniem Месяц назад

    is this the new java….

  • @__christopher__
    @__christopher__ Месяц назад

    What about instead fixing React to not have those restrictions in the first place? Then you'd not need any language features to enforce them.

  • @thepetesmith
    @thepetesmith Месяц назад +1

    If you use flow, I am sorry for you.

  • @bellazook2334
    @bellazook2334 Месяц назад

    Why not implement it in React? use_ for hooks, comp_ for components...

  • @WatashiwaWatashi-zw7hy
    @WatashiwaWatashi-zw7hy Месяц назад

    sorry so we don't need to learn Typescript anymore ya?

  • @matteo.veraldi
    @matteo.veraldi Месяц назад

    React is wild these days

  • @yuryzhuravlev2312
    @yuryzhuravlev2312 Месяц назад

    yeah, they have the same issue as Svelte with TS adoption. But I suppose Svelte anyway much simpler and better than React.

  • @auroralong5437
    @auroralong5437 Месяц назад

    shows how well reasonml went :/

  • @carloslfu
    @carloslfu Месяц назад

    React becomes Flutter ...
    jk, that'd be the wrong take. Or would it? 👀

  • @maximus1172
    @maximus1172 Месяц назад +4

    Leave Javascript folks, it would be for the best

  • @AlexanderBorshak
    @AlexanderBorshak Месяц назад +5

    React HAD a great idea that UI = f(state), but somewhere FB took a wrong turn. Will vote for Vue.

    • @omri9325
      @omri9325 Месяц назад +3

      Great idea in theory, bad in practice.
      It's too difficult to make immutability performant

    • @DubiousNachos
      @DubiousNachos Месяц назад

      ​​@@omri9325Immutability is fine - proper functional programming languages handle it no problem, and can have really good performance
      The problem is enforcing immutability in a cross-paradigm language that wasn't built for immutability from the beginning (JavaScript). JS can't do any fancy optimizations or provide any niceties around structural sharing because it can't safely make any assumptions about what will or won't happen to the data

    • @untlsn
      @untlsn Месяц назад

      Prevously: UI = f(state)
      Now: UI = f(state) { backend_stuff, user interaction, forms_control }

  • @stugeh
    @stugeh Месяц назад

    Ngl, I hate this. Adding more and more layers of abstraction and compile steps is getting ridiculous at this point. If it's so difficult to write react that you need to write a whole new language to deal with it better maybe react isn't a good abstraction in the first place.

  • @jwoods9659
    @jwoods9659 Месяц назад

    O god

  • @DhananjayNaik
    @DhananjayNaik Месяц назад

    who tf uses flow?
    I'm sad that somewhere a dev is working on developing flow features.

  • @Kampouse
    @Kampouse Месяц назад

    guy talk about a language about react but does not talk about rescript are you serious

  • @wishfuldeity
    @wishfuldeity Месяц назад

    woah i was fast

  • @jricardoprog
    @jricardoprog Месяц назад +1

    I'm glad I don't use react, lol

  • @fernandosalazar8814
    @fernandosalazar8814 Месяц назад

    Dogfooding the rules of react

  • @sirrobinofloxley7156
    @sirrobinofloxley7156 Месяц назад

    Yet another devchan not using dark... How do you guys even see?

  • @n4bb12
    @n4bb12 Месяц назад +1

    Facepalm

  • @itzhexen0
    @itzhexen0 Месяц назад +1

    oh yeah it's awesome just keep creating new languages keep making shit up to keep your job. ridiculous.