Skip to content

Commit

Permalink
short id prefix, v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzy committed Nov 30, 2020
1 parent eb582b4 commit ae92591
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ Build sizes are also significantly smaller due to no longer using the node.js `c
* Custom System init parameters.
* TypeScript fixes.
* System.subscribe will now take Component class as well as name (to match other functions that take Component type).

## 1.3.0 November 29, 2020

* Fix id prefixes
* added typeName Component property
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ A performant, featureful, and flexible [Entity-Component-System](https://en.wiki
* [Patterns](https://github.com/fritzy/ape-ecs/blob/master/docs/Patterns.md)
* [1.0 Announcement Post](https://dev.to/fritzy/introducing-ape-ecs-js-250o)
* [Changelog](https://github.com/fritzy/ape-ecs/blob/master/CHANGELOG.md)
* [Discord -- Web Platform Game Dev](https://discord.gg/hdbdueTDJk)
* [@fritzy Twitter](https://twitter.com/fritzy)

## Install
Expand Down
1 change: 0 additions & 1 deletion builds/ape-ecs-v1.1.0.js

This file was deleted.

1 change: 0 additions & 1 deletion builds/ape-ecs-v1.2.0.js

This file was deleted.

1 change: 1 addition & 0 deletions builds/ape-ecs-v1.3.0.js

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ape-ecs",
"version": "1.2.1",
"version": "1.3.0",
"description": "Ape-ECS (Apex) Entity-Component-System library for simulation and game development.",
"main": "./src/index.js",
"types": "./src/index.d.ts",
Expand Down Expand Up @@ -30,8 +30,6 @@
},
"homepage": "https://github.com/fritzy/ape-ecs#readme",
"dependencies": {
"markdown-link-check": "^3.8.3",
"uuid": "^8.3.1"
},
"devDependencies": {
"@hapi/eslint-plugin-hapi": "^4.3.5",
Expand All @@ -49,6 +47,7 @@
"typescript": "^4.0.2",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.11.0"
"webpack-dev-server": "^3.11.0",
"markdown-link-check": "^3.8.3"
}
}
6 changes: 2 additions & 4 deletions src/util.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const uuid = require('uuid').v4;

class IdGenerator {
constructor() {
this.gen_num = 0;
Expand All @@ -8,7 +6,7 @@ class IdGenerator {
}

genPrefix() {
this.prefix = uuid();
this.prefix = Date.now().toString(32);
}

genId() {
Expand All @@ -18,7 +16,7 @@ class IdGenerator {
this.gen_num = 0;
this.genPrefix();
}
return `${this.prefix}-${this.gen_num}`;
return this.prefix + this.gen_num;
}
}

Expand Down

0 comments on commit ae92591

Please sign in to comment.