Skip to content

Commit dedc714

Browse files
Update to v0.15.0 (#39)
* Convert foreign modules to try bundling with esbuild * Replaced 'export var' with 'export const' * Removed '"use strict";' in FFI files * Update to CI to use 'unstable' purescript * Update pulp to 16.0.0-0 and psa to 0.8.2 * Update Bower dependencies to master * Update .eslintrc.json to ES6 * Added changelog entry Co-authored-by: Cyril Sobierajewicz <[email protected]>
1 parent f66d3cd commit dedc714

File tree

7 files changed

+19
-17
lines changed

7 files changed

+19
-17
lines changed

.eslintrc.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
{
22
"parserOptions": {
3-
"ecmaVersion": 5
3+
"ecmaVersion": 6,
4+
"sourceType": "module"
45
},
56
"extends": "eslint:recommended",
6-
"env": {
7-
"commonjs": true
8-
},
97
"rules": {
108
"strict": [2, "global"],
119
"block-scoped-var": 2,

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
- uses: actions/checkout@v2
1414

1515
- uses: purescript-contrib/setup-purescript@main
16+
with:
17+
purescript: "unstable"
1618

1719
- uses: actions/setup-node@v1
1820
with:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Notable changes to this project are documented in this file. The format is based
55
## [Unreleased]
66

77
Breaking changes:
8+
- Migrate FFI to ES modules (#39 by @kl0tl and @JordanMartinez)
89

910
New features:
1011

bower.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
"package.json"
1717
],
1818
"dependencies": {
19-
"purescript-effect": "^3.0.0",
20-
"purescript-prelude": "^5.0.0"
19+
"purescript-effect": "master",
20+
"purescript-prelude": "master"
2121
},
2222
"devDependencies": {
23-
"purescript-assert": "^5.0.0"
23+
"purescript-assert": "master"
2424
}
2525
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
},
88
"devDependencies": {
99
"eslint": "^7.15.0",
10-
"pulp": "^15.0.0",
11-
"purescript-psa": "^0.8.0",
10+
"pulp": "16.0.0-0",
11+
"purescript-psa": "^0.8.2",
1212
"rimraf": "^3.0.2"
1313
}
1414
}

src/Effect/Ref.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
1-
"use strict";
2-
3-
exports.new = function (val) {
1+
export const _new = function (val) {
42
return function () {
53
return { value: val };
64
};
75
};
86

9-
exports.newWithSelf = function (f) {
7+
export const newWithSelf = function (f) {
108
return function () {
119
var ref = { value: null };
1210
ref.value = f(ref);
1311
return ref;
1412
};
1513
};
1614

17-
exports.read = function (ref) {
15+
export const read = function (ref) {
1816
return function () {
1917
return ref.value;
2018
};
2119
};
2220

23-
exports.modifyImpl = function (f) {
21+
export const modifyImpl = function (f) {
2422
return function (ref) {
2523
return function () {
2624
var t = f(ref.value);
@@ -30,7 +28,7 @@ exports.modifyImpl = function (f) {
3028
};
3129
};
3230

33-
exports.write = function (val) {
31+
export const write = function (val) {
3432
return function (ref) {
3533
return function () {
3634
ref.value = val;

src/Effect/Ref.purs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ foreign import data Ref :: Type -> Type
4141
type role Ref representational
4242

4343
-- | Create a new mutable reference containing the specified value.
44-
foreign import new :: forall s. s -> Effect (Ref s)
44+
foreign import _new :: forall s. s -> Effect (Ref s)
45+
46+
new :: forall s. s -> Effect (Ref s)
47+
new = _new
4548

4649
-- | Create a new mutable reference containing a value that can refer to the
4750
-- | `Ref` being created.

0 commit comments

Comments
 (0)