Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 28 2019 19:09
    dependabot[bot] labeled #2
  • Dec 28 2019 19:09
    dependabot[bot] opened #2
  • Dec 28 2019 19:09

    dependabot[bot] on npm_and_yarn

    Bump handlebars from 4.0.10 to … (compare)

  • Dec 28 2019 18:15
    dependabot[bot] labeled #6
  • Dec 28 2019 18:15
    dependabot[bot] opened #6
  • Dec 28 2019 18:15

    dependabot[bot] on npm_and_yarn

    Bump handlebars from 4.0.10 to … (compare)

  • Oct 31 2019 11:11
    dependabot[bot] labeled #1
  • Oct 31 2019 11:11
    dependabot[bot] labeled #5
  • Oct 31 2019 11:11
    dependabot[bot] opened #1
  • Oct 31 2019 11:11
    dependabot[bot] opened #5
  • Oct 31 2019 11:11

    dependabot[bot] on npm_and_yarn

    Bump tar from 2.2.1 to 2.2.2 B… (compare)

  • Oct 31 2019 11:11

    dependabot[bot] on npm_and_yarn

    Bump tar from 2.2.1 to 2.2.2 B… (compare)

  • Jun 30 2019 09:32

    frgomes on master

    ScalaJS 1.0.0-M8 (compare)

  • Jun 30 2019 09:29

    frgomes on master

    ScalaJS 1.0.0-M8 (compare)

  • Jun 26 2019 22:49

    frgomes on v2019.06.26

    (compare)

  • Jun 26 2019 20:45

    frgomes on v2019.06.26

    (compare)

  • Jun 26 2019 20:45

    frgomes on 0015-support_for_SBT_1.x

    Support for SBT 1.x; Scala 2.12… (compare)

  • Jun 26 2019 20:34
    frgomes assigned #4
  • Jan 08 2019 06:16

    chandu0101 on master

    Added two missing react synthet… Merge pull request #4 from ross… (compare)

  • Jan 08 2019 06:16
    chandu0101 closed #4
Vadim Bondarev
@haghard
Anyone ? Please
Chandra Sekhar Kode
@chandu0101
@haghard i dont know, ask in react-native discord channel
Jack
@JackDavidson
Hey, I was able to get a react-native-web app working with SRI (so its cross platform web, android, and ios) with SRI, but for web ('react-scripts start') I get eslint errors about undefined functions. I cant seem to modify the eslint rules, either. My workaround has been to an eslint-ignore comment to the top of the .js file that SRI outputs, and everything works fine but its a manual step. Do you know any way that I could edit the build.sbt file to automatically add the eslint-ignore line at the top? Also, I plan to make a public git repo with this as soon as I get it working.
Nikolay Khoroshevskyi
@rossoha
@chandu0101 Is it possible to expose function from components in SRI ? component that in the end will be analog of
class Step extends React.Component {
  constructor(props) {
 this.state = {
// State fields. 
    };
  }
  sendState() {
    return this.state;
  }

 render() {
    const { prop, classes } = this.props;
// Render stuff
  }
}
Jack
@JackDavidson
@NikolayKhoroshevsky Are you trying to ask if you can export components defined in RSI for use in react?
Nikolay Khoroshevskyi
@rossoha
@JackDavidson Yes. :)
Jack
@JackDavidson
then yeah, definetly. but IDK about the properties. you could probably export a function that will act like what you want

`import sri.universal.components.TextC
import scala.scalajs.js.annotation.JSExportTopLevel
import scala.language.postfixOps

object MobileApp {
def main(args: Array[String]) = {}
@JSExportTopLevel("MyExportedComponent")
val MyExportedComponent = TextC("some text")
}`

import sri.universal.components.TextC
import scala.scalajs.js.annotation.JSExportTopLevel
import scala.language.postfixOps

