over_react icon indicating copy to clipboard operation
over_react copied to clipboard

Add support for JSX

Open aaronlademann-wf opened this issue 9 years ago • 6 comments

  • Issue Type: Feature Request

Requested by CookieOfFortune on Reddit

He would like to be able to use a JSX syntax instead of the over_react fluent interface.

Here's a link to how TypeScript supports JSX

Seems like this would possibly be something that would require some dartlang sdk changes, but I'd defer to @greglittlefield-wf's opinion on that.

Either way - until we get more than one person asking about it, this is likely icebox.


FYI: @greglittlefield-wf @aaronlademann-wf @jacehensley-wf @clairesarsam-wf @joelleibow-wf

aaronlademann-wf avatar Oct 31 '16 16:10 aaronlademann-wf

Looks like there's the ability to create analyzer plugins? See https://github.com/dart-lang/angular2-dart-analyzer. It's not really documented though.

Something like that would probably be our best bet.

greglittlefield-wf avatar Oct 31 '16 16:10 greglittlefield-wf

That plus Bazel would be really interesting.

jacehensley-wf avatar Oct 31 '16 16:10 jacehensley-wf

I think this can be pretty easily solved by writing a transformer, which rewrites the XML code to dart code just before compiling, no? Would definitely be very nice to have.

dotdotcommadot avatar Nov 09 '16 12:11 dotdotcommadot

@dotdotcommadot That would definitely be possible, but then there'd be no analyzer support when authoring the JSX.

At that point, is writing JSX really favorable to the over_react syntax, which can be statically analyzed?

greglittlefield-wf avatar Nov 09 '16 21:11 greglittlefield-wf

AngularDart runs a check on every 'save' action, so I think this might do the same, no? But perhaps it won't be that easy to implement anymore since you have to generate sourcemaps and stuff (to throws errors with the matching line numbers in your files etc)

However, even with or without static analysis, I think this would be an awesome feature.

dotdotcommadot avatar Nov 10 '16 09:11 dotdotcommadot

Found my way over here when looking into Dart again after a year-long stint in the React world. I spent the year before using Dart, loved it, then had to pick up React for a new job. I still prefer Dart over vanilla JS... language-to-language. But JSX is honestly the best part about React for being able to visualize structure and staying out of an HTML document. IMHO it'd be worth writing a transformer for.

mdrx-io avatar Dec 02 '16 16:12 mdrx-io