Skip to content
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

Jest + reducing work done per block when constructing them #2

Closed
wants to merge 4 commits into from

Conversation

allain
Copy link

@allain allain commented Sep 4, 2017

Changes:

  1. Added jest test for basic stuff
  2. Added npm run lint using eslint
  3. Changed to use ES2016 syntax stuff (still node6 compatible)
  4. Precomputing map from type+metadata => prototype blocktype, meaning less work per block when creating them.

block.js Outdated
return Block
}

// Generates a block map type => metadata => template block, so that block names don't
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't what ?

@allain
Copy link
Author

allain commented Sep 4, 2017

don't get recomputed every time a block is requested

@rom1504
Copy link
Member

rom1504 commented Sep 4, 2017

I really don't think we should have lock files (here package-lock.json) in libraries.
I think semver and carret dependency work well. We especially don't want to update things like prismarine-block every time some dependency gets updated.
So I think package-lock.json should be removed.

any thought about that @roblabla ?

@allain
Copy link
Author

allain commented Sep 4, 2017

I don't actually care one iota, it's a file that will always get recreated when running npm install on node8.

If you don't want it, maybe we ought to explicitly add it to .gitignore. Same goes for yarn.lock.

@roblabla
Copy link
Member

roblabla commented Sep 5, 2017

Yup, lockfiles are good for binaries (E.G. flying-sheep) but not libraries

@rom1504
Copy link
Member

rom1504 commented May 14, 2018

Ah, we should probably merge (part of) that

@rom1504
Copy link
Member

rom1504 commented May 16, 2020

reopen if you still think that would be useful

@rom1504 rom1504 closed this May 16, 2020
FreezeEngine added a commit to FreezeEngine/prismarine-block that referenced this pull request Jan 3, 2025
extremeheat added a commit that referenced this pull request Jan 4, 2025
* Added getHashValue

* Added getHash to Block

* simplify and add test

* Fixed hashing

* Added other collided blocks

* prismarine-block to global

* Update index.js

* Update index.d.ts

* added 4 byte mask

* Added sorting

* Added getHashValue

* Added getHash to Block

* simplify and add test

* Fixed hashing

* Added other collided blocks

* prismarine-block to global

* Update index.js

* Update index.d.ts

* added 4 byte mask

* Added sorting

* Add back EOL for lint

* Description corrections

* Updated docs

* Updated docs #2

---------

Co-authored-by: extremeheat <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants