Skip to content
Closed
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
00ed3da
Update changelog for last release
JordanMartinez Mar 31, 2022
098fb42
Update purescript deps for 0.15.0; drop cst dep
JordanMartinez Apr 30, 2022
905d54d
Upgrade to latest pkg set; install entire set
JordanMartinez Apr 30, 2022
3880074
Get server code to compile
JordanMartinez Apr 30, 2022
37cf79a
Migrated FFI to ES modules via 'lebab'
JordanMartinez Apr 30, 2022
db55540
Removed '"use strict";' in FFI files
JordanMartinez Apr 30, 2022
479619b
Remove redundant import
JordanMartinez Apr 30, 2022
52dc624
Update to 0.15.0 for client
JordanMartinez Apr 30, 2022
473ca20
Migrate FFI in client to ES modules
JordanMartinez Apr 30, 2022
b8debc4
Account for breaking changes
JordanMartinez Apr 30, 2022
32c52a7
Fix spago transitive deps error
JordanMartinez Apr 30, 2022
c534443
Add changelog entry
JordanMartinez Apr 30, 2022
7c2b46e
Update spago to 0.20.9
JordanMartinez May 14, 2022
683e658
Support shims via es-module-shims
JordanMartinez May 14, 2022
c6d0300
Update package set to latest one; drop debug override
JordanMartinez May 14, 2022
958b736
Move setup/teardown iframe fns to FFI file
JordanMartinez May 14, 2022
b3f5009
Add jquery a dependency
JordanMartinez May 14, 2022
173330b
Just send JS code to iframe
JordanMartinez May 14, 2022
a431f57
Add http-server as dev dep
JordanMartinez May 14, 2022
0074fbd
Update package set to latest version
JordanMartinez May 17, 2022
022095c
Refactor scripts; include ace-builds as dev dep
JordanMartinez May 17, 2022
ee85437
Ignore vscode settings
JordanMartinez May 17, 2022
8c35d23
Fix API decoder
JordanMartinez May 17, 2022
7d599d9
Fix import sort
JordanMartinez May 17, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ Notable changes to this project are documented in this file. The format is based

## [Unreleased]

Breaking changes:
- Update compiler to v0.15.0 (#274 by @JordanMartinez)

New features:

Bugfixes:

Other improvements:

## [v2022-02-25.1](https://github.com/purescript/trypurescript/releases/tag/v2022-02-25.1)

Breaking changes:
- Update compiler to v0.14.7 (#271 by @JordanMartinez)

Expand Down
6 changes: 3 additions & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"build:production": "spago bundle-app --path config/prod/Try.Config.purs --purs-args '--censor-lib --strict' --to public/js/index.js"
},
"devDependencies": {
"purescript": "^0.13.6",
"purescript-psa": "^0.7.3",
"purescript": "^0.15.0",
"purescript-psa": "^0.8.2",
"rimraf": "^2.5.4",
"spago": "^0.14.0"
"spago": "^0.20.8"
}
}
22 changes: 7 additions & 15 deletions client/packages.dhall
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
let upstream =
https://github.com/purescript/package-sets/releases/download/psc-0.13.6-20200404/packages.dhall sha256:f239f2e215d0cbd5c203307701748581938f74c4c78f4aeffa32c11c131ef7b6
https://github.com/purescript/package-sets/releases/download/psc-0.15.0-20220429/packages.dhall
sha256:03c682bff56fc8f9d8c495ffcc6f524cbd3c89fe04778f965265c08757de8c9d

let additions =
{ ace =
{ repo = "https://github.com/purescript-contrib/purescript-ace.git"
, version = "v7.0.0"
{ debug =
{ repo = "https://github.com/working-group-purescript-es/purescript-debug.git"
, version = "v0.15.0-update"
, dependencies =
[ "arrays"
, "console"
, "effect"
, "foreign"
, "nullable"
, "prelude"
, "refs"
, "web-html"
, "web-uievents"
]
[ "console", "effect", "functions", "prelude" ]
}
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed once debug gets added to the package set.


in upstream // additions
15 changes: 12 additions & 3 deletions client/spago.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
[ "ace"
, "aff"
, "affjax"
, "affjax-web"
, "argonaut-codecs"
, "argonaut-core"
, "arrays"
, "assert"
, "bifunctors"
, "console"
, "const"
, "control"
, "datetime"
, "debug"
, "effect"
, "either"
Expand All @@ -18,16 +21,21 @@
, "foreign-object"
, "functions"
, "functors"
, "globals"
, "halogen"
, "halogen-subscriptions"
, "identity"
, "integers"
, "js-timers"
, "math"
, "js-uri"
, "lists"
, "maybe"
, "newtype"
, "node-buffer"
, "node-fs"
, "nullable"
, "ordered-collections"
, "parallel"
, "partial"
, "prelude"
, "profunctor"
, "psci-support"
Expand All @@ -38,8 +46,9 @@
, "transformers"
, "tuples"
, "unfoldable"
, "unsafe-coerce"
, "web-html"
]
, packages = ./packages.dhall
, sources = [ "src/**/*.purs", "test/**/*.purs" ]
, sources = [ "src/**/*.purs", "config/dev/**/*.purs", "test/**/*.purs" ]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should use 3 spago.dhall files: a shared one, one for dev and one for prod?

}
2 changes: 1 addition & 1 deletion client/src/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ import Halogen.VDom.Driver (runUI)
import Try.Container as Container

main :: Effect Unit
main = launchAff_ do
main = launchAff_ $ void do
body <- HA.awaitBody
runUI Container.component unit body
12 changes: 7 additions & 5 deletions client/src/Try/API.purs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ module Try.API
import Prelude

import Affjax (URL, printError)
import Affjax as AX
import Affjax.Web as AX
import Affjax.RequestBody as AXRB
import Affjax.ResponseFormat as AXRF
import Affjax.StatusCode (StatusCode(..))
import Control.Alt ((<|>))
import Control.Monad.Except (ExceptT(..))
import Data.Argonaut.Decode (class DecodeJson, decodeJson, (.:))
import Data.Argonaut.Decode (class DecodeJson, decodeJson, (.:), JsonDecodeError(..), printJsonDecodeError)
import Data.Argonaut.Encode (encodeJson)
import Data.Bifunctor (lmap)
import Data.Either (Either(..))
import Data.Maybe (Maybe(..))
import Data.Traversable (traverse)
Expand Down Expand Up @@ -53,8 +55,8 @@ instance decodeJsonCompileError :: DecodeJson CompileError where
map OtherError $ decodeJson contents
"CompilerErrors" ->
map CompilerErrors $ traverse decodeJson =<< decodeJson contents
_ ->
Left "Tag must be one of: OtherError, CompilerErrors"
j ->
Left $ AtKey "tag" $ UnexpectedValue $ encodeJson j

type Suggestion =
{ replacement :: String
Expand Down Expand Up @@ -105,6 +107,6 @@ compile endpoint code = ExceptT $ liftAff $ AX.post AXRF.json (endpoint <> "/com
Right { status } | status >= StatusCode 400 ->
pure $ Left $ "Received error status code: " <> show status
Right { body } ->
pure $ Right $ decodeJson body
pure $ lmap printJsonDecodeError $ decodeJson body
where
requestBody = Just $ AXRB.string code
6 changes: 2 additions & 4 deletions client/src/Try/Container.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
"use strict";

exports.setupIFrame = setupIFrame;
exports.teardownIFrame = teardownIFrame;
export {setupIFrame};
export {teardownIFrame};
Loading