Skip to content

Commit 341d123

Browse files
committed
Revert to v11.0.1 for issue #37
1 parent ff9e181 commit 341d123

File tree

8 files changed

+46
-31
lines changed

8 files changed

+46
-31
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ blank_issues_enabled: false
22
contact_links:
33
- name: PureScript Discourse
44
url: https://discourse.purescript.org/
5-
about: Ask and answer questions on the PureScript discussion forum.
6-
- name: PureScript Discord
7-
url: https://purescript.org/chat
8-
about: Ask and answer questions on the PureScript chat.
5+
about: Ask and answer questions here.
6+
- name: Functional Programming Slack
7+
url: https://functionalprogramming.slack.com
8+
about: For casual chat and questions (use https://fpchat-invite.herokuapp.com to join).

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
language: node_js
2+
sudo: required
3+
dist: trusty
4+
node_js: 8
5+
install:
6+
- npm install -g purescript pulp bower
7+
script:
8+
- bower install
9+
- pulp test

CHANGELOG.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
Notable changes to this project are documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
44

5-
## v11.0.2
6-
7-
Delete the `TypedArray` polyfill which was preventing this
8-
library from working with `purs bundle` v0.14.4.
9-
https://github.com/purescript-contrib/purescript-arraybuffer/issues/34
10-
115
## v11.0.0
126

137
Jorge Acereda has graciously donated this package to __purescript-contrib__.
@@ -34,4 +28,3 @@ to the type declarations in your own dependent code:
3428
* Replace any `BytesPerValue a b` typeclass constraints with `BytesPerType a`.
3529

3630
We have also privatized `Typed.part'`. https://github.com/purescript-contrib/purescript-arraybuffer/issues/32
37-

README.md

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ spago install arraybuffer
4141
If you get stuck, there are several ways to get help:
4242

4343
- [Open an issue](https://github.com/purescript-contrib/purescript-arraybuffer/issues) if you have encountered a bug or problem.
44-
- Ask general questions on the [PureScript Discourse](https://discourse.purescript.org) forum or the [PureScript Discord](https://purescript.org/chat) chat.
44+
- [Search or start a thread on the PureScript Discourse](https://discourse.purescript.org) if you have general questions. You can also ask questions in the `#purescript` and `#purescript-beginners` channels on the [Functional Programming Slack](https://functionalprogramming.slack.com) ([invite link](https://fpchat-invite.herokuapp.com/)).
4545

4646
## Contributing
4747

@@ -53,23 +53,6 @@ You can contribute to `arraybuffer` in several ways:
5353

5454
3. If you have written a library, tutorial, guide, or other resource based on this package, please share it on the [PureScript Discourse](https://discourse.purescript.org)! Writing libraries and learning resources are a great way to help this library succeed.
5555

56-
## Usage
57-
58-
### Polyfill
59-
60-
This library relies on runtime implementations of
61-
[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)
62-
and
63-
[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)
64-
([Structured Data](https://tc39.es/ecma262/multipage/structured-data.html#sec-structured-data)),
65-
and
66-
[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)
67-
([Indexed Collections](https://tc39.es/ecma262/multipage/indexed-collections.html#sec-indexed-collections)).
68-
69-
If you want to be sure that those implementations are available in your target
70-
runtime environment, you might want to consider using a polyfill such as
71-
[__core-js__ Typed Arrays](https://github.com/zloirock/core-js#ecmascript-typed-arrays).
72-
7356
## Related packages
7457

7558
These are some other packages which provide more `ArrayBuffer` features.

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"output"
1515
],
1616
"dependencies": {
17-
"purescript-arraybuffer-types": "^v3.0.1",
17+
"purescript-arraybuffer-types": "^v3.0.0",
1818
"purescript-arrays": "^v6.0.1",
1919
"purescript-effect": "^v3.0.0",
2020
"purescript-float32": "^v1.0.0",

package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "purescript-arraybuffer",
3+
"version": "11.0.0",
4+
"main": "index.js",
5+
"repository": "git@github.com:jacereda/purescript-arraybuffer.git",
6+
"author": "https://github.com/jacereda",
7+
"license": "MIT",
8+
"devDependencies": {}
9+
}

packages.dhall

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
12
let upstream =
2-
https://github.com/purescript/package-sets/releases/download/psc-0.14.3-20210722/packages.dhall sha256:1ceb43aa59436bf5601bac45f6f3781c4e1f0e4c2b8458105b018e5ed8c30f8c
3+
https://github.com/purescript/package-sets/releases/download/psc-0.14.2-20210713/packages.dhall sha256:654c3148cb995f642c73b4508d987d9896e2ad3ea1d325a1e826c034c0d3cd7b
34

45
let overrides = {=}
56

67
let additions = {=}
78

89
in upstream // overrides // additions
10+

src/Data/ArrayBuffer/Typed.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
"use strict";
22

3+
4+
5+
// Lightweight polyfill for ie - see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#Methods_Polyfill
6+
function polyFill () {
7+
var typedArrayTypes =
8+
[ Int8Array, Uint8Array, Uint8ClampedArray, Int16Array
9+
, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array
10+
];
11+
12+
for (var k in typedArrayTypes) {
13+
for (var v in Array.prototype) {
14+
if (Array.prototype.hasOwnProperty(v) && !typedArrayTypes[k].prototype.hasOwnProperty(v))
15+
typedArrayTypes[k].prototype[v] = Array.prototype[v];
16+
}
17+
}
18+
};
19+
20+
polyFill();
21+
322
// module Data.ArrayBuffer.Typed
423

524
exports.buffer = function buffer (v) {

0 commit comments

Comments
 (0)