oyvindberg on v1.0.0-beta41
oyvindberg on gh-pages
Deploy website Deploy website … (compare)
oyvindberg on master
Update coursier to 2.1.0-RC4 (#… (compare)
oyvindberg on master
Update scalatest to 3.2.15 (#51… (compare)
oyvindberg on master
Update sbt-tpolecat to 0.4.2 (#… (compare)
oyvindberg on master
release snapshots disable extension methods - in… ImportTypingsGenSources: Add `o… (compare)
oyvindberg on mui5-support
ImportTypingsGenSources: Add `o… (compare)
oyvindberg on mui5-support
tree shaking: mui forbids diggi… (compare)
oyvindberg on master
Update sbt-assembly to 2.1.0 (#… (compare)
oyvindberg on master
Update coursier to 2.1.0-RC3-1 … (compare)
oyvindberg on master
Update sbt-bloop to 1.5.6 (#507) (compare)
oyvindberg on mui5-support
ignore `OverridableStringUnion`… (compare)
oyvindberg on mui5-support
improve component variant naming (compare)
oyvindberg on mui5-support
trim code release snapshots (compare)
oyvindberg on master
scalajs-react: don't overload `… (compare)
oyvindberg on master
Avoid superfluous `T & Object` react: add a `Props` type alias scalajs-react: add syntax to ap… and 3 more (compare)
oyvindberg on mui5-support
limit mangled objects to 5k mem… mapped indices in type mappings… remove a source of irritating t… and 4 more (compare)
oyvindberg on master
Update sbt-scalafmt to 2.5.0 (#… (compare)
oyvindberg on master
Update coursier to 2.1.0-RC2 (#… (compare)
oyvindberg on true-literal-and-union-types
True literal types and union ty… (compare)
@targetName
Hi all. I'm getting this._config is undefined
when using Bootstrap Carousel via Scalablytyped. Is this a known issue? How can I resolve it?
I tried all the imports I could think of (e.g. typings.bootstrap.mod.Carousel
, currently I'm trying to use
import typings.bootstrap.jsDistCarouselMod.{default => Carousel}
new Carousel("carouselId") // Also tried new Carousel("carouselId", PartialOptions())
In the build.sbt
I have these NPM deps (useYarn
is true
):
"@popperjs/core" -> "2.11.6", // bootstrap dependency
"bootstrap" -> "5.2.3",
"@types/bootstrap" -> "5.2.6"
Thanks!
_config
should have come from. One thing that may help may be to touch typings.bootstrap.bootstrapRequire
first in your code, so it includes the whole thing
Thanks for the answer. Yeah I did include typings.bootstrap.bootstrapRequire
but it doesn't help. From the JS code I see:
constructor(element, config) {
super(element, config)
this._interval = null
this._activeElement = null
this._isSliding = false
this.touchTimeout = null
this._swipeHelper = null
this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element)
this._addEventListeners()
...
}
and then
_addEventListeners() {
if (this._config.keyboard) {
...
}
where it fails to get the this._config
value. But it should be set in super(element, config)
if I'm not mistaken.
BaseComponent
constructor we have this._config = this._getConfig(config)
and the _getConfig
method does some magic which should default the config if it's not present... I'll try to figure out why it doesn't get set once I have some time. Thanks for the pointers :)
Hi, trying to get ScalablyTyped to generate scala.js types for Realm(https://www.mongodb.com/docs/realm/sdk/react-native/quick-start/) for a mobile project of mine.
I've done the following
Added addSbtPlugin("org.scalablytyped.converter" % "sbt-converter" % "1.0.0-beta40")
to plugins.sbt
Added the following to build.sbt
enablePlugins(ScalablyTypedConverterPlugin)
Compile / npmDependencies ++= Seq(
"@realm/react" -> "0.4.1"
)
stFlavour := Flavour.SlinkyNative
useYarn := true
I get a hundreds of warnings of the type below
[warn] QualifyReferences.scala:72 msg Couldn't qualify React.ReactNode [thread => 291, project => app, ms => 9416, phase => typescript, scope => TreeScope(TsParsedFile() / TsDeclModule(@realm/react/dist/RealmProvider) / TsDeclTypeAlias(ProviderProps) / TsTypeIntersect() / TsTypeObject() / TsMemberProperty(children) / TsTypeRef()), id => @realm/react]
[warn] TsTreeScope.scala:84 Cannot resolve TsQIdent(IArray(TsIdentSimple(React), TsIdentSimple(FC))) [thread => 291, project => app, ms => 9416, phase => typescript, scope => TreeScope(TsParsedFile() / TsDeclModule(@realm/react/dist/UserProvider) / TsExport() / Tree() / TsDeclVar(UserProvider) / TsTypeRef()), id => @realm/react]
What could I be doing better?
Last Q for the day
Running things further with stc @realm/react @types/react
I get to errors like so
[error] 2022-12-30T09:40:56.313209Z Phase3Compile.scala:152 err Compiling realm (46 Scala sources)
[E] [E2] src/main/scala/typings/realm/Realm.scala:1552:10
[E] UUID is already defined as type UUID
[E] L1552: type UUID = typings.bson.mod.UUID
[E] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[E] [E1] src/main/scala/typings/realm/Realm.scala:1528:10
[E] Decimal128 is already defined as type Decimal128
[E] L1528: type Decimal128 = typings.bson.mod.Decimal128
[E] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[E] src/main/scala/typings/realm/Realm.scala: L1528 [E1], L1552 [E2]
Ignoring realm seems not an option as the typings generated are have js.Any everywhere. What are my options here?
{
"dependencies": {
"@realm/react": "^0.4.1",
"@types/react": "^18.0.26",
"typescript": "^4.9.4"
}
}
var callback: js.UndefOr[
js.Function3[
/* value */ Double | String,
/* index */ Double,
/* values */ js.Array[Double | String],
js.UndefOr[String | Double | Null]
]
] = js.undefined
@eweise You can pass a Scala Function like:
val NestedTickOptions = new NestedTickOptions {
callback = (value, index, values) => 1.0
}
since there are some implicit conversions from scala.FunctionN
to js.FunctionN
in Scala.js
Since NestedTickOptions
is a trait with var
s having js.undefined
as default you override the default with callback =
Or you can use the Scalablytyped builder:
val NestedTickOptions = NestedTickOptions().setCallback((value, index, values) => 1.0)
hello team.I add"popmotion": "~8.7.1"
to dependencies
After conversion, I want to use
import typings.popmotion.tweenMod.*
import typings.popmotion.tweenTypesMod.TweenProps
default(TweenProps().setFrom(0).setTo(100)).start()
but i found
18:55:30 [vite] Internal server error: Failed to resolve import "popmotion/lib/animations/tween" from "target/scala-3.1.3/testProject-fastopt/per.com.testProject.pages.HomeView$.js". Does the file exist?
Plugin: vite:import-analysis
File: /Users/computer/MyProject/testProject/target/scala-3.1.3/testProject-fastopt/per.com.testProject.pages.HomeView$.js
1 | "use strict";
2 | import * as $i_popmotion$002flib$002fanimations$002ftween from "popmotion/lib/animations/tween";
| ^
3 | import * as $j_internal$002db18e8fdf434ff99927b6d0c4b454a8a67b95d3c9 from "./internal-b18e8fdf434ff99927b6d0c4b454a8a67b95d3c9.js";
4 | import * as $j_internal$002db28b7af69320201d1cf206ebf28373980add1451 from "./internal-b28b7af69320201d1cf206ebf28373980add1451.js";
I think it is because the imported file in the generated js file is not the original js file but the d.ts file
Is there any way to solve this problem?