Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 03 20:54
    vinjana commented #597
  • Oct 03 19:32
    vinjana commented #597
  • Oct 03 18:30
    shadaj commented #597
  • Oct 03 13:06
    vinjana opened #597
  • Sep 28 03:59

    shadaj on create-portal-key-parameter

    (compare)

  • Sep 28 03:59

    shadaj on main

    Support the `key` parameter in … (compare)

  • Sep 28 03:59
    shadaj closed #568
  • Sep 28 03:59
    shadaj closed #594
  • Sep 27 22:44
    shadaj milestoned #596
  • Sep 27 22:44
    shadaj labeled #596
  • Sep 27 22:44
    shadaj commented #596
  • Sep 22 22:56
    evbo opened #596
  • Sep 16 16:13
    evbo commented #569
  • Sep 16 15:56
    evbo commented #569
  • Sep 15 20:06
    scala-steward opened #595
  • Sep 12 05:43
    cloudflare-pages[bot] commented #594
  • Sep 12 05:40
    cloudflare-pages[bot] commented #594
  • Sep 12 05:36
    cloudflare-pages[bot] commented #594
  • Sep 12 05:36
    shadaj synchronize #594
  • Sep 12 05:36

    shadaj on create-portal-key-parameter

    No longer using Netlify (compare)

Alexis Hernandez
@AlexITC
very likely, isn't it being generated already by scalablytyped?
nkgm
@nkgm
I'm looking into that, but would I have to remove slinky.reactrouter completely and use the facade generated by scalablytyped in its place?
Alexis Hernandez
@AlexITC
I don't know about slinky.reactrouter but scalablytyped generated facades generally work quite well
Øyvind Raddum Berg
@oyvindberg
there's a pretty high chance you can mix and match the two approaches, since they both use the same javascript in the end
whether you want to keep two approaches is obviously another question :)
Peter Storm
@peterstorm
Im using the scalablytyped react router stuff with great success :)
nkgm
@nkgm
Just wanted to say thanks, ST works remarkably well so far :)
Peter Storm
@peterstorm
Yeah, irs an amazing piece of kit, that you get access to those libraries in Scala like that
Øyvind Raddum Berg
@oyvindberg
glad to hear it :)
Peter Storm
@peterstorm
How many of the normal libraries can you use in ScalaJS/Slinky by the way? Can i use cats types and cats effect, fs2?
Øyvind Raddum Berg
@oyvindberg
All of those work
Peter Storm
@peterstorm
Can i use http4s clients in scalajs? Do they somehow get translated to real js?
Anton Sviridov
@keynmol
Nope, http4s doesn't have a sjs module AFAIK
You can use sttp
Peter Storm
@peterstorm
Cheers :)
nkgm
@nkgm
Is there a way to spread props like so <table {...myProps}>as you do in React?
Naftoli Gugenheim
@nafg
When would you need to?
Yoichi Yamaguchi
@yyo1

Hi,
I'm using IntelliJ 2020.2 on MacOS and trying to run the example "Slinky for React" in slinky.dev/docs/resources.

  • The application runs successfully on console with sbt command.
  • But InttelliJ doesn't recognize @react annotation.
  • I added this to the library dependencies and slinky-core-ijext_2.13-0.6.6.jar exsists in External Libraries.
  • I have uncheck and check "Enable loading external extensions" at IntelliJ > Preferences > Languages & Frameworks > Scala > Extensions, but there is no extension in the list.

    How can I enable Slinky support?

Gabor Juhasz
@gjuhasz86
@yyo1 I was struggling with this too, I noticed that version 0.6.6 of the extension is not recognized by IJ. But I manually added 0.6.5 and it works with that
nkgm
@nkgm
@nafg it's a useful React idiom when interfacing with existing components eg:
 const tableInstance = useTable({ columns, data })

 const {
   getTableProps,
   getTableBodyProps,
   headerGroups,
   rows,
   prepareRow,
 } = tableInstance

 return (
   // apply the table props
   <table {...getTableProps()}>
...
Yoichi Yamaguchi
@yyo1
@gjuhasz86 Thanks for your information. But unfortunately, it didn't suit my environment (Scala 2.13)...
Gabor Juhasz
@gjuhasz86
@yyo1 note that you don't have to use slinky version 0.6.5.
So I'm using Slinky 0.6.6 with IJ extension version 0.6.5
Naftoli Gugenheim
@nafg
@nkgm in javascript it's very useful because everything is just a hash. But when is it useful in Scala?
In Scala a component typically defines its props as a single type, such as a custom case class
At least in scalajs-react, my understanding was that Slinky does it that way too
Or do you mean for using a component defined in javascript from scala?
In that case it still comes down to how the facade is typed
My point is, if you can explain what you want to do in terms of particular scala types, I can tell you how to achieve it
nkgm
@nkgm
It's the API of react-table from this example.
nkgm
@nkgm
Ok so in this case I got lucky cause it's only attribute pairs. This did the trick:
  def propsToAttrPairs(props: js.Object) =
    js.Object.entries(props).map { e =>
      new AttrPair(e._1, e._2.asInstanceOf[String])
    }
...
  table(propsToAttrPairs(tableProps).toList: _*)(
...
Peter Storm
@peterstorm
Does anyone know what the type parameter to createRef would be, if I want to create a Ref for a MaterialUI TextField?
finnmerlett
@finnmerlett
Does anyone know why slinky decided to do away with the <. prefixing for components? I quite liked it, is there a way to add it in?
Naftoli Gugenheim
@nafg
Anyone using Slinky in scala 3.0.0-M1?
scalajs-react in withDottyCompat mode has lots of issues
mostly because of the overly complex types I think
but also because of a bug
Øyvind Raddum Berg
@oyvindberg
I've just started compiling to slinky on 3.0.0-M1 @nafg , and I'm curious how much works. I guess the lack of macros is going to be quite noticeable :/
Shadaj Laddad
@shadaj
you might be able to get some basic things working right now by disabling hot-reloading (and all the associated Reader/Writer implicits) and using either functional components or the non-`@react` class component style
I think Reader/Writers should be relatively straightforward to port to Scala 3, which would go a long way since that would unlock class components and functional components without @react which isn't too bad an experience
porting the macro annotations will be the most complicated bit, I'm not sure what's the status of those right now
Øyvind Raddum Berg
@oyvindberg
macro annotations are entirely gone from what I understand, hopefully here are some other tools we can use
Naftoli Gugenheim
@nafg
@shadaj even without @react style it required an implicit that summoned a macro
I don't get why Scala.is isn't expressive enough to create class components like in typescript
Peter Storm
@peterstorm
How can I memoize an api call that returns alot of stuff and saves in state? I have a page where I search profiles up, and put the result in state. Then I wanna use react router to go to a specific profile page, to see more detailed information. But when the user the uses the 'back' action, I want the search results to still be there. Is that possible?
Peter Storm
@peterstorm
Oh, and I’m using hooks
Alexis Hernandez
@AlexITC
I'd create a cached service, and you use that instance for the whole app, on how to store it, you can start with a simple var and go from there, I think that scalaz had something for that, it is likely cats does as well.
Peter Storm
@peterstorm
cached service?
Alexis Hernandez
@AlexITC
for example, you can have your normal service that invokes your API, and another implementation depending on such service but handling the cache
Peter Storm
@peterstorm
But I just want react to save the stuff it gets back from my API call? Cant it do that, in context, or something?