Skip to content

Releases: ScalablyTyped/Converter

1.0.0-beta10 - Added CLI tool, a bunch of conversion improvements

23 Apr 18:02
Compare
Choose a tag to compare

Full changelog

  • Added CLI version
  • Added ability for CLI version to convert type definitions for a local Typescript project, including all dependencies, so that you can experiment with or start migrating to Scala.js without starting over if you already have a typescript project. This feature is experimental.
  • Loads of bugfixes and more supported Typescript syntax

Contributors

 26  Øyvind Raddum Berg

1.0.0-beta9 - Improvements of plugin and conversion

23 Apr 18:01
Compare
Choose a tag to compare

Full changelog

  • Improved integration with scalajs-bundler, hopefully for the last time.
  • Fixed handling of modules with explicit /index in the module name. This fixes babylonjs and probably other libraries.
  • Generate @ScalaJSDefined traits in the presence of a member starting with $.

Contributors

11  Øyvind Raddum Berg
 2  Ben Hutchison

1.0.0-beta8 - Full windows support, better performance

23 Apr 18:00
Compare
Choose a tag to compare

Full changelog

Improve plugin behaviour and performance by only instantiating compiler, and only installing npm deps when needed, and not leaking file handles

Further contributions towards a working windows version.

Contributors

 7  Øyvind Raddum Berg
 2  Mykola Khoroshevskyi
 1  Anthony Cerruti

v1.0.0-beta6 - Towards windows support

23 Apr 18:00
Compare
Choose a tag to compare
Pre-release

Full changelog

Support running the plugin and CI build on windows.
If you see any further issues please file an issue

Contributors

 7  Mykola Khoroshevskyi
 2  Øyvind Raddum Berg

v1.0.0-beta5 - Mapped types expansion enabled by default

23 Apr 17:59
f61c5d8
Compare
Choose a tag to compare

Full changelog

This is a big release because we finally enable expansion of mapped types for most static cases.

Given the following typescript definition:

interface Person {
    name: string
    age: number
    favouriteColor: "red" | "blue"
}

declare const patch: (p: Person, pp: Pick<Partial<Person>, "name" | "age">) => Person;

We now end up with these Scala.js definitions:

trait Person extends js.Object {
  var age: Double = js.native
  var favouriteColor: red | blue = js.native
  var name: String = js.native
}

/* Inlined std.Pick<std.Partial<type-mappings.Person>, 'name' | 'age'> */
trait PickPartialPersonnameage extends js.Object {
  var age: js.UndefOr[Double] = js.native
  var name: js.UndefOr[String] = js.native
}

@JSGlobal("patch")
@js.native
object patch extends js.Object {
  def apply(p: Person, pp: PickPartialPersonnameage): Person = js.native
}

This functionality is widely used in typescript, so finally enabling this is a big improvement.

Note that the functionality has been enabled for a few selected libraries for quite a while.

Also note that this still has quite a few limitations, in particular it gives up when encountering most conditional types.
This can be improved down the road. This functionality will probably never be available for cases like Partial<T>.

Improved naming scheme for anonymous object types

There has long been a naming scheme in order to name anonymous things like this:

declare const foo: (someObject: {foo: number, bar?: string}) => void; 
@JSGlobal("foo")
@js.native
object foo extends js.Object {
  def apply(someObject: AnonFooBar): Unit = js.native
}

Since we suddenly got a lot more anonymous object types because of the expanded type mappings, the scheme needed some improvements.
Generated names like AnonFoo will generally be shorter than before.

Rewritten tag detection in slinky flavour

For the slinky flavour the generated components receive an element type like a, div, etc.

This enables the user to supply DOM props with normal Slinky syntax. For instance a component like this

import slinky.web.html.button.tag
// import ...

