Skip to content

Commit

Permalink
Rename the repository to "reflex-platform"
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Trinkle committed Feb 10, 2016
1 parent 3b823c7 commit 8f0a6e1
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 32 deletions.
20 changes: 10 additions & 10 deletions HACKING.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
Hacking on Try Reflex
=====================
Hacking on the Reflex Platform
==============================

To work on a particular package, use the work-on script **instead of** try-reflex:
To work on a particular package, use the work-on script **instead of** `./try-reflex`:

```
~/try-reflex/work-on ghcjs ./your-project
~/reflex-platform/work-on ghcjs ./your-project
```

This will use your package's cabal file to determine dependencies. If you have a default.nix, it will use that instead. Note that your project's path must include at least one slash ('/') so that work-on can detect that it is a path, rather than a package name.

This will give you the exact environment needed to work with the given package and platform, rather than the general-purpose environment provided by try-reflex.
This will give you the exact environment needed to work with the given package and platform, rather than the general-purpose environment provided by the Reflex Platform.

You can replace `ghcjs` with `ghc` to hack on the native GHC version of the package (including with GHCi if you want). You can also use a package name instead of a path, which will drop you into the standard build environment of that package; this works even if you don't yet have the source for that package.

Instead of specifying `ghcjs` or `ghc` for the platform, you can also specify a path to a nix expression file whose value represents a Haskell environment, for example:

```
{ try-reflex, ... }: try-reflex.ghcjs.override {
{ reflex-platform, ... }: reflex-platform.ghcjs.override {
overrides = self: super: {
some-package = self.callPackage ./some-package {};
};
Expand All @@ -36,17 +36,17 @@ The `hack-on` script is provided for conveniently checking out a sub-repository.
./hack-on reflex
```

This will check out the same version of `reflex` currently being used by `try-reflex`. Note that `reflex`, here, is a path relative to the current directory, so you must be in the try-reflex folder when you execute this.
This will check out the same version of `reflex` currently being used by the Reflex Platform. Note that `reflex`, here, is a path relative to the current directory, so you must be in this folder when you execute this.

Once the repository is checked out, you can make modifications to it, which will be used the next time you enter a `try-reflex` shell. Existing `try-reflex` sessions will not be affected.
Once the repository is checked out, you can make modifications to it, which will be used the next time you enter a try-reflex or work-on shell. Existing sessions will not be affected—exit and re-enter your shell to use the changes.

When you have completed some work hacking on the sub-repository, you can use the `hack-add` script to check your changes into try-reflex without needing to delete the repository, like so:
When you have completed some work hacking on the sub-repository, you can use the `hack-add` script to check your changes into this repository without needing to delete the repository, like so:

```
./hack-add reflex
```

You can then commit and push try-reflex without needing to delete the sub-repository.
You can then commit and push reflex-platform without needing to delete the sub-repository.

When you are completely done with a sub-repository, you can remove it using `hack-off`:

Expand Down
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Try Reflex
==========
Reflex Platform
===============

