Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: thomashoneyman/purescript-halogen-formless
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.0.0
Choose a base ref
...
head repository: thomashoneyman/purescript-halogen-formless
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 8 commits
  • 5 files changed
  • 4 contributors

Commits on May 30, 2022

  1. Copy the full SHA
    5616616 View commit details
  2. Copy the full SHA
    937f99a View commit details

Commits on Jun 23, 2022

  1. Add bowerfile

    thomashoneyman committed Jun 23, 2022
    Copy the full SHA
    3b44f95 View commit details
  2. v4.0.0 → v4.0.1

    thomashoneyman committed Jun 23, 2022
    Copy the full SHA
    620198c View commit details
  3. Copy the full SHA
    2f6574b View commit details
  4. v4.0.2

    thomashoneyman committed Jun 23, 2022
    Copy the full SHA
    2d195d2 View commit details

Commits on Jun 1, 2023

  1. De-duplicate FormConfig fields (#92)

    Co-authored-by: Daniil Iaitskov <daniil.iaitskov@soostone.com>
    yaitskov and Daniil Iaitskov authored Jun 1, 2023
    Copy the full SHA
    6e427a1 View commit details
  2. Delete bower.json

    thomashoneyman authored Jun 1, 2023
    Copy the full SHA
    68e3bb9 View commit details
Showing with 45 additions and 50 deletions.
  1. +1 −1 .github/workflows/storybook.yml
  2. +24 −22 README.md
  3. +2 −7 packages.dhall
  4. +16 −14 shell.nix
  5. +2 −6 src/Formless.purs
2 changes: 1 addition & 1 deletion .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ jobs:
- uses: thomashoneyman/setup-purescript@main

- name: Install esbuild
run: npm install --global --global esbuild@0.14.38
run: npm install --global esbuild@0.13.12

- name: Build Storybook
run: npm run storybook
46 changes: 24 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -18,33 +18,35 @@ Install Formless with Spago:
$ spago install halogen-formless
```

Formless 3 is available in package sets beginning with `psc-0.14.7-20220303`. If you are using an older package set, then you should add an override to your `packages.dhall` file as in the example below. Older package sets do not include `variant >=7.1.0` either, so you will need to override that also.
Formless 3 is available in package sets beginning with `psc-0.14.7-20220303`. If you are using a package set that does not include Formless, then you can add it to your local set as shown in the example below:

```dhall
let upstream = ...

in upstream
with variant.version = "v7.1.0"
with halogen-formless.version = "v3.0.0"
with halogen-formless.dependencies =
[ "convertable-options"
, "effect"
, "either"
, "foldable-traversable"
, "foreign-object"
, "halogen"
, "heterogeneous"
, "maybe"
, "prelude"
, "record"
, "safe-coerce"
, "type-equality"
, "unsafe-coerce"
, "unsafe-reference"
, "variant"
, "web-events"
, "web-uievents"
]
with halogen-formless =
{ version = "v3.0.0"
, repo = "https://github.com/thomashoneyman/purescript-halogen-formless.git"
, dependencies =
[ "convertable-options"
, "effect"
, "either"
, "foldable-traversable"
, "foreign-object"
, "halogen"
, "heterogeneous"
, "maybe"
, "prelude"
, "record"
, "safe-coerce"
, "type-equality"
, "unsafe-coerce"
, "unsafe-reference"
, "variant"
, "web-events"
, "web-uievents"
]
}
```

## Tutorial
9 changes: 2 additions & 7 deletions packages.dhall
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
let upstream =
https://github.com/purescript/package-sets/releases/download/psc-0.15.0-20220502/packages.dhall
sha256:38d347aeba9fe6359c208abe87a5cecf1ffb14294f11ad19664ae35c59b6e29a
https://github.com/purescript/package-sets/releases/download/psc-0.15.0-20220527/packages.dhall
sha256:15dd8041480502850e4043ea2977ed22d6ab3fc24d565211acde6f8c5152a799

in upstream
with halogen-storybook =
{ dependencies = [ "halogen", "routing", "foreign-object" ]
, repo = "https://github.com/CarstenKoenig/purescript-halogen-storybook.git"
, version = "purs015"
}
30 changes: 16 additions & 14 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -12,18 +12,20 @@ let
repo = "easy-purescript-nix";
rev = "0ad5775c1e80cdd952527db2da969982e39ff592";
sha256 = "0x53ads5v8zqsk4r1mfpzf5913byifdpv5shnvxpgw634ifyj1kg";
}) { inherit pkgs; };
}) {inherit pkgs;};
in
pkgs.stdenv.mkDerivation {
name = "halogen-formless";
buildInputs = with pursPkgs; [
purs
spago
psa
purs-tidy
purescript-language-server
pulp

in pkgs.stdenv.mkDerivation {
name = "halogen-formless";
buildInputs = with pursPkgs; [
pursPkgs.purs
pursPkgs.spago
pursPkgs.psa
pursPkgs.purs-tidy
pursPkgs.purescript-language-server

pkgs.nodejs-16_x
pkgs.esbuild
];
}
pkgs.nodejs-16_x
pkgs.nodePackages.bower
pkgs.esbuild
];
}
8 changes: 2 additions & 6 deletions src/Formless.purs
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ module Formless
, validateM
, FormContext
, FormConfig
, OptionalFormConfig
, FormQuery(..)
, FormState
, FormAction
@@ -144,12 +145,7 @@ type FieldOutput :: Type -> Type -> Type -> Type
type FieldOutput input error output = output

-- | Available settings for controlling the form's behavior.
type FormConfig =
{ validateOnBlur :: Boolean
, validateOnChange :: Boolean
, validateOnModify :: Boolean
, validateOnMount :: Boolean
}
type FormConfig = { | OptionalFormConfig }

type InitialFormConfig :: Row Type -> Type -> Type
type InitialFormConfig fields action =