Skip to content

Update to PureScript v0.15.0 #12

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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 (#12 by @JordanMartinez)

New features:

Expand Down
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"package.json"
],
"dependencies": {
"purescript-arraybuffer-types": "^3.0.0",
"purescript-web-file": "^3.0.0"
"purescript-arraybuffer-types": "main",
"purescript-web-file": "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"
}
}
14 changes: 6 additions & 8 deletions src/Web/Socket/Event/CloseEvent.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
"use strict";

exports.code = function (e) {
export function code(e) {
return e.code;
};
}

exports.reason = function (e) {
export function reason(e) {
return e.reason;
};
}

exports.wasClean = function (e) {
export function wasClean(e) {
return e.wasClean;
};
}
14 changes: 6 additions & 8 deletions src/Web/Socket/Event/MessageEvent.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
"use strict";

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

exports.origin = function (e) {
export function origin(e) {
return e.origin;
};
}

exports.lastEventId = function (e) {
export function lastEventId(e) {
return e.lastEventId;
};
}
42 changes: 20 additions & 22 deletions src/Web/Socket/WebSocket.js
Original file line number Diff line number Diff line change
@@ -1,67 +1,65 @@
"use strict";

exports.create = function (url) {
export function create(url) {
return function (protocols) {
return function () {
return new WebSocket(url, protocols);
};
};
};
}

exports.url = function (ws) {
export function url(ws) {
return function () {
return ws.url;
};
};
}

exports.readyStateImpl = function (ws) {
export function readyStateImpl(ws) {
return function () {
return ws.readyState;
};
};
}

exports.bufferedAmount = function (ws) {
export function bufferedAmount(ws) {
return function () {
return ws.bufferedAmount;
};
};
}

exports.extensions = function (ws) {
export function extensions(ws) {
return function () {
return ws.extensions;
};
};
}

exports.protocol = function (ws) {
export function protocol(ws) {
return function () {
return ws.protocol;
};
};
}

exports.close = function (ws) {
export function close(ws) {
return function () {
return ws.close();
};
};
}

exports.getBinaryTypeImpl = function (ws) {
export function getBinaryTypeImpl(ws) {
return function () {
return ws.binaryType;
};
};
}

exports.setBinaryTypeImpl = function (ws) {
export function setBinaryTypeImpl(ws) {
return function (bt) {
return function () {
ws.binaryType = bt;
};
};
};
}

exports.sendImpl = function (ws) {
export function sendImpl(ws) {
return function (value) {
return function () {
ws.send(value);
};
};
};
}