The Reflex Platform is a collection of libraries and tools that are useful for developing and deploying [Reflex](https://github.com/reflex-frp/reflex)-based applications.

To get started with Reflex development, follow the instructions below.

Try Reflex lets you set up an environment from which you can use [Reflex](https://github.com/ryantrinkle/reflex) with [GHCJS](https://github.com/ghcjs/ghcjs).

Expand All @@ -16,16 +20,16 @@ Setup
-----
This process will install the [Nix package manager](https://nixos.org/nix/). If you prefer to install Nix yourself, you may do so any time prior to step 2.

1. Clone the try-reflex repo:
1. Clone this repository:

```bash
git clone https://github.com/ryantrinkle/try-reflex
git clone https://github.com/reflex-frp/reflex-platform
```

2. Navigate into the `try-reflex` folder and run the try-reflex bootstrapping command. This will install Nix, if you don't have it already, and use it to wrangle all the dependencies you'll need and drop you in an environment from which you can use Reflex. Be warned, this might take a little while the first time:
2. Navigate into the `reflex-platform` folder and run the `try-reflex` command. This will install Nix, if you don't have it already, and use it to wrangle all the dependencies you'll need and drop you in an environment from which you can use Reflex. Be warned, this might take a little while the first time:

```bash
cd try-reflex
cd reflex-platform
./try-reflex
```

Expand All @@ -38,7 +42,7 @@ This process will install the [Nix package manager](https://nixos.org/nix/). If

4. Compilation will produce a `source.jsexe` folder containing an `index.html` file. Open that in your browser to run your app.

5. If you need to add any additional dependencies, edit `packages.nix`, then exit and re-enter the try-reflex shell. **Don't use Cabal** to install libraries while inside the nix shell - the resulting libraries may not be found properly by ghc or ghcjs. Using Cabal to configure, build, test, and run a particular package, however, should work just fine.
5. If you need to add any additional dependencies, edit `packages.nix`, then exit and re-enter the try-reflex shell. **Don't use** `cabal install` to install libraries while inside the try-reflex shell - the resulting libraries may not be found properly by ghc or ghcjs. Using Cabal to configure, build, test, and run a particular package, however, should work just fine.
Tutorial
--------
Expand Down
6 changes: 3 additions & 3 deletions common-setup.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file should not be run directly; it exists to share setup code between the various scripts in try-reflex
# This file should not be run directly; it exists to share setup code between the various scripts in this repository
# Before running this script, DIR should be defined equal to the directory containing this script

REPO="https://github.com/ryantrinkle/try-reflex"
REPO="https://github.com/reflex-frp/reflex-platform"

NIXOPTS="--option extra-binary-caches https://ryantrinkle.com:5443/ -j 8"

Expand Down Expand Up @@ -51,7 +51,7 @@ fi
MIN_REQUIRED_NIX_VERSION="1.8"

if [ "$(nix-instantiate --eval --expr "builtins.compareVersions builtins.nixVersion \"$MIN_REQUIRED_NIX_VERSION\" >= 0")" != "true" ] ; then
echo "It looks like your version of Nix, $(nix-instantiate --eval --expr "builtins.nixVersion"), is older than the minimum version required by try-reflex, \"$MIN_REQUIRED_NIX_VERSION\". You'll need to upgrade Nix to continue. On non-NixOS platforms, that can usually be done like this:"
echo "It looks like your version of Nix, $(nix-instantiate --eval --expr "builtins.nixVersion"), is older than the minimum version required by the Reflex Platform, \"$MIN_REQUIRED_NIX_VERSION\". You'll need to upgrade Nix to continue. On non-NixOS platforms, that can usually be done like this:"
if [ "$NEEDED_TO_SOURCE_NIX_SCRIPT" -ne 0 ] ; then
echo "$SOURCE_NIX_SCRIPT"
fi
Expand Down
6 changes: 3 additions & 3 deletions gc-roots/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Try Reflex gc-roots
===================
Reflex Platform gc-roots
========================

When the try-reflex script is run, it will add a symbolic link to this directory creating a garbage collection root for the nix store. This will prevent `nix-collect-garbage` from deleting the try-reflex environment. To allow the garbage collector to delete the environment, first delete the contents of this directory (except this file), then run `nix-collect-garbage`.
When the `try-reflex` script is run, it will add a symbolic link to this directory creating a garbage collection root for the nix store. This will prevent `nix-collect-garbage` from deleting the try-reflex environment. To allow the garbage collector to delete the environment, first delete the contents of this directory (except this file), then run `nix-collect-garbage`.
2 changes: 1 addition & 1 deletion notes/LinuxMint.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

By default, nix-shell does not work on Linux Mint - the environment, including the PATH, is destroyed by the default /etc/bash.bashrc. To fix this, please comment out the line that runs "mint-fortune" in that file.

Thanks to @cgibbard for finding this issue with try-reflex and to http://www.pavelkogan.com/2014/07/13/nix-shell-on-linux-mint/ for tracking down the line in question.
Thanks to @cgibbard for finding this issue and to http://www.pavelkogan.com/2014/07/13/nix-shell-on-linux-mint/ for tracking down the line in question.
4 changes: 2 additions & 2 deletions notes/NixOS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Enabling the binary cache on NixOS

When using Nix on NixOS, only root can add binary caches to the system. This will force try-reflex to rebuild GHCJS from scratch, which takes hours. To enable the binary cache, you can add the following lines to your `/etc/nixos/configuration.nix`:
When using Nix on NixOS, only root can add binary caches to the system. This will force `try-reflex` to rebuild GHCJS from scratch, which takes hours. To enable the binary cache, you can add the following lines to your `/etc/nixos/configuration.nix`:

```
nix.trustedBinaryCaches = [ "https://ryantrinkle.com:5443" ];
Expand All @@ -11,4 +11,4 @@ Note: If you are running NixOS 14.12 or older, you do not need the `binaryCacheP

If you already have one of these variables set up, just add these values to the existing lists.

Once it's been added, run `sudo nixos-rebuild switch` to make the change take effect, then run try-reflex as normal.
Once it's been added, run `sudo nixos-rebuild switch` to make the change take effect, then run `./try-reflex` as normal.
2 changes: 1 addition & 1 deletion reflex-dom/git.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
url = git://github.com/ryantrinkle/reflex-dom;
url = git://github.com/reflex-frp/reflex-dom;
rev = "b3f9b5f0b477d4bb09f6a4076c902aefbe9f4eb0";
sha256 = "acb4a5ff64538876a6d94f7ec077d392ebebebef5c509f3ed8013c3d9e6f8d3b";
}
2 changes: 1 addition & 1 deletion reflex-todomvc/git.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
url = git://github.com/ryantrinkle/reflex-todomvc;
url = git://github.com/reflex-frp/reflex-todomvc;
rev = "9355d48f1fbdd8a5d09289a7d1ff12108e9a8f77";
sha256 = "299eef6f581115f6e8807cdf39c7688ad1fa7d9b4a53ff1b5b2aa7583ab42920";
}
2 changes: 1 addition & 1 deletion reflex/git.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
url = git://github.com/ryantrinkle/reflex;
url = git://github.com/reflex-frp/reflex;
rev = "cc62c11a6cde31412582758c236919d4bb766ada";
sha256 = "63059a547ef74ff842806b93c936de65c1929bd450bc148537a1e5d5db0a0832";
}
4 changes: 2 additions & 2 deletions try-reflex
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ SUGGESTION_GHC=$(cat <<EOF
To run a simple GUI as a native binary:
$ ghc -e 'import Reflex.Dom' -e 'mainWidget $ text \"Hello, world!\"'
Or to see a more complex native binary GUI example (based on the source at https://github.com/ryantrinkle/reflex-todomvc/blob/master/src/Main.hs):
Or to see a more complex native binary GUI example (based on the source at https://github.com/reflex-frp/reflex-todomvc/blob/master/src/Main.hs):
$ reflex-todomvc
EOF
)
Expand All @@ -47,7 +47,7 @@ EOF
$ ghcjs hello.hs
Then navigate your browser to file://$(pwd)/hello.jsexe/index.html
Or to see a more complex GUI example (based on the source at https://github.com/ryantrinkle/reflex-todomvc/blob/master/src/Main.hs), navigate your browser to file://$(nix-build $NIXOPTS --no-out-link "$DIR" -A ghcjs.reflex-todomvc)/bin/reflex-todomvc.jsexe/index.html
Or to see a more complex GUI example (based on the source at https://github.com/reflex-frp/reflex-todomvc/blob/master/src/Main.hs), navigate your browser to file://$(nix-build $NIXOPTS --no-out-link "$DIR" -A ghcjs.reflex-todomvc)/bin/reflex-todomvc.jsexe/index.html
EOF2
)

Expand Down
2 changes: 1 addition & 1 deletion work-on
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if echo "$PLATFORM" | grep -q '^(.*)$' ; then
EFFECTIVE_PLATFORM="$PLATFORM"
elif echo "$PLATFORM" | grep -q / ; then
PLATFORM_PATH="$(cleanup_nix_path "$PLATFORM")"
EFFECTIVE_PLATFORM="(import $PLATFORM { try-reflex = this; })"
EFFECTIVE_PLATFORM="(import $PLATFORM { reflex-platform = this; try-reflex = builtins.trace \"WARNING: the try-reflex parameter is deprecated; please update your script to refer to reflex-platform instead\" this; })"
else
EFFECTIVE_PLATFORM="this.$PLATFORM"
fi
Expand Down

0 comments on commit 8f0a6e1

Please sign in to comment.