Git Product home page Git Product logo

elm-reactor's Introduction

Elm Reactor

Interactive development tool that makes it easy to develop and debug Elm programs. Key features include:

This means you can get a great development experience whether you are using Sublime Text, emacs, vim, or whatever else to edit Elm code.

Install

Install Elm Platform. This will install Elm Reactor and everything else it needs.

Use

Navigate to the Elm project you want to work on. A great project to get started with is elm-examples which contains some simple programs that should be fun to debug.

In the root of your Elm project start the reactor with:

elm-reactor

Now open http://localhost:8000 in your browser. You should see a navigation page for your project.

Click on any file to see what it looks like. For example, you can navigate to an Elm file and try it out. If you modify the file, you can just refresh that page and see the new version!

Time Travel Debugging

To use the debugger, click the small wrench next to every Elm file. This will start your Elm program with a control panel that lets you:

  • Pause, rewind, and continue from any point.

  • Add watches and traces to track and visualize values over time.

  • Swap in new code at any time, maintaining all recorded events.

Debugging code embedded in HTML

To use the debugger with more complex HTML or CSS, you may want to start the debugger from within an HTML file. This process is still improving, so use this with caution.

In your custom HTML file, load the /_reactor/debug.js script.

<script type="text/javascript" src="/_reactor/debug.js"></script>

That creates the Elm.fullscreenDebug function so you can initiate your Elm program with the debugger:

var main = Elm.fullscreenDebug('MyProject.Main', 'MyProject/Main.elm');

The first argument is the name of the module you would like to debug. The second argument is the name of the source file for that module. The file name is needed so that we know which file to recompile when the Reactor detects that a file has changed. You may edit a dependency, but we always need to compile from the root file.

elm-reactor's People

Contributors

michaelbjames avatar process-bot avatar jcollard avatar mgold avatar johnpmayer avatar jvoigtlaender avatar jastice avatar passy avatar

Watchers

James Cloos avatar

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.