Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Oct 05 23:40

    oyvindberg on generalize-typerefs

    Generalize type references to c… (compare)

  • Oct 05 23:22

    oyvindberg on generalize-typerefs

    Generalize type references to c… (compare)

  • Oct 05 22:17

    oyvindberg on generalize-typerefs

    Generalize type references to c… (compare)

  • Oct 04 23:37

    oyvindberg on v1.0.0-beta27

    (compare)

  • Oct 04 23:36

    oyvindberg on master

    fixup release script (compare)

  • Oct 04 23:36

    oyvindberg on gh-pages

    Deploy website Deploy website … (compare)

  • Oct 04 23:06

    oyvindberg on sbt14

    (compare)

  • Oct 04 23:06

    oyvindberg on master

    Bump sbt to 1.4.0 (Fix #168) (#… (compare)

  • Oct 04 23:02

    oyvindberg on sbt14

    Bump sbt to 1.4.0 (Fix #168) (compare)

  • Oct 04 12:48

    oyvindberg on sbt14

    (compare)

  • Oct 04 11:35

    oyvindberg on master

    Fixup release script (compare)

  • Oct 04 11:27

    oyvindberg on master

    Fixup release script (compare)

  • Oct 04 11:17

    oyvindberg on gh-pages

    Deploy website Deploy website … (compare)

  • Oct 04 11:13

    oyvindberg on master

    Add release script (compare)

  • Oct 04 11:12

    oyvindberg on v1.0.0-beta26

    Add release script (compare)

  • Oct 02 23:53

    oyvindberg on master

    Remove ClassAnnotation/MemberAn… (compare)

  • Oct 01 18:43

    oyvindberg on sbt14

    Bump sbt to 1.4.0-RC2 (Fix #168) (compare)

  • Sep 30 22:12

    oyvindberg on master

    scalafmt bug (compare)

  • Sep 30 21:56

    oyvindberg on master

    it's time. let's lose the infix (compare)

  • Sep 30 20:02

    oyvindberg on mui4

    Remote ClassAnnotation/MemberAn… mui4 wip (compare)

mushtaq
@mushtaq
Yes! My main pain point right now is mentally mapping the generated Scala types with .d.ts types, so that I can emulate the code from the TS ecosystem.
With js.native val/def, it gets a lot simpler.
kerr
@hepin1989
@mushtaq Yes, I am currently learning Typescript and I think Scala-js in dotty will be very nice with ScalablyType which nearly mapping 1:1 from ts to scala-js:)
Øyvind Raddum Berg
@oyvindberg
@mushtaq that translation/mapping is pretty much the essence of and the most complicated part of this project. I'm hoping that top-level (dotty) @js.native val/def can allow us to align the currently seemingly random choice of outputting packages or objects, and some usage of ^ objects, in sum leaving a clearer and more documentable mapping. From there I think only javascript modules remain as the most visible barrier on the library level. There will be more complexities as you go from there and down into specific data types with their peculiar encodings, but that's unavoidable
@hepin1989 enjoy the ride, Typescript has grown into an immensely interesting language of its own, far surpassing scala in some ways, and sorely lacking in others
mushtaq
@mushtaq

From there I think only javascript modules remain as the most visible barrier on the library level

@oyvindberg what do you mean by this? are you referring to integration with ES Modules in some form?

Øyvind Raddum Berg
@oyvindberg
Well I just meant barrier to understanding, my gut feeling is that very few can easily navigate the current translation of modules
mushtaq
@mushtaq
I agree.
przemyslaw wierzbicki
@pshemass
@oyvindberg I've spent sometime trying to figure why Button is not parse properly for material-ui ScalablyTyped/Converter#204 I had some results here. It looks like all props for components are parsed correctly. please review it.
Alexis Hernandez
@AlexITC
Any idea about this error? I'm failing to grab the material-ui example properly
[error] ModuleNotFoundError: Module not found: Error: Can't resolve 'jss-nested' in '/home/dell/pwa/target/scala-2.13/scalajs-bundler/main/node_modules/@material-ui/core/styles'
sidnt
@sidnt
when, in sbt, a project depends only on let's say react native, why does the target/..../scalajs-bundler directory contains a whole lot of node modules?
sidnt
@sidnt
seems a bit overkill, if only a handful of typings are required, why does the converter generate typings for all libraries...
Øyvind Raddum Berg
@oyvindberg
@AlexITC seems somewhat arbitrary. I'd first clean in sbt, next clean the npm/yarn cache, third try to add that dependency explicitly
11 replies
@sidnt transitive dependencies I suppose. try to yarn install react-native in a clean folder and see what shows up, probably quite a bit
@sidnt if only a handful of typings are required I agree that only a handful should be generated. The problem is that you and I might have two different opinion of which typings are required
so for that reason the plugin takes all dependencies mentioned in package.json which has typescript definitions and converts them along with their transitive dependencies
the idea is that the ones in package.json are the ones you have added yourself and hence care about, and transitive dependencies are... necessary. You have the option of using stIgnore to explicitly ignore some libraries
sidnt
@sidnt
i was wondering @oyvindberg, if there was an example that used just the raw react-native typings to generate a barest bone hello world example, without slinky, or any other wrapper/dsl on the raw react-native typings for that matter.
Øyvind Raddum Berg
@oyvindberg
I think this is one of the where if you have to ask, it's probably a bad idea :D
So no, there aren't any examples, but you would do as you would do it in Javascript without JSX
and with react native you can delete all the intrinsic stuff
but you suddenly have to care a lot about whether a given component is a class component or a function component and so on
sidnt
@sidnt
@oyvindberg so you mean to say that we can't get easily by, by using just the typings that ScalablyTypedConverterPlugin gives us ootb, for @types/react-native from the ts world?
sidnt
@sidnt
what additionals does slinky give us that ^ does not?
Øyvind Raddum Berg
@oyvindberg
sidnt
@sidnt
thanks for the lead.
Øyvind Raddum Berg
@oyvindberg
so both javascript and typescript need special compiler support to write jsx, whereas in scala we need to solve that problem in a library instead. There is both the problem of rewriting to use React.createElement, threading through types for props, and make it nice enough to use. It's actually a pretty difficult exercise. Slinky does it in part by using macros to generate some boilerplate code
Alexis Hernandez
@AlexITC
@oyvindberg this is my last try to get the hot-reload working but for some reason it doesn't, right now I have no idea what I could be missing, thanks! ScalablyTyped/SlinkyDemos#33
sidnt
@sidnt
:point_up: October 1, 2020 2:47 AM
and since JSX/slinky also gives conveniences for easy construction of a react ui tree of nested components, we also have to care about that i suppose, if going the raw way. correct?
Øyvind Raddum Berg
@oyvindberg
sure, React.createElement lets you pass children
Øyvind Raddum Berg
@oyvindberg
I published beta26 now. If anyone has seen binary compatibility issues this should fix it, https://github.com/ScalablyTyped/Converter/releases/tag/v1.0.0-beta26
ammonite with the semi-new intellij integration which I just tried for the first time has become an amazing experience for scripting! https://github.com/ScalablyTyped/Converter/blob/master/release.sc
sidnt
@sidnt
slinky already gives a nice DSL that wraps the upstream javascript into its facades. why would one want to go with scalablytyped with a slinky flavour? is it that scalablytyped replaces the lastmile facades that slinky uses, with the ones it generates? if so, what are the advantages of this approach?
Antoine Doeraene
@sherpal
With scalablytyped, you can use the whole react ecosystem and you get typings and a nice slinky wrapper to it. Want a color picker? No problem, simply find a node module with one and add it to your npm/yarn dependencies.
Øyvind Raddum Berg
@oyvindberg
@sidnt there isnt any overlap in what slinky provides and what ST provides
Øyvind Raddum Berg
@oyvindberg
Also released https://github.com/ScalablyTyped/Converter/releases/tag/v1.0.0-beta27 with (only) support for sbt 1.4.x
Alexis Hernandez
@AlexITC
I got a weird error while trying to include the detect-browser package, any ideas:
[error] ZincCompiler.scala:199 three errors found [project => cazadescuentos-app, ms => 88920]
[error] Phase3Compile.scala:149 Compilation failed: -Xplugin:/home/dell/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-js/scalajs-compiler_2.13.3/1.1.0/scalajs-compiler_2.13.3-1.1.0.jar, -encoding, utf-8, -feature, -g:notailcalls, -language:implicitConversions, -language:higherKinds, -language:existentials, -bootclasspath, /home/dell/.sdkman/candidates/java/8.0.265-open/jre/lib/resources.jar:/home/dell/.sdkman/candidates/java/8.0.265-open/jre/lib/rt.jar:/home/dell/.sdkman/candidates/java/8.0.265-open/jre/lib/sunrsasign.jar:/home/dell/.sdkman/candidates/java/8.0.265-open/jre/lib/jsse.jar:/home/dell/.sdkman/candidates/java/8.0.265-open/jre/lib/jce.jar:/home/dell/.sdkman/candidates/java/8.0.265-open/jre/lib/charsets.jar:/home/dell/.sdkman/candidates/java/8.0.265-open/jre/lib/jfr.jar:/home/dell/.sdkman/candidates/java/8.0.265-open/jre/classes:/home/dell/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.3/scala-library-2.13.3.jar:/home/dell/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.3/scala-library-2.13.3.jar:/home/dell/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.3/scala-library-2.13.3.jar, -classpath, /home/dell/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.3/scala-compiler-2.13.3.jar:/home/dell/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.13.3/scala-reflect-2.13.3.jar:/home/dell/.cache/coursier/v1/https/repo1.maven.org/maven2/org/jline/jline/3.15.0/jline-3.15.0.jar:/home/dell/.cache/coursier/v1/https/repo1.maven.org/maven2/net/java/dev/jna/jna/5.3.1/jna-5.3.1.jar:/home/dell/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-js/scalajs-library_2.13/1.1.0/scalajs-library_2.13-1.1.0.jar:/home/dell/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-js/scalajs-compiler_2.13.3/1.1.0/scalajs-compiler_2.13.3-1.1.0.jar:/home/dell/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-js/scalajs-library_2.13/1.0.0/scalajs-library_2.13-1.0.0.jar:/home/dell/.cache/coursier/v1/https/repo1.maven.org/maven2/me/shadaj/slinky-web_sjs1_2.13/0.6.5/slinky-web_sjs1_2.13-0.6.5.jar:/home/dell/.cache/coursier/v1/https/repo1.maven.org/maven2/com/olvind/scalablytyped-runtime_sjs1_2.13/2.1.0/scalablytyped-runtime_sjs1_2.13-2.1.0.jar:/home/dell/.cache/coursier/v1/https/repo1.maven.org/maven2/me/shadaj/slinky-core_sjs1_2.13/0.6.5/slinky-core_sjs1_2.13-0.6.5.jar:/home/dell/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-js/scalajs-dom_sjs1_2.13/0.9.8/scalajs-dom_sjs1_2.13-0.9.8.jar:/home/dell/.cache/coursier/v1/https/repo1.maven.org/maven2/me/shadaj/slinky-readwrite_sjs1_2.13/0.6.5/slinky-readwrite_sjs1_2.13-0.6.5.jar [Error] /home/dell/projects/mine/cazadescuentos-opensource/pwa/target/streams/_global/stImport/_global/streams/sources/n/node/src/main/scala/typings/node/Buffer.scala:6: object BigInt is not a member of package typings.std, [Error] /home/dell/projects/mine/cazadescuentos-opensource/pwa/target/streams/_global/stImport/_global/streams/sources/n/node/src/main/scala/typings/node/fsMod/BigIntStats.scala:3: object BigInt is not a member of package typings.std, [Error] /home/dell/projects/mine/cazadescuentos-opensource/pwa/target/streams/_global/stImport/_global/streams/sources/n/node/src/main/scala/typings/node/processMod/global/NodeJS/HRTime.scala:3: object BigInt is not a member of package typings.std [thread => 234, project => cazadescuentos-app, ms => 89162, phase => build, id => d3-path, flavour => SlinkyFlavour]
Alexis Hernandez
@AlexITC
it seems that upgrading from beta25 to beta27 solved the issue
Robert Walker
@olofwalker
@oyvindberg Awesome work with Beta27, I had about 10 small things to fix after upgrading, way better with the builder pattern than named parameters.
Øyvind Raddum Berg
@oyvindberg
thanks @olofwalker ! :)
hey I'm gonna give an online talk about ST, pretty short (30 mins) and with QA afterwards: https://www.meetup.com/Melbourne-Scala-User-Group/events/273741824
Carlos Quiroz
@cquiroz
ah great, will it be available to watch offline?
Robert Walker
@olofwalker
Yea, what @cquiroz said
Øyvind Raddum Berg
@oyvindberg
yeah not sure about that, it doesnt look like the previous events are
Alexis Hernandez
@AlexITC
Hi again, I have a weird issue with my react-setup, which is based on the slinkydemos, I have defined a route (/guia) that's handled by the react-router, but, if I reload the page, I get redirected to the index instead of the router being picking the proper view, any suggestions? this prevents me from sharing a specific URL as it will get always redirected to the index, I know I can write the logic by myself but I'd expect this could be handled by the router, thanks, (code)
Øyvind Raddum Berg
@oyvindberg
@AlexITC better read up on the react-router docs, I think this is a very common situation. One easy way to fix it is to use hash routes instead but then urls are a bit uglier
Alexis Hernandez
@AlexITC
I believe is a common situation but I haven't found anything until now, I already read the official react-router docs, what I haven't tried is to check their official example, possibly it doesn't suffer from that.
Øyvind Raddum Berg
@oyvindberg
Note that the solution is quite probably on the server side. You need to serve your index.html for all the possible frontend routes somehow in the backend. for webpack-dev-server (which the slinky demos repo uses for local dev) see this https://webpack.js.org/configuration/dev-server/#devserverhistoryapifallback . If you have that seemingly working I would just console.warn(window.location) each render loop and see why react-router is unable to match. There are also further adjustments you can make in the react router configuration, like basePath
Carlos Quiroz
@cquiroz
Yeah we do exactly that on web pack dev server and I production we do mappings on nginx to get all urls to go to “/“
Alexis Hernandez
@AlexITC
I already do that, I came from Angular where such patterns just worked, I have already provided the fallback option to webback/nginx, otherwise, the path would result in a not found error, printing the location on each render sounds like a good idea, I'll investigate more