Giter Site home page Giter Site logo

scalafiddle-editor's Introduction

ScalaFiddle editor

This project provides an online editor for creating, sharing and embedding Scala fiddles (little Scala programs that can run in your browser).

Usage

For documentation on how to use the ScalaFiddle editor, see the Welcome.

Hosting your own ScalaFiddle editor

ScalaFiddle has been designed to be easy to host on your own. It's published as Docker images (scalafiddle/scalafiddle-editor, scalafiddle/scalafiddle-router and scalafiddle/scalafiddle-core) which provide an easy way to set up your own service.

Contributing

If you'd like to contribute to the ScalaFiddle project, for example to add a new library dependency, read the contribution guide for more instructions on how to set up a local dev env for ScalaFiddle editor and core.

scalafiddle-editor's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

scalafiddle-editor's Issues

println(null) does not work like Predef.println

println(null) causes this to be displayed in the right pane:

ERROR: instance is null

(in red), and then the execution stops.

I expect that the following be displayed instead:

null

as if I had called println("null")

That the behavior is different from Predef.println is annoying when one tries to explain some bad behavior of a snippet, as we cannot demonstrate the real issue.

Add OG, oembed and iframely support

Add metadata to support OpenGraph, oembed and iframely, so that when a link to a fiddle is pasted in, say, Facebook or Slack, it will be expanded in a meaningful way.

Update Github authentication mechanism

Hello there!

On February 7th, 2020 at 00:52 (UTC) your application (ScalaFiddle) used an access token (with the User-Agent AHC/2.0) as part of a query parameter to access an endpoint through the GitHub API.

https://api.github.com/user

Please use the Authorization HTTP header instead as using the access_token query parameter is deprecated.

Depending on your API usage, we'll be sending you this email reminder once every 3 days for each token and User-Agent used in API calls made on your behalf.
Just one URL that was accessed with a token and User-Agent combination will be listed in the email reminder, not all.

Visit https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api/#authenticating-using-query-parameters for more information.

Support for JS/CSS dependencies

Allow specifying separate JS/CSS library dependencies (like React, Bootstrap etc) and also allow providing JS deps in for Scala libs.

Show a proper Welcome doc when opening a new fiddle

Use the right panel to disaply a "Getting started" style welcome message when creating a new fiddle. It should contain basic instructions on how to create a fiddle and links to further documentation.

Source of this doc should be a static web page hosted in Github pages for easy updates. The URL needs to be specified in configuration (so that it can be overridden with an env var)

Automatic type checking

When code passes client-side syntax check, perform type checking on a server. Be mindful about CPU usage and use a sufficient delay after edits to perform the check.

Put ScalaTags and ScalaDom in the 'Selected' libraries by default

It appears as if scalatags and scaladom are included by default, but there isn't any indication in the UI. It would be nice if they were just added to the 'Selected' section by default. If it its not possible to remove them as a dependency, can we just show them under 'Selected' but not allow them to be removed?

Reload library information automatically

When library definitions change, ScalaFiddle needs to be fully restarted. Add a scheduled task to fetch new library data periodically and if it has changed, update internally.

Router will also need to poll for new libs from the editor and pass it on to compiler servers.

Allow loading library JSON directly from Github.

Handle up, down, left & right (iOS external keyboards)

It would be great if the editor handle the non standard keys event.key => UIKeyInputUpArrow, UIKeyInputDownArrow, UIKeyInputLeftArrow and UIKeyInputRightArrow, these events are the ones triggered when you use a external keyboard in iOS 11 and press Up, Down, Left & Right.

Foldable.traverse_ from cats on ScalaFiddle returns "undefined"

This is the fiddle:
https://scalafiddle.io/sf/CjQOb84/0

Code:

import cats.implicits._
import cats.Foldable

def parseInt(s: String): Option[Int] = {
  val x = Either.catchOnly[NumberFormatException](s.toInt).toOption
  x foreach println
  x
}

println(Foldable[List].traverse_(List("1", "2"))(parseInt).get)

Result:

1
2
undefined

Expected:

1
2
Some(3)

I am new to this Scala world, so please let me know if you recommend me posting the bug at Cats or at Scala.js

Add latest tag for embedded scala fiddles

When embedding a scala fiddle, one has to specify the version of the fiddle. It would be nice to have a "latest" tag so one doesn't have to change the embedded link all the time when updating the fiddle.

Add link to scalafiddle's github page onScalafiddle.io

It would be awesome if there was a obvious link over to this github page on the scalafiddle.io site. I know its not necessarily hard to find the github page, but it would be nice if there was a 'fork me on github' type link somewhere obvious.

fix in Chrome

I cannot type anything in the editor when I use chrome (it works ok in Firefox)
screenshot from 2016-09-13 13 42 49

Losing code when accidentally closing the tab

One thing that trips me up with scalafiddle over and over, is that there’s no alert dialog when you try to exit the site. E.g. when I try to scroll to the left in the editor sometimes my browser will think I want to go ‘back’ and will leave all my changes gone for good. Same happens when I click on the scalafiddle logo by accident when I wanted to click the ‘Run’ button

We could persist current code in localstorage or implement an alert dialog before leaving the site.

'Sign in with GitHub' not working

A server error occurred: Unexpected exception[SQLTransientConnectionException: postgre.db - Connection is not available, request timed out after 1000ms.]

Implement responsive design

The site is not usable with mobile style devices. This could be fixed either by applying CSS media queries for appropriate sizes, or making the whole design fluid.

Applying a CSS-framework such as bootstrap (it's honestly been a while since I did UI styling so I don't know what's hip these days) would go a long way.

Improve smart reuse of compiler instances

Extract dep info in the router and select the best compiler based on past data on compilations with same libraries.

Use different compiler instances (when available) for auto-complete and compilation.

Direct a returning user to the same compiler as before when possible.

Options - Show Template - not clickable

The checkbox label is not clickable. Add the id and for attributes to link them together.

<!-- before -->
<input value="on" type="checkbox">
<label>Show template</label>

<!-- after -->
<input value="on" type="checkbox" id="show-template">
<label for="show-template">Show template</label>

Document development setup

Provide a doc explaining how to set up a dev env for ScalaFiddle, how to run it locally and how to make modifications to the code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.