Skip to content
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

New react-native #1

Merged
merged 7 commits into from
Dec 19, 2019
Merged

New react-native #1

merged 7 commits into from
Dec 19, 2019

Conversation

mcallisto
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator Author

  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
Copy link
Collaborator

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
Copy link
Collaborator Author

Ok, this is my initial proposal for 1.

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

  • home page where we can explain the scope
  • antd: demonstrating a few components (but by now I have much more of them working, it could be greatly expanded)
  • react-router: demonstrating the most tricky part of their basic example

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.

@mcallisto mcallisto changed the title Add react-router-native-slinky New react-native Dec 16, 2019
@oyvindberg
Copy link
Collaborator

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 :)

import scala.scalajs.js.Dynamic.literal

object Styles {
val headerStyle = literal(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use TextStyle / ViewStyle instead of literals?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm... I think they don't play well with slinky.native.{Text, View} but honestly I haven't examined the issue in depth

@oyvindberg
Copy link
Collaborator

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

@mcallisto mcallisto mentioned this pull request Dec 18, 2019
@oyvindberg
Copy link
Collaborator

I fixed the font loading for you, so the icons work now, see 4c93634 (same branch as last time)

@oyvindberg
Copy link
Collaborator

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

@mcallisto
Copy link
Collaborator Author

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.

@oyvindberg oyvindberg merged commit 2d49258 into ScalablyTyped:master Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants