Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 15 19:35

    shadaj on master

    Add dependency on Java IntelliJ… (compare)

  • Jan 15 17:44
    scala-steward closed #450
  • Jan 15 17:44
    scala-steward commented #450
  • Jan 15 17:44
    scala-steward opened #460
  • Jan 14 22:12

    shadaj on master

    Add Java IntelliJ plugin as a d… (compare)

  • Jan 11 22:06
    scala-steward opened #459
  • Jan 11 19:06

    shadaj on master

    Increase detail of IntelliJ plu… (compare)

  • Jan 11 19:05

    shadaj on master

    Update sbt to 1.4.6 (#457) (compare)

  • Jan 11 19:05
    shadaj closed #457
  • Jan 10 04:37

    shadaj on master

    Update IntelliJ plugin vendor w… (compare)

  • Jan 06 17:48

    shadaj on master

    Adjust IntelliJ plugin name bas… (compare)

  • Jan 06 01:09

    shadaj on master

    Package IntelliJ plugin twice t… (compare)

  • Jan 06 00:27

    shadaj on master

    Fix version of IntelliJ SDK tha… (compare)

  • Jan 06 00:12

    shadaj on master

    Add missing until-build propert… (compare)

  • Jan 05 22:22

    shadaj on master

    Add IntelliJ plugin repo token … (compare)

  • Jan 05 21:33

    shadaj on master

    Set up IntelliJ support to be p… (compare)

  • Jan 05 21:33
    shadaj closed #458
  • Jan 05 20:35
    shadaj edited #458
  • Jan 05 20:34
    shadaj opened #458
  • Jan 05 20:34

    shadaj on intellij-standalone-plugin

    Set up IntelliJ support to be p… (compare)

mn98
@mn98
@mcallisto thanks very much, diode looks very interesting and your demo is nice and slick! My current experiment is written in Play+Slinky with local state/context managed within React components and some global state managed with fs2. I'll certainly read through the diode docs and see if it might make better sense to manage client-side state with diode.
Shadaj Laddad
@shadaj
@griffin-radix_gitlab my guess is that something is going wrong with the route that's being selected, perhaps the top-level /about route is shadowing activation of the inner /about route? Might be helpful to use the devtools to see which routes are being selected
Alexis Hernandez
@AlexITC

I'm having troubles to translate this to slinky external components, the official docs has no similar example, any hint is appreciated: http://recharts.org/en-US/guide/getting-started

The js side is:

import { LineChart, Line } from 'recharts';
const data = [{name: 'Page A', uv: 400, pv: 2400, amt: 2400}, ...];

const renderLineChart = (
  <LineChart width={400} height={400} data={data}>
    <Line type="monotone" dataKey="uv" stroke="#8884d8" />
  </LineChart>
);
mn98
@mn98
Hi all. I'm trying to put together a Slinky example using 'server sent events' but I'm hitting a few stumbling blocks. While I continue stumbling my way through, is anyone aware of any existing examples out there? Thanks!
Shadaj Laddad
@shadaj
@AlexITC you'll want to add an additional children: ReactElement* to the props definition of your external component to enable taking those as a curried parameter
@mn98 you might want to take a look at https://github.com/Team846/funky-dashboard, something I built a while ago with Slinky that uses server sent events as a simpler alternative to WebSockets (we needed to implement the server in Scala Native, so had to implement everything from scratch which made WebSockets hard to use)
mn98
@mn98
@shadaj thanks very much, I'll take a look! I got my example working this afternoon using Play+Slinky, but I have some odd behaviour with the browser hanging when I try to navigate away from my 'ticking clock' using the address bar.
mcallisto
@mcallisto

Hello @shadaj, I have the following question.
Is there a drier or more idiomatic way in Slinky to achieve the following:

def toOption[T](ot: T | Null): Option[T] = Option(ot.asInstanceOf[T])

var swi: Option[ScrollViewInstance] = None
val scrollView = ScrollView().withRef(nullableRef => swi = toOption(nullableRef))
swi.head.scrollToEnd()

That is, using the scrollToEnd method of the slinky.native.ScrollView component?

mn98
@mn98
Hi all! Is there a plan to support typed props for functional components in the @react style? Currently the docs suggest this isn't supported. This would help me consolidate quite a bit of duplicate code in the future. I can work around it for now, was just curious, thanks!
Peter Storm
@peterstorm
Hello! How can I specify which port I want the dev server to run on?
Noel Welsh
@noelwelsh
Peter Storm
@peterstorm
Cheers @noelwelsh, i'll try that!
Shadaj Laddad
@shadaj
@mcallisto typed props are a bit tricky for functional components since it's unclear what the props type of the functional component object should be; I feel like it might be okay to type the component as FunctionalComponent[Props[_]] but need to think a bit more about this
@mcallisto you might be able to simplify toOption a bit by adding T <: AnyRef, which should eliminate the need for the cast; unfortunately not much more that can be improved, but perhaps useRef could simplify the code a bit?
mn98
@mn98
@shadaj thanks for confirming re typed props, I can work around that. I’m finding Slinky to be a huge productivity boost. Are there any industrial use cases of this library yet?
Ramnivas Laddad
@ramnivas
@mn98 We have launched https://learnraga.com that is completely written in Slinky.
Anton Sviridov
@keynmol
wow that is very cool
mn98
@mn98
@ramnivas that is cool, indeed!
Griffin Rademacher
@griffin-radix_gitlab
What's the word on IntelliJ support lately? I was able to use the workaround (https://gitter.im/shadaj/slinky?at=5f44b861dfaaed4ef50a5029) to install the IntelliJ extension successfully for Slinky 0.6.5, but I can't get it to work with 0.6.6. I've tried using the version numbers 0.6.5+31-43e32880, 0.6.6, 0.6.6+1-83a94445, and 0.6.6+4-7d07b9a5 for the ijext Maven artifact with Slinky 0.6.6, but I only get a prompt to enable the extension with Slinky 0.6.5 and artifact version 0.6.5-*. I don't get the prompt that's supposed to come up according to the docs with either version of Slinky. Is this something wrong with my machine, or have others also not been able to use the IntelliJ extension with 0.6.6? (Also, I'm on IntelliJ 2020.1.1, but the problem showed up for me on 2020.2.2 as well)
mn98
@mn98
@griffin-radix_gitlab I've also had problems since I moved to 0.6.6, while the workaround had done the trick for me with 0.6.5. I'm just living with the red ink for the time being.
Alexis Hernandez
@AlexITC
If anyone can look into this issue, I'd appreciate it, I'm failing to get hot-reload working on the scalablytyped slinkydemos repo: ScalablyTyped/SlinkyDemos#33
Shadaj Laddad
@shadaj
@mn98 hmm, I'm looking at the recent publishing logs and it appears that something changed after version 0.6.5+15-fa93d141; before, the IntelliJ plugin was published under the name slinky-core-ijext_2.12 (and 2.13) but after that it's only been published under slinky-core_sjs0.6_2.12 (and 2.13)
Shadaj Laddad
@shadaj
@AlexITC hmm, what is the behavior you're seeing? Also are you using functional components? Those don't support hot reloading yet
Alexis Hernandez
@AlexITC
The behavior I see is a blank page where the js is supposed to be loaded, but no errors or content is displayed, those demos do use functional components but I never thought that was the potential cause because I have another project with functional components where hot reloading seems to work properly
indeed, I just verified hot reloading seems to work in such other project, which I created from the slinky template, and updated to use functional components
Alexis Hernandez
@AlexITC
on the linked PR, I feel the problem may be related to one of the webpack configs, but to be honest I'm not that familiar with webpack and the js side, I'm also a recent slinky adopter, and I'm still getting using to some pieces like hot reloading
Alexis Hernandez
@AlexITC
now that I think about it, it is possibly something different what I see on the functional components side, the hot reloading ends up refreshing the page when I believe it shouldn't, but, in any case, that's far better than no hot-reloading at all
Alexis Hernandez
@AlexITC
I have created shadaj/create-react-scala-app.g8#16 to illustrate that, I tried again, and hot reloading is working properly with functional components
philip andrew
@PhilAndrew
How to use an existing React library in my project? Such as https://www.npmjs.com/package/react-monaco-editor
philip andrew
@PhilAndrew
Is it something like:
@JSImport("resources/node_modules/monaco-editor", JSImport.Default)
@js.native
object MonacoEditor extends js.Object
philip andrew
@PhilAndrew
I think what I want after some research is scalablytyped and slinky as a simple demo github project for using one simple react component
1 reply
philip andrew
@PhilAndrew
A small demo project like this would be useful for me and it could also help the community
mn98
@mn98
Slinky + ScalablyTyped has been extremely productive for me. There are already Slinky flavoured examples under ScalablyTyped in github.
Shadaj Laddad
@shadaj
@AlexITC as I mentioned on the PR, hot reloading might work for functional components without hooks, but there's quite a bit of work that's needed to support those that do use hooks. So class components are the way to go if you want hot reloading for now unfortunately. For hot reloading not working in your own project, I agree that it's probably just a Webpack config issue. The best way to debug this is probably just compare against the config in the starter template.
1 reply
@griffin-radix_gitlab @mn98 so I have a hunch why IntelliJ support broke with 0.6.6. What version of Scala are you using? Does the plugin show up if you use 2.13 instead?
mn98
@mn98
@shadaj I'm using scala 2.13.3 and:
    "me.shadaj" %%% "slinky-core" % "0.6.6",
    "me.shadaj" %%% "slinky-web" % "0.6.6",
    "me.shadaj" %% "slinky-core-ijext" % "0.6.6",
