r/FlutterDev • • Jan 09 '22

Discussion Can Flutter/Dart replace JavaScript and React? If no, then Why

[removed] — view removed post

43 Upvotes

58 comments sorted by

View all comments

44

u/gaspard-m Jan 09 '22 edited Jan 09 '22

Flutter is still not that mature when it comes to the web. So I do not think that it would be able to replace React in the near future. Furthermore, JavaScript still has the advantage of running natively in a browser while Dart needs « compilation » to JavaScript…

But what is sure is that Flutter is becoming better and better each day that passes and I don’t think the same can be said about React… And if fuschia continues growing, Flutter will start to be way bigger than React. But not replacing it since React also comes with it shares of advantages. Like written in JavaScript which is a very popular language as opposed to dart.

I love Flutter and I am not that experienced with React so my opinion is clearly not impartial ! :)

1

u/Slonik923 Jan 09 '22

More and more developers uses Typescript, which also needs transpilation to Javascript. Moreover transpiled code can be and usually is faster than Javascript code written by a developer. Unless developer spend a lot of time optimizing the code.

2

u/gaspard-m Jan 09 '22

And does react typescript allow for easy debug? Because that’s one of the drawback with Flutter web… It does not have a good stack trace when the issue is a bit complex… Of course you usually dev using android emulator or other but when some issue are only web related it becomes quite hard..

2

u/Samurai___ Jan 10 '22

Yes, it can be debugged in browser or in vscode properly.

2

u/Slonik923 Jan 10 '22

In TS you can tell compiler to declare TS to JS maps, which are then used for debugging. Now you now on which line the error occured. Not sure if you can do this in Dart, but Dart have pretty cool tooling on mobile, so I wouldn't be worried about that.

Flutter Web is using canvas, which could be reason why stack traces are that complex. Flutter Web is still in beta, so maybe this will be improved.

On the other hand you still can use AngularDart, which is not as cool as Flutter, but does the job. And maybe we get Flutter Web with html elements support.