0.40.2 • Published 6 months ago

relay-compiler-language-scalajs v0.40.2

Weekly downloads
178
License
Apache-2.0
Repository
github
Last release
6 months ago

relay-compiler-language-scalajs

The purpose of this project is to generate Scala.js bindings for the relay-compiler. Typically, the relay-compiler generates flow bindings along with the compiled queries. This project replaces that generation and outputs js.native traits instead. It should work on most "normal" gql features. If I personally run across something not supported I try to add it, but it is by no means totally complete.

This project uses flow because it's what Relay uses, and it's better than raw javascript.

It uses artifactDirectory to generate all the source files in the same package. So it's a big flat package repository in the same directory. This is controlled by (resourceManaged in Compile).value / "relay-compiler-out /" in sbt terms.

Versions

  • 0.32.x - Relay 11.0.2
  • 0.25.x - Relay 10.1.2
  • 0.22.2 - Relay 6.0.0
  • 0.20.1 - Relay 2,0,0
  • 0.11.0 - Relay 1.6.2
  • 0.9.0 - Relay 1.5.0
  • 0.8.2 - Relay 1.4.0

Example

$ ./node_modules/bin/relay-compiler --language scalajs --src example/src/ --schema example/schema.graphql --artifactDirectory example/out

Features

  • Handle names elegantly by scoping them to the companion object.
  • Provides two ways to customize the output
  • @scalajs(extends: String) This can give you a parent class to mixin. It's your job to verify it.
  • @scalajs(useNulls: Boolean) this can give you finer control on using A | Null on a Fragment, field or inline fragment.

Example

Looking at the sbt tests is the best way to get a handle on how things work.

Basic Test

Dev

Build with:

yarn build

Testing

Go to node-example and run:

yarn iterate

Debugging

First build and then use the relay-compiler Run Configuration in IntelliJ.

Alternatively, modify iterate.sh to:

node --inspect brk

Then run this and attach a debugger.

0.40.2

6 months ago

0.40.1

6 months ago

0.40.0

10 months ago

0.33.5

12 months ago

0.33.4

1 year ago

0.32.2

2 years ago

0.33.3

2 years ago

0.33.2

2 years ago

0.33.1

2 years ago

0.32.1

2 years ago

0.32.0

2 years ago

0.31.3

2 years ago

0.31.2

3 years ago

0.31.2-2

3 years ago

0.31.2-1

3 years ago

0.31.2-3

3 years ago

0.31.1

3 years ago

0.31.0

3 years ago

0.25.10

3 years ago

0.25.12

3 years ago

0.25.13

3 years ago

0.25.9

3 years ago

0.25.8

3 years ago

0.25.7

3 years ago

0.25.6

3 years ago

0.25.5

3 years ago

0.25.4

3 years ago

0.25.3

3 years ago

0.25.2

3 years ago

0.25.1

3 years ago

0.25.0

3 years ago

0.24.3

3 years ago

0.24.2

3 years ago

0.24.1

3 years ago

0.24.0

4 years ago

0.23.1

4 years ago

0.23.0

4 years ago

0.22.12

4 years ago

0.22.11

4 years ago

0.22.8

4 years ago

0.22.7

4 years ago

0.22.6

4 years ago

0.22.5

5 years ago

0.22.4

5 years ago

0.22.3

5 years ago

0.22.2

5 years ago

0.22.1

5 years ago

0.22.0

5 years ago

0.21.5

5 years ago

0.21.4

5 years ago

0.21.3

5 years ago

0.21.2

5 years ago

0.21.1

5 years ago

0.21.0

5 years ago

0.20.6

5 years ago

0.20.5

5 years ago

0.20.4

5 years ago

0.20.3

5 years ago

0.20.3-SNAPSHOT

5 years ago

0.1.5-8

5 years ago

0.1.5-7

5 years ago

0.1.5-6

5 years ago

0.1.5-5

5 years ago

0.1.5-4

5 years ago

0.1.5-3

5 years ago

0.1.5-2

5 years ago

0.1.5-1

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.0

5 years ago