object MobileApp {
  def main(args: Array[String]) = {}
  @JSExportTopLevel("MyExportedComponent")
  val MyExportedComponent = TextC("some text")
}
then in react
render() {
  const MyStuff = require("./assets/js/scalajs-output-android").MyExportedComponent;
  return MyStuff
}
Nikolay Khoroshevskyi
@rossoha
Great! Thanks.
And one more question: my first goal is to have function exposed ( sendState in my example ). So if TextC would have a function without any access modifiers, it would be visible from js perspective as a usual function?
I’m asking because from what I see in scalajs-react it’s not clear or not possible, so I thinking about switching my project to SRI.
Jack
@JackDavidson
@NikolayKhoroshevsky I'm playing around with it, and it looks like there is some funkyness
Jack
@JackDavidson
@NikolayKhoroshevsky ok, here you can export a function:

object MobileApp {
def main(args: Array[String]) = {}
@JSExportTopLevel("MyExportedComponent")
def MyExportedComponent(text: String) = TextC(text)

}

Have you used react before, btw? a 'sendState' function is something I've never had use for in react. Generally I pass everything as properties
what your describing is possible though, you would want @ExportJS on the function that you want to be callable
Jack
@JackDavidson
@JSExportTopLevel("MyExportedComponent")
class MyCustomText(text: String) {
  var someVar = "initialValue"
  @JSExport
  def setSomeVar(text: String): Unit = {
    someVar = text
  }
  @JSExport
  def render(): ReactElement = {
    return TextC(text + someVar)

  }
}
then in react:
    const SRI = require("./assets/js/scalajs-output-android").MyExportedComponent;
    const SRIWText = SRI('starting text ')
    console.log('sri w text is:')
    console.log(SRIWText)
    SRIWText.setSomeVar('some new text')
    return SRIWText.render()
image.png
you can see the state of the component getting changed between the console.log and when it actually gets rendered
Nikolay Khoroshevskyi
@rossoha
@JackDavidson. Awesome! That’s what I wanted. Many thanks!
Jack
@JackDavidson
no problem. glad I could help :)
I'm still learning this too, haha. I actually just started working with this stuff on Monday.
Nikolay Khoroshevskyi
@rossoha
: )
Jack
@JackDavidson
ok, I managed to solve my issue. I figured out how to edit the fastOptJS task to append my step for disabling eslint
Jack
@JackDavidson
I have a sample sri-native plus react-native-web project finally: https://github.com/JackDavidson/Scalajs-React-Native-Web-Starter Still a bunch of work to do to give people a nice starting point though. its nothing more than some text on a page. One great thing about the way it works is that it does not require the additional SRI sbt plugin, it relies only on the scalajs plugin plus a small bit of extra sbt config to work around react's strict enforcing of eslint no-undef rule.
Jack
@JackDavidson
@chandu0101 Do you have any examples of using local images in scalajs-react-interface-native? I tried to create an image, and nothing showed up. I looked at the output javascript and it doesn't look right either. I modified the javascript directly to include a require of the image, and that worked. Originally, it was something like createElement(Image, {source:{uri:'my-img.png'}} and I was expecting (and what worked) was createElement(Image, {source: require('my-img')}}
Jack
@JackDavidson
I was able to define my own version of the ImageComponent that works fine with react-native. If this is an issue with the built-in Image, I'll submit a pull request with my code. What didn't work was: 'val img = Image(source = ImageSource("../my-image.png"))' A call to my replacement code looks like 'val img = MyImage(MyAssetLoader.require("../my-image.png"))'
Jack
@JackDavidson
Thank you!
Nikolay Khoroshevskyi
@rossoha

