New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use named parameters? #53
Comments
Hi @sethladd, I am not sure what are the benefits of this. I see at only as a little bit different syntax and that is not enough to outweight the cons I see:
As Alan Peris said:
|
The benefit would be better code completion and static warnings when you misspell something. Compare:
with
The second one will have a warning, and you'll be able to code complete the options. |
+1 :-) On Tue, May 26, 2015 at 2:00 PM Seth Ladd notifications@github.com wrote:
|
@sethladd thanks for pointing out the benefits. Unfortunately, I don't see way to overcome obstacles I mentioned in previous comment. |
+1 for the typed version. I am currently working on making a typed Dart wrapper for react-bootstrap. For this I am using the approach suggested by @sethladd. It is a work in progress but for reference, the repo is here. The main benefit is that you can easily check what props are available. In theory you should be able to get parameters for each bootstrap component listed in Webstorm but seems it does not work at the moment. Possibly because of the return value being a typedef. |
@sethladd @wstrange @jonaskello Workiva's UI Platform Team (@greglittlefield-wf specifically) has developed an API for strongly typed React-dart components, and we will be open-sourcing it soon! |
One of the main attractions to Dart is types, so I'm surprised you don't miss them here! If I was going to use React in Dart I was absolutely want strong typing of Props etc. One of my colleagues created bindings for us to use React from Bridge.NET (a C#-to-javascript transpiler): https://github.com/ProductiveRage/Bridge.React There's an example on that page; the Props classes are nested within the components; all access to them is completely typed (and refactorable etc). Maybe worth a look :) |
@aaronlademann-wf Are you still planning to open source it? I'm curious! |
@kasperpeulen @DanTup it hasn't been prioritized, but it is still planned, yes. |
@kasperpeulen @DanTup @sethladd @wstrange @jonaskello @hleumas @greglittlefield-wf will be speaking at Dart Summit 2016 in Germany (Thursday, October 27th) about "Getting the most out of React in Dart". As part of that, he'll be announcing Workiva's framework for building statically-typed React UI components with Dart (new OSS repo). The wait is almost over! |
@kasperpeulen @DanTup @sethladd @wstrange @jonaskello @hleumas The wait is over. Workiva's Dart library for building statically-typed React UI components is public, and available on pub.dartlang.org! |
Congrats! |
What do you think about:
instead of
?
The text was updated successfully, but these errors were encountered: