ScalablyTyped / SlinkyDemos

MIT License
29 stars 8 forks source link

New react-native #1

Closed mcallisto closed 4 years ago

mcallisto commented 4 years ago

Here is the complete and working new module.

But I am unsure about how to add it with the new build.sbt style In the old style I wrote:

lazy val `react-router-native-slinky` = project
  .configure(baseSettings, outputModule, application)
  .settings(
    scalaJSUseMainModuleInitializer := false,
    addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full),
    libraryDependencies ++= Seq(
      "me.shadaj" %%% "slinky-native" % "0.6.3",
      "me.shadaj" %%% "slinky-hot" % "0.6.3",
      ScalablyTyped.R.`react-router-native`,
      ScalablyTyped.R.`react-router-native-slinky-facade`
    )
  )

So in the end I am not modifying build.sbt here. Can you please have a look and in case update build.sbt?

oyvindberg commented 4 years ago

Hey hey, and thanks for this, I had been meaning to look into it.

I'll have a better look at it tomorrow, but on a cursory glance it looks all good.

My plan is to proceed with the following two things:

1) I want only one react native demo, which showcases a few libraries. So there is one here that is commented out and not updated, but which uses some custom icons and things like that. You can make an argument that smaller, more pointed demos would be better, but with the time it takes to build and test these things I think a scala object for each thing we want to demonstrate in say react-native will do the job just fine.

2) I also want to update the code to not use the manually created facades, but use the (new and unreleased) generated slinky components. It worked fine for the other react-router demo, so it should be fine here.

I'll let you decide how much work you want to put into this. If you feel like trying 1 or 2 just tell me and I'll guide you, otherwise I can take it from here :)

mcallisto commented 4 years ago
  1. Fine, I can definitely try combine a native demo with react-router and antd. In my opinion it should be published with Expo, I guess you have an account to do that. The issue of icons on Expo for sure can be solved. Yes I would argue that smaller demos, especially when they exactly replicate the demo of the original libraries, have a higher educational value for beginners. But I see your point in not cluttering ScalablyTypedDemos with react related stuff, the scope is much broader than that. In case I will try to keep alive my pointed demos.

  2. I haven't tried the new method, I definitely would like to. Is it ready to be tested or you still need to publish something?

oyvindberg commented 4 years ago

Great! So about 1, dont feel pressured to keep much of what's in the old demo, it's terrible anyway. It's much more important that it's easy to understand and that we can add a bit more stuff later. In particular about the icons on expo, that's one of the things that's actually working there, and I would imagine that you can just lift the code and have the material icons working. But if it doesn't, dont stress it.

About 2) I'll publish an early version of the plugin hopefully tomorrow which you can try. It should also come with some docs which I havent written yet, so you'll have to have some patience over the next week or so for that :)

mcallisto commented 4 years ago

Ok, this is my initial proposal for 1.

An app with a side menu, currently with 3 options:

The menu is done with the antd Drawer component and the overall routing among the pages with react-router.

Only issue (for now) are the antd icons not recalled on Expo.

oyvindberg commented 4 years ago

I havent started it yet, but the code looks awesome. Feel free to delete the old react-native stuff and remove the 2-suffix from this code.

I PMed you instructions for how to use the plugin :)

oyvindberg commented 4 years ago

Pull from https://github.com/oyvindberg/SlinkyTypedDemos/tree/react-native - that should unblock you :) Note, I havent tested the code yet - didnt have much time

oyvindberg commented 4 years ago

I fixed the font loading for you, so the icons work now, see https://github.com/oyvindberg/SlinkyTypedDemos/commit/4c93634541deeb1badd9036734f5d6d6e4142a17 (same branch as last time)

oyvindberg commented 4 years ago

By the way I'm fine with merging this any time you want

mcallisto commented 4 years ago

By the way I'm fine with merging this any time you want

Great! You can definitely merge, I haven' tested it yet but looks like everything is solved, excellent.