Skip to content

Update to PureScript v0.15.0 #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4 changes: 2 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"parserOptions": {
"ecmaVersion": 5
"ecmaVersion": 6,
"sourceType": "module"
},
"extends": "eslint:recommended",
"env": {
"commonjs": true,
"browser": true
},
"rules": {
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ jobs:
- uses: actions/checkout@v2

- uses: purescript-contrib/setup-purescript@main
with:
purescript: "unstable"

- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: "10"
node-version: "14"

- name: Install dependencies
run: |
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Notable changes to this project are documented in this file. The format is based
## [Unreleased]

Breaking changes:
- Migrate FFI to ES modules (#51 by @JordanMartinez)

New features:

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"package.json"
],
"dependencies": {
"purescript-web-events": "^3.0.0"
"purescript-web-events": "master"
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
},
"devDependencies": {
"eslint": "^7.15.0",
"pulp": "^15.0.0",
"purescript-psa": "^0.8.0",
"pulp": "16.0.0-0",
"purescript-psa": "^0.8.2",
"rimraf": "^3.0.2"
}
}
30 changes: 14 additions & 16 deletions src/Web/DOM/CharacterData.js
Original file line number Diff line number Diff line change
@@ -1,56 +1,54 @@
"use strict";

exports.data_ = function (t) {
export function data_(t) {
return function () {
return t.data;
};
};
}

exports.length = function (t) {
export function length(t) {
return function () {
return t.length;
};
};
}

exports.substringData = function (offset) {
export function substringData(offset) {
return function (count) {
return function (cd) {
return function () {
cd.substringData(offset, count);
};
};
};
};
}

exports.appendData = function (data) {
export function appendData(data) {
return function (cd) {
return function () {
cd.appendData(data);
};
};
};
}

exports.insertData = function (offset) {
export function insertData(offset) {
return function (data) {
return function (cd) {
return function () {
cd.insertData(offset, data);
};
};
};
};
}

exports.deleteData = function (offset) {
export function deleteData(offset) {
return function (count) {
return function (cd) {
return function () {
cd.deleteData(offset, count);
};
};
};
};
}

exports.replaceData = function (offset) {
export function replaceData(offset) {
return function (count) {
return function (data) {
return function (cd) {
Expand All @@ -60,4 +58,4 @@ exports.replaceData = function (offset) {
};
};
};
};
}
6 changes: 2 additions & 4 deletions src/Web/DOM/ChildNode.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"use strict";

exports.remove = function (node) {
export function remove(node) {
return function () {
return node.remove();
};
};
}
26 changes: 12 additions & 14 deletions src/Web/DOM/DOMTokenList.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,49 @@
"use strict";

exports.add = function(list) {
export function add(list) {
return function(token) {
return function() {
return list.add(token);
};
};
};
}

exports.remove = function(list) {
export function remove(list) {
return function(token) {
return function() {
return list.remove(token);
};
};
};
}

exports.contains = function(list) {
export function contains(list) {
return function(token) {
return function() {
return list.contains(token);
};
};
};
}

exports.toggle = function(list) {
export function toggle(list) {
return function(token) {
return function() {
return list.toggle(token);
};
};
};
}

exports.toggleForce = function(list) {
export function toggleForce(list) {
return function(token) {
return function(force) {
return function() {
return list.toggle(token, force);
};
};
};
};
}

exports._item = function(list) {
export function _item(list) {
return function(index) {
return function() {
return list.item(index);
};
};
};
}
63 changes: 30 additions & 33 deletions src/Web/DOM/Document.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use strict";

var getEffProp = function (name) {
return function (doc) {
return function () {
Expand All @@ -8,106 +6,105 @@ var getEffProp = function (name) {
};
};

exports.url = getEffProp("URL");
exports.documentURI = getEffProp("documentURI");
exports.origin = getEffProp("origin");
exports.compatMode = getEffProp("compatMode");
exports.characterSet = getEffProp("characterSet");
exports.contentType = getEffProp("contentType");

exports._doctype = getEffProp("doctype");
exports._documentElement = getEffProp("documentElement");
export const url = getEffProp("URL");
export const documentURI = getEffProp("documentURI");
export const origin = getEffProp("origin");
export const compatMode = getEffProp("compatMode");
export const characterSet = getEffProp("characterSet");
export const contentType = getEffProp("contentType");
export const _doctype = getEffProp("doctype");
export const _documentElement = getEffProp("documentElement");

exports.getElementsByTagName = function (localName) {
export function getElementsByTagName(localName) {
return function (doc) {
return function () {
return doc.getElementsByTagName(localName);
};
};
};
}

exports._getElementsByTagNameNS = function (ns) {
export function _getElementsByTagNameNS(ns) {
return function (localName) {
return function (doc) {
return function () {
return doc.getElementsByTagNameNS(ns, localName);
};
};
};
};
}

exports.getElementsByClassName = function (classNames) {
export function getElementsByClassName(classNames) {
return function (doc) {
return function () {
return doc.getElementsByClassName(classNames);
};
};
};
}

exports.createElement = function (localName) {
export function createElement(localName) {
return function (doc) {
return function () {
return doc.createElement(localName);
};
};
};
}

exports._createElementNS = function (ns) {
export function _createElementNS(ns) {
return function (qualifiedName) {
return function (doc) {
return function () {
return doc.createElementNS(ns, qualifiedName);
};
};
};
};
}

exports.createDocumentFragment = function (doc) {
export function createDocumentFragment(doc) {
return function () {
return doc.createDocumentFragment();
};
};
}

exports.createTextNode = function (data) {
export function createTextNode(data) {
return function (doc) {
return function () {
return doc.createTextNode(data);
};
};
};
}

exports.createComment = function (data) {
export function createComment(data) {
return function (doc) {
return function () {
return doc.createComment(data);
};
};
};
}

exports.createProcessingInstruction = function (target) {
export function createProcessingInstruction(target) {
return function (data) {
return function (doc) {
return function () {
return doc.createProcessingInstruction(target, data);
};
};
};
};
}

exports.importNode = function (node) {
export function importNode(node) {
return function (deep) {
return function (doc) {
return function () {
return doc.importNode(node, deep);
};
};
};
};
}

exports.adoptNode = function (node) {
export function adoptNode(node) {
return function (doc) {
return function () {
return doc.adoptNode(node);
};
};
};
}
8 changes: 3 additions & 5 deletions src/Web/DOM/DocumentType.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
"use strict";

var getProp = function (name) {
return function (doctype) {
return doctype[name];
};
};

exports.name = getProp("name");
exports.publicId = getProp("publicId");
exports.systemId = getProp("systemId");
export const name = getProp("name");
export const publicId = getProp("publicId");
export const systemId = getProp("systemId");
Loading