Could someone help with this:
I have a react component that takes props :

  steps: PropTypes.arrayOf(
      PropTypes.shape({
        stepName: PropTypes.string.isRequired,
        stepComponent: PropTypes.func.isRequired,
        stepId: PropTypes.string.isRequired
      })

And it renders it in this way:

         {steps.map((prop, key) => {
                const stepContentClasses = cx({
                  [classes.stepContentActive]: this.state.currentStep === key,
                  [classes.stepContent]: this.state.currentStep !== key
                });
                return (
                    <div className={stepContentClasses} key={key}>
                      <prop.stepComponent
                          innerRef={node => (this[prop.stepId] = node)}
                          allStates={this.state.allStates}
                      />
                    </div>
                );
              })}

Whatever I try to implement step component that I put as a property.. from browser debugger I see that
ReferenceError: node is not defined in line innerRef={node => (this[prop.stepId] = node)}

From what I see it should be a function that returns my step component but seem that this function should take params and one of them is innerRef that is not clear how to implement.

Nikolay Khoroshevskyi
@rossoha
Seems that I solved this:
  def apply(proper: js.Dynamic) = {
    val innerRef  = proper.innerRef.asInstanceOf[js.Function1[ChildEditComp, Unit]]
    val allStates = proper.allStates
    CreateElement[ChildEditComp](
      props = allStates,
      ref = innerRef
    )
  }
Richard Gomes
@frgomes

@chandu0101 @virtualirfan : Hello. I'm back after a long silence.

I'm upgrading sbt-sri-platform to SBT 1.0 and also upgrading ScalaJS 1.0.0-M8.
These changes trigger the need of recompiling everything.
Recompiling everything and republishing everything is a daunting task :-(
So, I have some ideas in regards to this subject:

  1. Using sbt-release-early makes life a lot easier since we don't need to manually adjust version in ThisBuild := whatever, given that sbt-release-early obtains the version number from Git. I've defined a tag v2019.06.26 and sbt publishLocal does exactly what I would expect: it publishes version v2019.06.26.

  2. This item is controversial: There are lots of projects and it's a lot of work to maintain all of them, set tags on all of them and publish all of them. I suggest we move all projects (with a few exceptions) to a single tree. I suggest that project scalajs-react-interface/sri holds everything (or almost everything!). I don't see the need of projects like discussion, since the issue management system itself is meant exactly for that.

Why I'm suggesting that? Because we can maintain all modules in a single go. We can update the version of ScalaJS, for example, recompile everything, test everything, apply one tag for all changes on all modules and publish all modules in a single go onto Bintray.

These are some projects which I'm currently working on:
https://github.com/frgomes/scalajs-jest/tree/v2019.06.26
https://github.com/frgomes/sbt-sri-platform/tree/v2019.06.26
https://github.com/frgomes/sri-core/tree/v2019.06.26

When I upgrade all modules, I will submit PRs against all projects.
Once again: if we had everything under a single tree, it would be enough to submit only one PR fixing only one ticket which applies to all modules.

Ideas?

Richard Gomes
@frgomes
@chandu0101 @virtualirfan :: If you guys agree with the idea of moving all submodules under a single repo, I volunteer to do that, which includes creating a multi-module project and possibly support for cross compilation for Scala 2.12 and 2.13.
virtualirfan
@virtualirfan
I'm OK with that. Let's see what @chandu0101 has to say since he had stronger feelings about it.
Richard Gomes
@frgomes
@virtualirfan @chandu0101 :: Reviewing the build files, there are lots of small mistakes which may or may not be relevant... who knows? Since a certain version of something is employed, the very same version should be employed across the board, on all projects. Given that there are 30+ projects to be maintained, chances are that leftovers will appear all over the place.
Richard Gomes
@frgomes
@virtualirfan @chandu0101 : The following projects under http://github.com/frgomes are migrated to ScalaJS 1.0.0-M8 and are sufficient for building a simple drawer navigator application. I haven't yet chance to deploy the application onto a simulator and see if it works.
sbt-sri-platform
scalajs-jest
scalajs-plus
sri-core
sri-universal
sri-mobile
sri-web
sri-vector-icons
sri-platform-config-android
sri-platform-config-ios
sri-platform-config-web
sri-navigation
Richard Gomes
@frgomes
@virtualirfan @chandu0101 :: Notice that build.sbt suggests cross build to Scala 2.12 and Scala 2.13. However, sri-core fails to build with Scala 2.13
Richard Gomes
@frgomes
@virtualirfan @chandu0101 :: In case you'd like to give it a try, you can build these projects more or less easier by using this bash script:
#!/bin/bash

function projects {
cat << EOD
sbt-sri-platform
scalajs-jest
scalajs-plus
sri-core
sri-universal
sri-mobile
sri-web
sri-vector-icons
sri-platform-config-android
sri-platform-config-ios
sri-platform-config-web
sri-navigation
EOD
}


function pending {
cat << EOD
sri-code-push
sri-diode
sri-enzyme
sri-graphql-sjs-models
sri-macros
sri-material-ui
sri-mobile-examples
sri-mobile.g8
sri-relay
sri-rx
sri-scalacss
sri-tools
sri-vdom
sri-vdom-styled
sri-victory
sri-web-bundle
sri-web-components
sri-web-examples
sri-web.g8
sri-web-router
sri-website
EOD
}

function sri_retag {
  projects | while read prj ;do
    echo ++++++++++ RETAGG ${prj} +++++++++++++++++++++++
    pushd $prj
    git tag -d v2019.06.26
    git tag -a v2019.06.26 -m 'Update ScalaJS 1.0.0-M8'
    popd
  done
}

function sri_build {
  projects | while read prj ;do
    echo ++++++++++ BUILDING ${prj} +++++++++++++++++++++++
    pushd $prj
    sbt publishLocal
    sync
    popd
  done
}

sri_retag && sri_build
Richard Gomes
@frgomes
@chandu0101 @virtualirfan : I'm working on the following modules, under my github account http://github.com/frgomes
sbt-sri-platform
scalajs-jest
scalajs-plus
sri-core
sri-universal
sri-mobile
sri-web
sri-vector-icons
sri-platform-config-android
sri-platform-config-ios
sri-platform-config-web
sri-navigation
sri-mobile.g8
sri-web.g8
sri-mobile-examples
sri-web-examples
Richard Gomes
@frgomes

@chandu0101 @virtualirfan :: The Android emulator is deadly sluggish and I cannot test anything at this point.

I've created a new platform called Expo in sbt-sri-platform, which is just a placeholder at this point. I need to rework once again the implementation I did a couple of years ago in regards to Expo. http://expo.io/

This way, hopefully it will be far easier to test applications on a real device.

Another idea is testing on a web browser. I will try this alternative first (I mean: before spending time on Expo platform), since modules sri-web and sri-web.g8 are baking and obviously need to be tested.

Richard Gomes
@frgomes
sri-web-examples has dependencies which I still need to work on:
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: scalajs-css#core_sjs1.0.0-M8_2.12;2019.06.26: not found
[warn]  :: scalajs-css#autoprefixer_sjs1.0.0-M8_2.12;2019.06.26: not found
[warn]  :: scalajs-react-interface#web-router_sjs1.0.0-M8_2.12;2019.06.26: not found
[warn]  :: scalajs-react-interface#vdom_sjs1.0.0-M8_2.12;2019.06.26: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
Richard Gomes
@frgomes
@chandu0101 @virtualirfan : I'm doing a complete quality assurance assessment of the code. In particular, I'm making sure that all dependencies are consistent among all modules, regardless Scala, ScalaJS or JS dependencies. I'm also upgrading React and other JS libraries. It's a lot of work, but I'm sure it will pay off.
http://github.com/frgomes/sbt-sri-platform.git
http://github.com/frgomes/scalajs-jest.git
http://github.com/frgomes/scalajs-plus.git
http://github.com/frgomes/scalajs-css-core
http://github.com/frgomes/scalajs-css-autoprefixer
http://github.com/frgomes/sri-core.git
http://github.com/frgomes/sri-universal.git
http://github.com/frgomes/sri-mobile.git
http://github.com/frgomes/sri-web.git
http://github.com/frgomes/sri-vector-icons.git
http://github.com/frgomes/sri-platform-config-android.git
http://github.com/frgomes/sri-platform-config-ios.git
http://github.com/frgomes/sri-platform-config-web.git
http://github.com/frgomes/sri-navigation.git
http://github.com/frgomes/sri-vdom.git
http://github.com/frgomes/sri-material-ui.git
http://github.com/frgomes/sri-relay.git
http://github.com/frgomes/sri-web-router.git
http://github.com/frgomes/sri-web-examples.git
virtualirfan
@virtualirfan
@frgomes Thanks! Great work. I'm caught up on other things. Once testing is complete, please push ahead with commits.
Richard Gomes
@frgomes
I'm using sbt-release-once now. I will have to test the release process using my own target organization first, in order to avoid dozens of failures under organizations managed by @chandu0101 . I'm pretty busy at the moment, but as soon as I manage to setup bintray etc I will validate the release process and then I will push my changes under sri.
Vijay Emmanuel PAZHEPARAMPIL
@vijayemmanuel
Hello All, I am using NavigationAwareComponent for building an android app. Could some one tell me how to get handle when the navigation tab is in focus?