@thi.ng/soa 0.3.8 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/CHANGELOG.md +83 -35
  2. package/README.md +1 -1
  3. package/package.json +102 -97
  4. package/soa.js +2 -2
package/CHANGELOG.md CHANGED
@@ -1,76 +1,124 @@
1
1
  # Change Log
2
2
 
3
+ - **Last updated**: 2021-11-21T17:09:28Z
4
+ - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
+
3
6
  All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
7
+ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelines.
5
8
 
6
- ## [0.3.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/soa@0.3.7...@thi.ng/soa@0.3.8) (2021-11-04)
9
+ **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
+ and/or version bumps of transitive dependencies.
7
11
 
8
- **Note:** Version bump only for package @thi.ng/soa
12
+ ## [0.4.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/soa@0.4.0) (2021-11-17)
9
13
 
14
+ #### 🚀 Features
10
15
 
16
+ - Using workspaces for local tools ([bf7a404](https://github.com/thi-ng/umbrella/commit/bf7a404))
17
+ Improving the overall build ergonomics
18
+ - introduced a tools workspaces
19
+ - imported it in all needed packages/examples
20
+ - inclusive project root
11
21
 
22
+ #### ♻️ Refactoring
12
23
 
24
+ - testrunner to binary ([4ebbbb2](https://github.com/thi-ng/umbrella/commit/4ebbbb2))
25
+ this commit reverts (partly) changes made in:
26
+ ef346d7a8753590dc9094108a3d861a8dbd5dd2c
27
+ overall purpose is better testament ergonomics:
28
+ instead of having to pass NODE_OPTIONS with every invocation
29
+ having a binary to handle this for us.
13
30
 
14
- ## [0.3.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/soa@0.3.6...@thi.ng/soa@0.3.7) (2021-11-03)
31
+ ### [0.3.9](https://github.com/thi-ng/umbrella/tree/@thi.ng/soa@0.3.9) (2021-11-10)
15
32
 
16
- **Note:** Version bump only for package @thi.ng/soa
33
+ #### ♻️ Refactoring
17
34
 
35
+ - update all countdown loops ([a5f374b](https://github.com/thi-ng/umbrella/commit/a5f374b))
18
36
 
37
+ ### [0.3.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/soa@0.3.1) (2021-10-13)
19
38
 
39
+ #### ♻️ Refactoring
20
40
 
41
+ - update imports in all tests/pkgs ([effd591](https://github.com/thi-ng/umbrella/commit/effd591))
42
+ - update imports in all pkgs ([5fa2b6f](https://github.com/thi-ng/umbrella/commit/5fa2b6f))
43
+ - add .js suffix for all relative imports
21
44
 
22
- # [0.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/soa@0.2.25...@thi.ng/soa@0.3.0) (2021-10-12)
45
+ ## [0.3.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/soa@0.3.0) (2021-10-12)
23
46
 
47
+ #### 🛑 Breaking changes
24
48
 
25
- ### Build System
49
+ - major update of ALL pkgs (export maps, ESM only) ([0d1d6ea](https://github.com/thi-ng/umbrella/commit/0d1d6ea))
50
+ - BREAKING CHANGE: discontinue CommonJS & UMD versions
51
+ - only ESM modules will be published from now on
52
+ - CJS obsolete due to ESM support in recent versions of node:
53
+ - i.e. launch NodeJS via:
54
+ - `node --experimental-specifier-resolution=node --experimental-repl-await`
55
+ - in the node REPL use `await import(...)` instead of `require()`
56
+ - UMD obsolete due to widespread browser support for ESM
57
+ Also:
58
+ - normalize/restructure/reorg all package.json files
59
+ - cleanup all build scripts, remove obsolete
60
+ - switch from mocha to [@thi.ng/testament](https://github.com/thi-ng/umbrella/tree/main/packages/testament) for all tests
26
61
 
27
- * major update of ALL pkgs (export maps, ESM only) ([0d1d6ea](https://github.com/thi-ng/umbrella/commit/0d1d6ea9fab2a645d6c5f2bf2591459b939c09b6))
62
+ #### ♻️ Refactoring
28
63
 
64
+ - minor pkg restructure (various) ([47f88d2](https://github.com/thi-ng/umbrella/commit/47f88d2))
65
+ - update deps & imports in various pkgs ([e1cf29e](https://github.com/thi-ng/umbrella/commit/e1cf29e))
66
+ - largely related to recent updates/restructuring of these packages:
67
+ - api
68
+ - defmulti
69
+ - errors
70
+ - logger
71
+ - update imports ([138571a](https://github.com/thi-ng/umbrella/commit/138571a))
72
+ - update all tests in _all_ pkgs ([8b582bc](https://github.com/thi-ng/umbrella/commit/8b582bc))
73
+ - update all to use [@thi.ng/testament](https://github.com/thi-ng/umbrella/tree/main/packages/testament)
29
74
 
30
- ### BREAKING CHANGES
75
+ ### [0.2.7](https://github.com/thi-ng/umbrella/tree/@thi.ng/soa@0.2.7) (2021-03-17)
31
76
 
32
- * discontinue CommonJS & UMD versions
77
+ #### ♻️ Refactoring
33
78
 
34
- - only ESM modules will be published from now on
35
- - CJS obsolete due to ESM support in recent versions of node:
36
- - i.e. launch NodeJS via:
37
- - `node --experimental-specifier-resolution=node --experimental-repl-await`
38
- - in the node REPL use `await import(...)` instead of `require()`
39
- - UMD obsolete due to widespread browser support for ESM
79
+ - dedupe OOB error handling ([1988ccd](https://github.com/thi-ng/umbrella/commit/1988ccd))
40
80
 
41
- Also:
42
- - normalize/restructure/reorg all package.json files
43
- - cleanup all build scripts, remove obsolete
44
- - switch from mocha to @thi.ng/testament for all tests
81
+ ## [0.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/soa@0.2.0) (2021-02-20)
45
82
 
83
+ #### 🛑 Breaking changes
46
84
 
85
+ - update attrib type handling ([274dadf](https://github.com/thi-ng/umbrella/commit/274dadf))
86
+ - BREAKING CHANGE: attrib buffer data type use string consts
87
+ - part of unified umbrella-wide changes to [@thi.ng/api](https://github.com/thi-ng/umbrella/tree/main/packages/api) Type alias
88
+ (see [a333d4182](https://github.com/thi-ng/umbrella/commit/a333d4182))
47
89
 
90
+ ### [0.1.36](https://github.com/thi-ng/umbrella/tree/@thi.ng/soa@0.1.36) (2020-09-13)
48
91
 
92
+ #### ♻️ Refactoring
49
93
 
94
+ - update imports ([8c888c0](https://github.com/thi-ng/umbrella/commit/8c888c0))
50
95
 
51
- # [0.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/soa@0.1.47...@thi.ng/soa@0.2.0) (2021-02-20)
96
+ ### [0.1.4](https://github.com/thi-ng/umbrella/tree/@thi.ng/soa@0.1.4) (2020-02-25)
52
97
 
53
- ### Code Refactoring
98
+ #### ♻️ Refactoring
54
99
 
55
- - **soa:** update attrib type handling ([274dadf](https://github.com/thi-ng/umbrella/commit/274dadf2507ac4daeea59c53a0f408343d582d8e))
100
+ - update imports ([863e4f6](https://github.com/thi-ng/umbrella/commit/863e4f6))
56
101
 
57
- ### BREAKING CHANGES
102
+ ## [0.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/soa@0.1.0) (2019-11-09)
58
103
 
59
- - **soa:** attrib buffer data type use string consts
60
- - part of unified umbrella-wide changes to thi.ng/api Type alias (see a333d4182)
104
+ #### 🚀 Features
61
105
 
62
- # 0.1.0 (2019-11-09)
106
+ - update SOAAttribSpec.buf to use ArrayBuffer w/ opt offset ([2759570](https://github.com/thi-ng/umbrella/commit/2759570))
107
+ - update aos() buffer handling
108
+ - update SOA.initSpecs()
109
+ - update tests
110
+ - add/update types, update aos(), add SOA.setValues(), tests ([b8e0780](https://github.com/thi-ng/umbrella/commit/b8e0780))
111
+ - add new pkg [@thi.ng/soa](https://github.com/thi-ng/umbrella/tree/main/packages/soa) ([5f8ffa1](https://github.com/thi-ng/umbrella/commit/5f8ffa1))
63
112
 
64
- ### Bug Fixes
113
+ #### 🩹 Bug fixes
65
114
 
66
- - **soa:** remove obsolete imports ([2309ccd](https://github.com/thi-ng/umbrella/commit/2309ccd6e581b6f385f4a2720fd2ad5cfb8a0d79))
115
+ - remove obsolete imports ([2309ccd](https://github.com/thi-ng/umbrella/commit/2309ccd))
67
116
 
68
- ### Features
117
+ #### ⏱ Performance improvements
69
118
 
70
- - **soa:** add new pkg [@thi](https://github.com/thi).ng/soa ([5f8ffa1](https://github.com/thi-ng/umbrella/commit/5f8ffa175fabc4518f6b931c8c57473ea8ab1a74))
71
- - **soa:** add/update types, update aos(), add SOA.setValues(), tests ([b8e0780](https://github.com/thi-ng/umbrella/commit/b8e07806427041a7ef3413ca47357e3360f6a4c8))
72
- - **soa:** update SOAAttribSpec.buf to use ArrayBuffer w/ opt offset ([2759570](https://github.com/thi-ng/umbrella/commit/27595700ce0df21258dad58e18abf98b8ddb7c30))
119
+ - update attribValues() impl ([786a02f](https://github.com/thi-ng/umbrella/commit/786a02f))
73
120
 
74
- ### Performance Improvements
121
+ #### ♻️ Refactoring
75
122
 
76
- - **soa:** update attribValues() impl ([786a02f](https://github.com/thi-ng/umbrella/commit/786a02f66fd0f50e678f3eb048964fadf293db3f))
123
+ - rename SOA.initSpecs() => addSpecs(), make public ([470714d](https://github.com/thi-ng/umbrella/commit/470714d))
124
+ - update attribValues(), add indexUnsafe() ([21c1ef6](https://github.com/thi-ng/umbrella/commit/21c1ef6))
package/README.md CHANGED
@@ -83,7 +83,7 @@ node --experimental-repl-await
83
83
  > const soa = await import("@thi.ng/soa");
84
84
  ```
85
85
 
86
- Package sizes (gzipped, pre-treeshake): ESM: 1.43 KB
86
+ Package sizes (gzipped, pre-treeshake): ESM: 1.44 KB
87
87
 
88
88
  ## Dependencies
89
89
 
package/package.json CHANGED
@@ -1,104 +1,109 @@
1
1
  {
2
- "name": "@thi.ng/soa",
3
- "version": "0.3.8",
4
- "description": "SOA & AOS memory mapped structured views with optional & extensible serialization",
5
- "type": "module",
6
- "module": "./index.js",
7
- "typings": "./index.d.ts",
8
- "sideEffects": false,
9
- "repository": {
10
- "type": "git",
11
- "url": "https://github.com/thi-ng/umbrella.git"
2
+ "name": "@thi.ng/soa",
3
+ "version": "0.4.2",
4
+ "description": "SOA & AOS memory mapped structured views with optional & extensible serialization",
5
+ "type": "module",
6
+ "module": "./index.js",
7
+ "typings": "./index.d.ts",
8
+ "sideEffects": false,
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/thi-ng/umbrella.git"
12
+ },
13
+ "homepage": "https://github.com/thi-ng/umbrella/tree/develop/packages/soa#readme",
14
+ "funding": [
15
+ {
16
+ "type": "github",
17
+ "url": "https://github.com/sponsors/postspectacular"
12
18
  },
13
- "homepage": "https://github.com/thi-ng/umbrella/tree/develop/packages/soa#readme",
14
- "funding": [
15
- {
16
- "type": "github",
17
- "url": "https://github.com/sponsors/postspectacular"
18
- },
19
- {
20
- "type": "patreon",
21
- "url": "https://patreon.com/thing_umbrella"
22
- }
23
- ],
24
- "author": "Karsten Schmidt <k+npm@thi.ng>",
25
- "license": "Apache-2.0",
26
- "scripts": {
27
- "build": "yarn clean && tsc --declaration",
28
- "clean": "rimraf *.js *.d.ts *.map doc",
29
- "doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
30
- "doc:ae": "mkdir -p .ae/doc .ae/temp && node_modules/.bin/api-extractor run --local --verbose",
31
- "doc:readme": "yarn doc:stats && ../../scripts/node-esm ../../tools/src/readme.ts",
32
- "doc:stats": "../../scripts/node-esm ../../tools/src/module-stats.ts",
33
- "pub": "yarn build && yarn publish --access public",
34
- "test": "testament test"
35
- },
36
- "dependencies": {
37
- "@thi.ng/api": "^8.1.0",
38
- "@thi.ng/binary": "^3.0.7",
39
- "@thi.ng/errors": "^2.0.6",
40
- "@thi.ng/transducers-binary": "^2.0.7",
41
- "@thi.ng/vectors": "^7.1.0"
19
+ {
20
+ "type": "patreon",
21
+ "url": "https://patreon.com/thing_umbrella"
22
+ }
23
+ ],
24
+ "author": "Karsten Schmidt <k+npm@thi.ng>",
25
+ "license": "Apache-2.0",
26
+ "scripts": {
27
+ "build": "yarn clean && tsc --declaration",
28
+ "clean": "rimraf '*.js' '*.d.ts' '*.map' doc",
29
+ "doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
30
+ "doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
31
+ "doc:readme": "yarn doc:stats && tools:readme",
32
+ "doc:stats": "tools:module-stats",
33
+ "pub": "yarn npm publish --access public",
34
+ "test": "testament test"
35
+ },
36
+ "dependencies": {
37
+ "@thi.ng/api": "^8.3.2",
38
+ "@thi.ng/binary": "^3.1.2",
39
+ "@thi.ng/errors": "^2.1.2",
40
+ "@thi.ng/transducers-binary": "^2.1.2",
41
+ "@thi.ng/vectors": "^7.2.2"
42
+ },
43
+ "devDependencies": {
44
+ "@microsoft/api-extractor": "^7.18.19",
45
+ "@thi.ng/equiv": "^2.1.2",
46
+ "@thi.ng/testament": "^0.2.2",
47
+ "rimraf": "^3.0.2",
48
+ "tools": "^0.0.1",
49
+ "typedoc": "^0.22.9",
50
+ "typescript": "^4.5.2"
51
+ },
52
+ "keywords": [
53
+ "acceleration",
54
+ "aos",
55
+ "array",
56
+ "binary",
57
+ "data-oriented",
58
+ "datastructure",
59
+ "interop",
60
+ "layout",
61
+ "memory-mapped",
62
+ "simd",
63
+ "soa",
64
+ "typedarray",
65
+ "typescript",
66
+ "wasm",
67
+ "webgl"
68
+ ],
69
+ "publishConfig": {
70
+ "access": "public"
71
+ },
72
+ "engines": {
73
+ "node": ">=12.7"
74
+ },
75
+ "files": [
76
+ "*.js",
77
+ "*.d.ts"
78
+ ],
79
+ "exports": {
80
+ ".": {
81
+ "import": "./index.js"
42
82
  },
43
- "devDependencies": {
44
- "@thi.ng/equiv": "^2.0.6",
45
- "@thi.ng/testament": "^0.1.6"
83
+ "./aos": {
84
+ "import": "./aos.js"
46
85
  },
47
- "keywords": [
48
- "acceleration",
49
- "aos",
50
- "array",
51
- "binary",
52
- "data-oriented",
53
- "datastructure",
54
- "interop",
55
- "layout",
56
- "memory-mapped",
57
- "simd",
58
- "soa",
59
- "typedarray",
60
- "typescript",
61
- "wasm",
62
- "webgl"
63
- ],
64
- "publishConfig": {
65
- "access": "public"
86
+ "./api": {
87
+ "import": "./api.js"
66
88
  },
67
- "engines": {
68
- "node": ">=12.7"
89
+ "./serialize": {
90
+ "import": "./serialize.js"
69
91
  },
70
- "files": [
71
- "*.js",
72
- "*.d.ts"
92
+ "./soa": {
93
+ "import": "./soa.js"
94
+ }
95
+ },
96
+ "thi.ng": {
97
+ "related": [
98
+ "ecs",
99
+ "malloc",
100
+ "simd",
101
+ "unionstruct",
102
+ "vector-pools",
103
+ "vectors"
73
104
  ],
74
- "exports": {
75
- ".": {
76
- "import": "./index.js"
77
- },
78
- "./aos": {
79
- "import": "./aos.js"
80
- },
81
- "./api": {
82
- "import": "./api.js"
83
- },
84
- "./serialize": {
85
- "import": "./serialize.js"
86
- },
87
- "./soa": {
88
- "import": "./soa.js"
89
- }
90
- },
91
- "thi.ng": {
92
- "related": [
93
- "ecs",
94
- "malloc",
95
- "simd",
96
- "unionstruct",
97
- "vector-pools",
98
- "vectors"
99
- ],
100
- "status": "alpha",
101
- "year": 2019
102
- },
103
- "gitHead": "d6aca4b4edb697613ed6635b1c0b12f0bf27b1f0"
104
- }
105
+ "status": "alpha",
106
+ "year": 2019
107
+ },
108
+ "gitHead": "e8a7c2a40191b391cef182c2978e5a6c85987a87\n"
109
+ }
package/soa.js CHANGED
@@ -77,7 +77,7 @@ export class SOA {
77
77
  indexUnsafe(i, ids) {
78
78
  const res = {};
79
79
  if (ids) {
80
- for (let i = ids.length; --i >= 0;) {
80
+ for (let i = ids.length; i-- > 0;) {
81
81
  const id = ids[i];
82
82
  res[id] = this.attribValueUnsafe(id, i);
83
83
  }
@@ -115,7 +115,7 @@ export class SOA {
115
115
  ensureIndex(destFrom, 0, dest.length);
116
116
  ensureIndex(destFrom + num, destFrom, dest.length + 1);
117
117
  ids = ids || Object.keys(this.specs);
118
- for (let k = ids.length; --k >= 0;) {
118
+ for (let k = ids.length; k-- > 0;) {
119
119
  const id = ids[k];
120
120
  for (let i = srcFrom, j = destFrom; i < srcTo; i++, j++) {
121
121
  dest.setAttribValueUnsafe(id, j, this.attribValueUnsafe(id, i));