Skip to content

Commit 0e48e3d

Browse files
Update to PureScript v0.15.0 (#14)
* Migrated FFI to ES modules via 'lebab' * Replaced 'export var' with 'export const' * Removed '"use strict";' in FFI files * Update to CI to use 'unstable' purescript * Update Bower dependencies to master or main * Update pulp to 16.0.0-0 * Update psa to 0.8.2 * Update .eslintrc.json to ES6 * Update CI to use Node 14 * Added changelog entry
1 parent be38151 commit 0e48e3d

File tree

11 files changed

+50
-59
lines changed

11 files changed

+50
-59
lines changed

.eslintrc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"parserOptions": {
3-
"ecmaVersion": 5
3+
"ecmaVersion": 6,
4+
"sourceType": "module"
45
},
56
"extends": "eslint:recommended",
67
"env": {
7-
"commonjs": true,
88
"browser": true
99
},
1010
"rules": {

.github/workflows/ci.yml

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

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

17-
- uses: actions/setup-node@v1
19+
- uses: actions/setup-node@v2
1820
with:
19-
node-version: "10"
21+
node-version: "14"
2022

2123
- name: Install dependencies
2224
run: |

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 (#14 by @JordanMartinez)
89

910
New features:
1011

bower.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"package.json"
1616
],
1717
"dependencies": {
18-
"purescript-web-dom": "^5.0.0",
19-
"purescript-web-html": "^3.0.0",
20-
"purescript-web-uievents": "^3.0.0"
18+
"purescript-web-dom": "master",
19+
"purescript-web-html": "master",
20+
"purescript-web-uievents": "master"
2121
}
2222
}

package.json

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

src/Web/CSSOM.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Web.CSSOM
2-
"use strict";
3-
4-
exports.getStyleSheets = function(doc) {
2+
export function getStyleSheets(doc) {
53
return function() {
64
return doc.styleSheets;
75
};
8-
};
6+
}

src/Web/CSSOM/CSSStyleDeclaration.js

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,53 @@
1-
"use strict";
2-
3-
exports.cssText = function (style) {
1+
export function cssText(style) {
42
return function () {
53
return style.cssText;
64
};
7-
};
5+
}
86

9-
exports.setCssText = function (style) {
7+
export function setCssText(style) {
108
return function (newCSS) {
119
return function () {
1210
style.cssText = newCSS;
1311
};
1412
};
15-
};
13+
}
1614

17-
exports.length = function (style) {
15+
export function length(style) {
1816
return function () {
1917
return style.length;
2018
};
21-
};
19+
}
2220

23-
exports.getPropertyPriority = function (style) {
21+
export function getPropertyPriority(style) {
2422
return function (propName) {
2523
return function () {
2624
return style.getPropertyPriority(propName);
2725
};
2826
};
29-
};
27+
}
3028

31-
exports.getPropertyValue = function (style) {
29+
export function getPropertyValue(style) {
3230
return function (propName) {
3331
return function () {
3432
return style.getPropertyValue(propName);
3533
};
3634
};
37-
};
35+
}
3836

39-
exports.removeProperty = function (style) {
37+
export function removeProperty(style) {
4038
return function (propName) {
4139
return function () {
4240
style.removeProperty(propName);
4341
};
4442
};
45-
};
43+
}
4644

47-
exports.setProperty = function (style) {
45+
export function setProperty(style) {
4846
return function (propName) {
4947
return function (propValue) {
5048
return function () {
5149
style.setProperty(propName, propValue);
5250
};
5351
};
5452
};
55-
};
53+
}

src/Web/CSSOM/CSSStyleSheet.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,28 @@
1-
"use strict";
2-
31
var getProp = function (name) {
42
return function (sheet) {
53
return sheet[name];
64
};
75
};
86

9-
exports.disabled = getProp("disabled");
10-
exports._href = getProp("href");
11-
exports._ownerNode = getProp("ownerNode");
12-
exports._parentStyleSheet = getProp("parentStyleSheet");
13-
exports._title = getProp("title");
14-
exports._type = getProp("type");
7+
export const disabled = getProp("disabled");
8+
export const _href = getProp("href");
9+
export const _ownerNode = getProp("ownerNode");
10+
export const _parentStyleSheet = getProp("parentStyleSheet");
11+
export const _title = getProp("title");
12+
export const _type = getProp("type");
1513

16-
exports.setDisabled = function (bool) {
14+
export function setDisabled(bool) {
1715
return function (sheet) {
1816
return function () {
1917
sheet.disabled = bool;
2018
};
2119
};
22-
};
20+
}
2321

24-
exports.toggleDisabled = function (sheet) {
22+
export function toggleDisabled(sheet) {
2523
return function () {
2624
var bool = !sheet.disabled;
2725
sheet.disabled = bool;
2826
return bool;
2927
};
30-
};
28+
}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
"use strict";
2-
3-
exports.style = function (el) {
1+
export function style(el) {
42
return function () {
53
return el.style;
64
};
7-
};
5+
}

src/Web/CSSOM/MouseEvent.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
"use strict";
2-
3-
exports.offsetX = function (e) {
1+
export function offsetX(e) {
42
return e.offsetX;
5-
};
3+
}
64

7-
exports.offsetY = function (e) {
5+
export function offsetY(e) {
86
return e.offsetY;
9-
};
7+
}

src/Web/CSSOM/StyleSheetList.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
"use strict";
2-
3-
exports.length = function (list) {
1+
export function length(list) {
42
return function () {
53
return list.length;
64
};
7-
};
5+
}
86

9-
exports.toArray = function (list) {
7+
export function toArray(list) {
108
return function () {
119
return Array.prototype.slice.call(list);
1210
};
13-
};
11+
}
1412

15-
exports._item = function (index) {
13+
export function _item(index) {
1614
return function (list) {
1715
return function () {
1816
return list.item(index);
1917
};
2018
};
21-
};
19+
}

0 commit comments

Comments
 (0)