News for hackers. Stuff that matters.
Re:React Native 0.60 by halfmatthalfcat on Saturday July 13, 2019 @10:58AM (#20428337)
I tried Nativescript, React Native and Ionic. I've had previous experience with both React and Angular. I found Ionic to have the most enjoyable and cogent end-to-end experience amongst the three.

Interopt with Nativescript and other libs was hard, React Native didn't support Typescript as a first-class citizen (which as a prereq of mine) and the developer tooling wasn't as mature as the Ionic/Cordova/Angular cli(s) were.

A lot of noise around Flutter but haven't given it a try yet, but I'm weary because of defining views-as-code rather then a flavor of JSX/Angular Templates.

Re:React Native 0.60 by antihero on Saturday July 13, 2019 @11:57AM (#20428666)
> React Native didn't support Typescript as a first-class citizen

As someone that uses TypeScript to death and works on react native as my job pretty happily, please explain this?

Also JSX is absolutely not a templating language, it's an extremely thin layer over JS.

Re:React Native 0.60 by halfmatthalfcat on Saturday July 13, 2019 @12:37PM (#20428860)
Should have made the distinction clearer but I was just saying JSX _and_ Angular specific templates. The fact of JSX being an abstraction over the React API that equates to what the DOM _should_ look like is must easier to grep then defining them as literal code, imo.

When I used React Native with Typescript (this was about a year ago) the initial setup to get all of the types playing well together either wasn't clear from the documentation or I ended up debugging/writing custom definitions to get things to work. It just felt sidelined or treated as a second class citizen, but I feel like this has been a common theme throughout the life of React generally.

Re:React Native 0.60 by duncanawoods on Saturday July 13, 2019 @01:59PM (#20429291)
> equates to what the DOM _should_ look like is must easier to grep then defining them as literal code, imo

It's a common view but really quite a funny form of path dependence / mental fixedness. The fact that html elements have been defined with angle brackets is essentially historical accident. It's just a simple hierarchical structure that can be in any notation and any given programming language can happily support this already without new syntax. Yet because of the history, we feel more comfortable with some angle brackets and so we have all this redundant syntactic complexity in jsx/tsx which we would never design without the history.

I'd encourage you to be open minded for going to all code because although there will be an acclimatisation period as you break the historical connection, those familiar angle brackets are totally superfluous.

Re:React Native 0.60 by halfmatthalfcat on Saturday July 13, 2019 @05:40PM (#20430339)
I've worked with frameworks like GWT and Vaadin enough to know I prefer the DOM way of doing things over visualizing the view through code. Hell, I've used the React programmatic API before I used JSX...never going back.
Re:React Native 0.60 by virtualwhys on Saturday July 13, 2019 @11:45AM (#20428582)
> I found Ionic to have the most enjoyable and cogent end-to-end experience amongst the three.

Agreed, though I'd love to use Ionic with Scala.js in place of TypeScript (which is great, but doesn't give me the same if-it-compiles-it-works confidence as Scala does, not to mention batteries-included standard library).

Hopefully technology will emerge that allows one to write once/run everywhere in preferred-language on all major platforms. Compromises seem to abound with currently available options.

Re:React Native 0.60 by yesimahuman on Saturday July 13, 2019 @11:50AM (#20428617)
Scala.js sounds really interesting. There's no reason you shouldn't be able to use it with Ionic as of Ionic 4, since we generally now support whatever framework you want to use (not just Angular anymore)
Re:React Native 0.60 by s_y_n_t_a_x on Saturday July 13, 2019 @11:54AM (#20428645)
I'm not sure why TS wouldn't give you confidence. The compile process is simply stripping out the typing to JS.
Re:React Native 0.60 by jakear on Saturday July 13, 2019 @01:13PM (#20429036)
I think they mean TS lets too much buggy code typecheck, as compared to Scala.
Re:React Native 0.60 by frankpf on Saturday July 13, 2019 @01:25PM (#20429090)
I don't think that's true. TypeScript's type system is very advanced, and has most of the features you need for type-safe development if you use strict mode (which is the default for projects created with `tsc --init`). It has ADTs, null safety, exhaustiveness checking and the LSP tooling is better than any other language I've tried. The biggest feature that's missing from Scala is HKTs, and even those can be faked in TS.
Re:React Native 0.60 by verttii on Saturday July 13, 2019 @08:23PM (#20430931)
I'd be hard pressed to say ADTs are first class citizens in Typescript. If anything, seems more like a hack over some interface primitives to me.

I miss having a solid advanced type system like in Haskell when using something like Typescript or Dart. Typescript feels mostly like Microsoft's attempt on converting Javascript to align more with C# to me.

Re:React Native 0.60 by yawaramin on Saturday July 13, 2019 @01:35PM (#20429145)
It doesn't have soundness.
Re:React Native 0.60 by invaliduser on Saturday July 13, 2019 @03:56PM (#20429837)
This is by design, and rather well explained in the typescript documentation: the type system is based on structural subtyping, which seems like a good tradeoff to me (but of course, as any design choice, not everyone should agree, and it's fine).
Re:React Native 0.60 by yawaramin on Sunday July 14, 2019 @05:02PM (#20436002)
Structural subtyping doesn't imply lack of soundness, OCaml object types have structural subtyping too and OCaml is sound.
Re:React Native 0.60 by verttii on Saturday July 13, 2019 @12:14PM (#20428749)
I much prefer React Native's (React) paradigm over Flutter's, but as a platform Flutter is just a lot more robust in my experience. Everything just works on it while RN has all kinds of weird quirks and issues, particularly when using libraries that have native code.

I chose to give up on RN at 0.59 and focus my efforts on getting really fluent at Flutter instead.

Re:React Native 0.60 by eklavya on Saturday July 13, 2019 @11:25AM (#20428494)
For a stupid guy like me who needs the compiler, flutter is the most sane experience I have ever had in the UI ecosystem (except Qt and JavaFX). The view as code is really really better (for me).
Re:React Native 0.60 by krzat on Saturday July 13, 2019 @12:58PM (#20428969)
Same here. I don't see how adding some kind of XML layer on top of Dart would help with anything.
Re:React Native 0.60 by teamski on Saturday July 13, 2019 @03:05PM (#20429603)
Tell us nore about your dev experience with Flutter. Can you also create the web version of your app with Flutter?
Re:React Native 0.60 by eklavya on Sunday July 14, 2019 @01:00AM (#20431723)
Desktop and web versions are in the making. So we will be able to make all of them from a single codebase.

I am really dependent on static types so take my take on this with a grain of salt :)

Flutter is more mature right from the Dev tools to the overall ecosystem. The types are first class and make it a joy to use. Not to mention the libraries are better quality and stuff works even when you upgrade. I could never work on any RN project for more than 1-2 weeks without something or the other breaking and me cursing out aloud for the really shitty (again subjective) state of things. I am used to having codebases just keep on working almost forever.

Re:React Native 0.60 by teamski on Sunday July 14, 2019 @01:10AM (#20431754)
Is the layout system as powerful as eg css' flexbox, React's component composing etc.?
Re:React Native 0.60 by yesimahuman on Saturday July 13, 2019 @11:52AM (#20428625)
(Ionic co-founder here) glad you're enjoying Ionic, we're working on a ton of stuff to improve it even more right now. Have you tried Capacitor yet, our Cordova alternative?
Re:React Native 0.60 by sroussey on Saturday July 13, 2019 @02:32PM (#20429445)
Capacitor 2.0 should fix the XSS issue that Cordova has always had, and split the code between privileged code (backendish) and UI code.

Capacitor 1.1 turned off Electron security protections to make things work as they always have. As a new project, I was hoping for more.

In Capacitor 2 you have the opportunity to have the business logic run in a separate thread than the UI, and add the privileged code there. And such logic would not need to hold up the UI allowing for a smoother app.

One XSS in an iPhone app and maybe they own that app. One XSS in an Electron app and they wipe out your whole PC and life. There is a reason why Electron changed the defaults.

Re:React Native 0.60 by lwansbrough on Saturday July 13, 2019 @12:17PM (#20428775)
Sounds interesting. We’re looking into Cordova right now. Do you have a page which explains the benefits of this vs. Cordova?
Re:React Native 0.60 by yesimahuman on Saturday July 13, 2019 @02:52PM (#20429548)
Re:React Native 0.60 by xenospn on Saturday July 13, 2019 @01:17PM (#20429059)
I'm still using Ionic v3 with Cordova - assuming I try and migrate to Ionic v4, will I have to use a whole new set of plugins with Capacitor?
Re:React Native 0.60 by yesimahuman on Saturday July 13, 2019 @01:45PM (#20429215)
Not necessarily. Cordova plugin compatibility was designed in from the start. Unfortunately, some plugins relied on more obscure aspect s of Cordova and don’t work. We keep an updated list of incompatible plugins here: https://capacitor.ionicframework.com/docs/cordova/known-inco...
Re:React Native 0.60 by xenospn on Saturday July 13, 2019 @05:33PM (#20430305)
Yeah, looks like quite a few of the plugins i rely on are on that list :(
Re:React Native 0.60 by yesimahuman on Saturday July 13, 2019 @05:41PM (#20430344)
Which ones? We can see if there’s anything we can do about it
Re:React Native 0.60 by xenospn on Saturday July 13, 2019 @08:24PM (#20430934)
fcm/Firebase/qrscanner
Re:React Native 0.60 by bauerd on Saturday July 13, 2019 @11:09AM (#20428401)
>because of defining views-as-code rather then a flavor of JSX/Angular Templates

JSX is just syntactic sugar, it's not a templating language. You could write yourself a JSX syntax extension for Dart, it'd be the same thing really.

Edit: More succinctly, JSX desugars to method calls

Re:React Native 0.60 by k__ on Saturday July 13, 2019 @11:09AM (#20428398)
Have you tried Expo?
Re:React Native 0.60 by teamski on Saturday July 13, 2019 @03:02PM (#20429588)
> as mature as [...] Cordova

Stopped reading there.