question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Create Scala.js g8 template

See original GitHub issue

Giter8 templates are used in a number of places and provides users with a simple way of starting a project within a selected framework. The templates can be used:

  • via sbt: sbt new scalajs/scalajs.g8
  • via coursier:
coursier install giter8
g8 scalajs/scalajs.g8
  • and selected within Metals New Scala project command

All the available ScalaJS templates are rather old and certainly unofficial. I propose that we create a basic ScalaJS sbt project scalajs/scalajs.g8 with some basics that users (especially beginners) can use to get started. We could also setup Scala Steward for that repo and make sure that the template is in the default templates for Metals.

What are people’s opinions on this? What should we add to the template if we decide to create one?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:15 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
keynmolcommented, Jan 20, 2021

Things that tripped me over personally:

  1. %%% (so at least 1 dependency in the build definition with a comment would help a lot)
  2. Testing (seeing https://github.com/scala-js/scala-js-env-jsdom-nodejs and then through trial and error getting it to work really helped)
  3. A pre-baked index-dev.html which targets the output (hardcoded?) of fastOptJS so that one can open it immediately
  4. A cross-compiled module for JVM and JS (core module tested on jvm and js, and a frontend module?)

Can’t think of more things that would qualify for a minimal template.

I think the idea is fantastic 😃

P.S.: keeping dependencies up-to-date is a big one. There were several complaints of broken sample projects and templates on Gitter, and SS can help with that

0reactions
fdietzecommented, Jun 2, 2022

For reference, we have a fairly minimal Outwatch template with hot reloading available: https://github.com/outwatch/seed.g8

There is also a scalajs full-stack template to deploy to AWS lambda: https://github.com/fun-stack/example

Lots of experience and personal best-practices went into these, so there’s probably something to learn from.

In the fun-stack example, we even decided to remove g8 and make it a pure repo to be cloned (marked as github template).

g8 didn’t have enough advantages to keep it, while having the disadvantage to have a more complicated CI and scala-steward setup.

Doing a git clone or a sbt new is not very different in usability.

Read more comments on GitHub >

github_iconTop Results From Across the Web

tues/scala-js.g8: Giter8 template for Scala.js projects - GitHub
A Giter8 template for Scala.js projects, created by following the official Scala.js documentation with some tiny improvements.
Read more >
Giter8 Scala Templates - August Nagro
Modular Scala.js template. This is the best solution for managing lots of npm dependencies, but causes a big increase in build time. sbt...
Read more >
Quick Start - Scala.js
This Quick Start will help you set up your system for developing with Scala.js and guide you through your first Scala.js application.
Read more >
Creating an SBT Project Template using Giter8 - Yadu Krishnan
Giter8 is a command line tool for creating templates for mainly Scala Projects. Giter8(g8) templates helps to quickly setup and start a Scala...
Read more >
scala-js/scala-js - Gitter
All interested: should we create a gitter8 template for Scala.js? ... I would love a g8 template that has a shared jvm/js lib...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found