scalafiddle / scalafiddle-editor Goto Github PK
View Code? Open in Web Editor NEWWeb user interface for ScalaFiddle
Home Page: https://scalafiddle.io
License: Apache License 2.0
Web user interface for ScalaFiddle
Home Page: https://scalafiddle.io
License: Apache License 2.0
Use FastParse to do client-side syntax checking of the Scala code.
Please add OutWatch, the FRP UI framework to the list of usable libraries.
Add functionality to show the type information for a selected expression.
Currently, any edits to an existing fiddle cause "No suitable compiler available"
Example: https://scalafiddle.io/sf/9Xs6tIU/6 (compare to the previous https://scalafiddle.io/sf/9Xs6tIU/5)
How to set it up using Docker etc.
Use scalafmt either on the client or server side to provide automatic formatting of source code.
I choose Binding.scala 10.0.1 in "All versions", and I got an error
ScalaFiddle.scala:-5: ERROR: Library com.thoughtworks.binding %%% binding % 10.0.1 is not allowed
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.
Allow user to select Dotty as the Scala compiler
Scala.jsFiddle had a command (hidden behind Ctrl+J) to show the generated .js code for the snippet. Could we have something similar in Scala Fiddle?
I didn't find any other place where to leave comments to you so I made an issue about my proposal.
Proposal 1: Add https://github.com/Karasiq/scalajs-bootstrap scalajs-bootstrap library to available libraries.
It is simple and light wrapper on top of bootstrap.
Proposal 2: Add https://github.com/lihaoyi/autowire autowire library to available libraries.
It is simple and typesafe RPC between client and server.
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.
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
The Scala Worksheet seems to be popular in both Eclipse and IntelliJ. Users may find it useful if ScalaFiddle supported this mode as well.
For example, this would allow learners to follow along with videos for Functional Programming Principles in Scala coursera course using just a web browser.
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?
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.
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.
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.
Allow printing Any
and do pattern matching to support DOM elements.
Add functionality for "Go to definition" where user can point a method/type with cursor and the appropriate source code for the definition is shown in the result view.
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.
A server error occurred: Unexpected exception[SQLTransientConnectionException: postgre.db - Connection is not available, request timed out after 1000ms.]
Hi @ochrons,
this might not be the typical use case for Scalafiddle, but we wrote a Scala library that wraps the Google Apps Script API.
We are using an old forked version of Li Haoyi's Scalafiddle to compile standalone scripts like this to JS and run it in Google.
If you think that is a good show-case for Scalafiddle, I could prepare a PR that adds our library to the available libraries.
Search for fiddles with:
Allow specifying separate JS/CSS library dependencies (like React, Bootstrap etc) and also allow providing JS deps in for Scala libs.
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.
Allowing the user to customize the editor (not only the embedded version) it should be possible to use the editor even in smartphones.
Allow multiple users to share a collaborative editing session for a fiddle.
It is very cumbersome to use ScalaFiddle for small screens without line numbers visible (e.g. it is difficult to jump to errors or have a view of error lines).
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.
For logged in users, provide a way to see what fiddles they have done in the past.
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.
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.
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.
Popular React.js implementation in scala that I currently use and would find helpful to have in scalafiddle.
https://github.com/japgolly/scalajs-react
Allow user to select Scala 2.12 version
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.
Apologies if I missed how to do this ... new to scalafiddle.
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>
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.
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)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.