object Paper
  extends ExternalComponentWithAttributesWithRefType[tag.type, default] {
  /* The following DOM/SVG props were specified: className, contentEditable, dangerouslySetInnerHTML, defaultChecked, defaultValue, dir, draggable, height, hidden, id, lang, placeholder, spellCheck, style, suppressContentEditableWarning, tabIndex, title, width */
  def apply(about: String = null /*, ... */) = ???
}

can be used like this

Paper(about = "foo")(className := "className")

After the rewrite both element detection and props trimming is much more reliable than before.

In particular we used to only check if the actual props matched the name of a prop for the identified element, now we only trim it if the type is exactly what the given element would accept.

Improved parser

For better or worse ScalablyTyped has it's own parser.
It received some improvements and is now able to parse 100% of DefinitelyTyped for the first time

Improved plugin

  • Fixed a bug where we compile the same library simultaneously and ended up with corrupt jar files. Fixed by a file-level lock
  • Should now be less susceptible to OOM after a usage of a class loader cache was removed.

Contributors

17  Øyvind Raddum Berg
 1  Jocelyn Boullier
 1  Lorenzo Gabriele
 1  Mushtaq Ahmed

1.0.0-beta5 - Sbt plugin refactored, full support for Scala.js 1.0.0

23 Apr 17:57
88836f7
Compare
Choose a tag to compare

Full changelog

  • Full support for Scala.js 1.0.0
  • Redesigned the sbt plugin to use allDependencies rather than unmanagedDependencies

Contributors

18  Øyvind Raddum Berg
 1  FabioPinheiro

1.0.0-beta4 - Plugin now compiles libraries

23 Apr 17:57
e994542
Compare
Choose a tag to compare

Full changelog

Rewrote the plugin from just a source generator to compiling all the libraries for you. For most use cases this is a huge improvement.

Contributors

 8  Øyvind Raddum Berg

1.0.0-beta3 - Bugfix release

23 Apr 17:56
3e48888
Compare
Choose a tag to compare
Pre-release
Merge pull request #111 from ScalablyTyped/revert-serialization

Revert change to serialization library for parse cache

1.0.0-beta2 - Bugfix release

23 Apr 17:56
Compare
Choose a tag to compare
Pre-release
v1.0.0-beta2

docs fixup

1.0.0-beta1 - Beta release announcement!

23 Apr 17:55
030960d
Compare
Choose a tag to compare

It's a great pleasure to finally open source the ScalablyTyped converter and release the project as an sbt plugin.

You now decide your own Scala version, your own Scala.js version and your own versions of libraries.

All projects built with the plugin will now continue to build forever, as opposed to the old distribution method where libraries had to be culled every now and then.

Important changes:

The published ScalablyTyped distribution is deprecated.

Once you factor in cross builds and flavours it's impossible to keep a useful set of precompiled binaries.

Going forward it'll continue to serve as QA to ensure that we're able to convert the newest versions of important libraries.

It'll also be updated immediately to the newest available versions, Scala 2.13 and Scala.js 1.0.0 pre-releases.

All usage should be migrated to the new plugin.

Facades are deprecated

Most usage of facades have been to enable better usage with react.
This is now solved by flavours instead.

In particular the react-facade which was widely used in the demos and saw some use outside is now deprecated.

If you want to keep using it feel free to copy it into your own repository (it's MIT licensed).

If we come across anything which is not solved by (potentially writing new) flavours, we can revisit this.

New naming convention

One of the recognizable features of ScalablyTyped was the rather peculiar naming scheme which served to avoid name collisions.

The final feature which was merged before release was "adaptive naming", which manages the same while generating much nicer looking code.

It typically looked like this:

import typings.reactDashRouter.reactDashRouterMod.RouteProps

After the change, the same import is now

import typings.reactRouter.mod.RouteProps

Everyone migrating to the plugin from the ScalablyTyped distribution will have to rewrite most of their imports. It should be easy once you see the pattern. Most module names will have lost part of it's prefix, and the top-level module for each library is now simply called mod.

Consult this commit to see what was needed to port the Slinky demos.