philip andrew
@PhilAndrew

I don't know if this is a Slinky or ScalablyTyped question but I tried to get React Monaco Editor component to work and yes it works but I have to construct it with "ReactMonacoEditor.withProps(MonacoEditorProps().set("height", "500").set("width", "500"))"

Why? Is there a more normal way to construct it?

I made demo project here https://github.com/PhilAndrew/ReactSlinkyScalablyTyped

With the file of that code here https://github.com/PhilAndrew/ReactSlinkyScalablyTyped/blob/master/react-leaflet/src/main/scala/demo/App.scala

Øyvind Raddum Berg
@oyvindberg
@PhilAndrew how about ReactMonacoEditor.height(500)...?
Øyvind Raddum Berg
@oyvindberg
@PhilAndrew check this video https://scalablytyped.org/docs/flavour#slinky to see typical usage
Griffin Rademacher
@griffin-radix_gitlab
@shadaj I'm using scala 2.13.2
sidnt
@sidnt
umm. why is the slinky hot module needed? because any writes to the projectA-fastopt.js file (by ~fastOptJS task) is automatically picked and deployed by expo to the devices, eg in my case, to android and to the web.
Shadaj Laddad
@shadaj
@sidnt the hot module enables state preservation across reloads; any state in your class components will be serialized and loaded back into the app once the new code loads
Peter Storm
@peterstorm
Hello, I have tried following the tutorial for making a functional component, but when I try to add it to my App component, there is an error saying "Reassignment to val". I'm on newest intelliJ used the slinky g8 template
Peter Storm
@peterstorm
Ah, somehow I got the slinky extension popup to come, didnt have that before, and now it seems to work
Peter Storm
@peterstorm
How about style-components, I can't seem to get that to work with "me.shadaj" %%% "slinky-styled-components" % "0.1.0"
```
[warn]  Note: Unresolved dependencies path:
[error] stack trace is suppressed; run 'last update' for the full output
[error] (update) sbt.librarymanagement.ResolveException: Error downloading me.shadaj:slinky-styled-components_sjs1_2.13:0.1.0
[error]   Not found
[error]   Not found
[error]   not found: C:\Users\phn\.ivy2\local\me.shadaj\slinky-styled-components_sjs1_2.13\0.1.0\ivys\ivy.xml
[error]   not found: https://repo1.maven.org/maven2/me/shadaj/slinky-styled-components_sjs1_2.13/0.1.0/slinky-styled-components_sjs1_2.13-0.1.0.pom
[error] Total time: 1 s, completed 07-10-2020 16:58:47
sidnt
@sidnt
macros are going to be a significant change in scala3. and slinky uses a lot of macros for providing the jsx like syntax. how will this fare with scala3?
Noel Welsh
@noelwelsh
I'm not familiar with the details of Slinky's macros but from using the library I don't think what they do will be difficult to port to Dotty.
Shadaj Laddad
@shadaj
@peterstorm I think slinky-styled-components doesn't support 2.13, but PRs to add support are welcome!