Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@okta/okta-auth-js and @okta/okta-react modules not displaying all modules fields/methods necessary for actual use. #598

Open
ackory opened this issue Jan 24, 2024 · 4 comments

Comments

@ackory
Copy link

ackory commented Jan 24, 2024

Hi,

I'm hoping I can get some help here. I am trying to integrate okta authentication with my scala js application. I was recommended to use scalablytyped to help with generating the javascript facades needed. It seems though that while I can get the top level modules working with both @okta/okta-auth-js and @okta/okta-react, I am unable to view or use all methods/properties for the various classes and objects. It seems most are missing.

As an example, the typings.oktaOktaAuthJs.mod.OktaAuth module does not have all the fields/methods available described in the within the npm okta webpage. When I use the js.Object.getOwnPropertyNames method and pass the OktaAuth instantiated object as an argument to it, I am able to view all the fields that are available to the object, but not all of them are available (or displaying) to the actual object when I attempt to use them through the scalablytyped facades.

This is just one example, but I am wondering if I did something wrong when integrating scalablytyped to my application. It seemed to have worked fine, but the missing modules will prevent me from really using this. I'll have to manually type in the js facades, but I was hoping to avoid that. It seems like it should work and provide everything necessary to get okta to function.

Here is my build file with the js settings if that helps:

.jsSettings(
//Compile / scalaSource := baseDirectory.value / "src",
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "2.1.0",
"com.github.japgolly.scalajs-react" %%% "core" % "2.1.1",
"com.github.japgolly.scalajs-react" %%% "extra" % "2.1.1",
"com.github.japgolly.scalacss" %%% "core" % "1.0.0",
"com.github.japgolly.scalacss" %%% "ext-react" % "1.0.0",
"org.gnieh" %%% "fs2-data-csv" % "1.7.1",
"org.gnieh" %%% "fs2-data-csv-generic" % "1.7.1"
),
versionPolicyIntention := Compatibility.BinaryAndSourceCompatible,
scalaJSUseMainModuleInitializer := true,
jsEnv := new org.scalajs.jsenv.jsdomnodejs.JSDOMNodeJSEnv(),
scalaJSLinkerConfig ~= {
_.withSourceMap(true).withModuleKind(ModuleKind.CommonJSModule)
},
Compile / npmDependencies ++= Seq(
"react" -> "17.0.2",
"react-dom" -> "17.0.2",
"react-router-dom" -> "6.21.3",
"react-scripts" -> "5.0.1",
"@types/react" -> "17.0.2",
"@types/react-dom" -> "17.0.2",
"snabbdom" -> "0.5.3",
"@okta/okta-auth-js" -> "7.5.0",
"@okta/okta-react" -> "6.7.0"
),
useYarn := true,
stFlavour := Flavour.ScalajsReact,
stUseScalaJsDom := false
).jsConfigure { project => project.enablePlugins(ScalaJSBundlerPlugin, ScalaJSPlugin, ScalablyTypedConverterPlugin) }

My apologies if I sound confusing anywhere. Please let me know if I can clarify anything to make better sense of my issue.

Thank you and I appreciate any help you can provide.

@mlvn23
Copy link

mlvn23 commented Jan 25, 2024

Look at the resulting class and/or src_managed in the target directory with your editor

@ackory
Copy link
Author

ackory commented Jan 25, 2024

Look at the resulting class and/or src_managed in the target directory with your editor

Thanks for the response. I had a discussion on the scala js discord server on this issue. Looks like the okta library is only exposing the top level modules with scalablytyped. I am hoping this can be fixed at some point, but as for now it was recommended for me to build the js facades manually. I was able to successfully do that and get okta to work.

Thanks.

@oyvindberg
Copy link
Collaborator

Likely related to #488 . ST picks out a subset of typescript code in the library, I intend to not do that anymore.

@ackory
Copy link
Author

ackory commented Jan 29, 2024

Likely related to #488 . ST picks out a subset of typescript code in the library, I intend to not do that anymore.

Thanks. I'm assuming it's probably a large task and would take some time. For now I am relying on creating facades. Hope to easily integrate these changes soon. Would be very useful to seamlessly use npm packages in scala js without missing modules.

Really appreciate your work on all this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants