• Stars
    star
    205
  • Rank 184,472 (Top 4 %)
  • Language
    Scala
  • Created about 10 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An example application written in ScalaJS using scala-js-dom and scala-js-workbench

Example Scala.js application

This is a slightly less barebone example of an application written in Scala.js. In particular, it links in libraries that are indispensible in being productive working with Scala.js.

Get started

To get started, run sbt ~fastOptJS in this example project. This should download dependencies and prepare the relevant javascript files. If you open localhost:12345/target/scala-2.11/classes/index-dev.html in your browser, it will show you an animated Sierpinski triangle (live demo). You can then edit the application and see the updates be sent live to the browser without needing to refresh the page.

The optimized version

Run sbt fullOptJS and open up index-opt.html for an optimized (~200kb) version of the final application, useful for final publication.

Dodge the Dots

Take a look at the dodge-the-dots branch in the git repository if you want to see a slightly more complex application that was made in 30 minutes using this skeleton. Similar steps can be used for development or publication. There's a live demo here.

Space Invaders

There's also a space-invaders branch, also made in 30 minutes, with its own live demo.

TodoMVC

The todomvc branch contains an implementation of the TodoMVC example application, which is used to compare how the exact same application would be implemented using different languages and frameworks. This application makes heavy use of Scalatags and Scala.Rx, with heavy use of the DOM via scala-js-dom, making it a good example of how reactive web pages could be built using ScalaJS, as well as use of standalone ScalaJS libraries. live demo

Ray Tracer

The ray-tracer branch contains a simple ray-tracer written using Scala.js, with a live demo.

Weather Map

The mapper branch contains an application that renders a heat map of the earth, using data pulled from OpenWeatherMap, with a live demo

Autowire

The autowire branch contains a small sample client-server application, using Scala.js on the client and Spray on the server. The readme on that branch contains instructions on how to run it.

More Repositories

1

macropy

Macros in Python: quasiquotes, case classes, LINQ and more!
TSQL
3,262
star
2

Metascala

A JVM written in Scala
Scala
1,159
star
3

scala.rx

An experimental library for Functional Reactive Programming in Scala
Scala
986
star
4

autowire

Macros for simple/safe RPCs between Scala applications, including ScalaJS/ScalaJVM
Scala
379
star
5

Scalatex

Programmable, Typesafe Document Generation
Scala
290
star
6

workbench

Tooling around scala-js
Scala
234
star
7

Scalite

An experimental whitespace-delimited syntax for the Scala programming language
Scala
149
star
8

hands-on-scala-js

Better documentation for Scala.js
Scala
144
star
9

scala-js-games

Some simple games ported to Scala-Js
Scala
106
star
10

SprayWebSockets

An implementation of a websocket server on top of spray.io
Scala
105
star
11

scala-js-fiddle

Source code for Scala.jsFiddle
Scala
86
star
12

scala-native-example-app

Example Scala-Native application using third party libraries and a test suite
Scala
53
star
13

scala-bench

Some benchmarks of memory and runtime performance of Scala's collections
Scala
43
star
14

roll

A work-in-progress game being developed using scala-js
JavaScript
34
star
15

6858

The Worldโ€™s Most Advanced Sandboxโ„ข (TWMAS) is a portable sandbox designed to safely run untrusted Java bytecode
Java
29
star
16

XMLite

XMLite is a lightweight markup language
Scala
16
star
17

autojit

Scala
13
star
18

opendata

Python
11
star
19

crdt

Pure-Scala CRDTs
Scala
11
star
20

sinject

SInject is a Scala compiler plugin which helps auto-generate implicit parameters
Scala
10
star
21

Java-Games

A collection of old games written in Java, dating back to 2004-2007
Java
10
star
22

boxer

Scala
3
star
23

mysite

Source code for my old, dead blog (without the content which is lost)
Python
2
star
24

empty

1
star
25

utest-example-module

A skeleton for writing cross-platform Scala libraries
Scala
1
star
26

FSharpMetro

An attempt at making a Windows 8 game using F#
C#
1
star