sidnt / proden

prog ram de sign n otes
0 stars 0 forks source link

scalajs <=> js interop #26

Open sidnt opened 4 years ago

sidnt commented 4 years ago

There's an API, iow, a contract.

An API has a interface and an implementation. These can literally be the same thing, or the interface can be decoupled from the implementation. Corresponding example - a concrete scala object with a fully defined api vs a trait definition, and its implementation.

Wrt scalajs, the implementation, might be in js or in sjs. The corresponding terms: jsNative and non-jsNative.

A jsNative api is implemented in js. A non-jsNative api, is implemented in scalajs, hence, aka, sjsDefined.

sjsDefined non-jsNative apis can be implemented in scala, but have restrictions.

For an API with jsNative implementation, in its corresponding sjs facade, all concrete definitions must have =js.native as body