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

fix: remove node globals #52

Merged
merged 4 commits into from
Apr 24, 2020
Merged

fix: remove node globals #52

merged 4 commits into from
Apr 24, 2020

Conversation

hugomrdias
Copy link
Member

@hugomrdias hugomrdias commented Apr 21, 2020

This PR removes node globals, updates it helpers and swaps deep-extend with merge-options

ipfs/js-ipfs#2924

@hugomrdias hugomrdias marked this pull request as draft April 21, 2020 17:40
@hugomrdias hugomrdias marked this pull request as ready for review April 22, 2020 11:06
"chai": "^4.2.0",
"dirty-chai": "^2.0.1",
"nyc": "^15.0.0"
},
"dependencies": {
"err-code": "^2.0.0",
"protons": "^1.1.0"
"protons": "^1.0.2"
Copy link
Member

Choose a reason for hiding this comment

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

Why the downgrade?

Copy link
Member Author

Choose a reason for hiding this comment

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

the latest release is 1.0.2
https://github.com/ipfs/protons/releases

Copy link
Member

Choose a reason for hiding this comment

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

No it's not - I think the latest tag is pointing at the wrong version: https://www.npmjs.com/package/protons/v/1.1.0

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah but the latest code is released under 1.0.2
https://www.npmjs.com/package/protons/v/1.1.0

Copy link
Member Author

Choose a reason for hiding this comment

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

Screenshot 2020-04-23 at 15 37 34

Copy link
Member

Choose a reason for hiding this comment

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

No idea what's happened there, someone must have published and then forgotten to push the tags etc.

I've published a new version from the head of master as 1.2.0

@@ -286,7 +286,7 @@ strategies.forEach((strategy) => {
})
}, strategyOverrides[strategy])

const expected = extend({}, defaultResults, strategies[strategy])
const expected = extend({}, defaultResults)
Copy link
Member

Choose a reason for hiding this comment

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

Is strategies[strategy] not needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

i dunno what was the deal with strategies[strategy] it's an array of string being merged with a object of objects so i removed it and everything still worked

@@ -18,7 +19,7 @@ describe('builder', () => {
ipld = await inMemory(IPLD)
})

const testMultihashes = Object.keys(mh.names).slice(1, 40)
const testMultihashes = Object.keys(mh.names).slice(1, 17)
Copy link
Member

Choose a reason for hiding this comment

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

Why has this got smaller?

Copy link
Member

Choose a reason for hiding this comment

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

It's this, right?

ipfs-unixfs-importer:   1) builder
ipfs-unixfs-importer:        allows multihash hash algorithm to be specified:
ipfs-unixfs-importer:      Error: multihash function '212' not yet supported
ipfs-unixfs-importer:       at AsyncFunction.Multihashing.createHash (/home/travis/build/ipfs/js-ipfs-unixfs/node_modules/multihashing-async/src/index.js:58:19)
ipfs-unixfs-importer:       at AsyncFunction.Multihashing.digest (/home/travis/build/ipfs/js-ipfs-unixfs/node_modules/multihashing-async/src/index.js:39:29)
ipfs-unixfs-importer:       at Multihashing (/home/travis/build/ipfs/js-ipfs-unixfs/node_modules/multihashing-async/src/index.js:16:37)
ipfs-unixfs-importer:       at Object.cid (/home/travis/build/ipfs/js-ipfs-unixfs/node_modules/ipld-dag-pb/src/genCid.js:25:27)
ipfs-unixfs-importer:       at Object.cid (/home/travis/build/ipfs/js-ipfs-unixfs/node_modules/ipld-dag-pb/src/util.js:25:17)
ipfs-unixfs-importer:       at IPLDResolver.put (/home/travis/build/ipfs/js-ipfs-unixfs/node_modules/ipld/src/index.js:192:39)
ipfs-unixfs-importer:       at async /home/travis/build/ipfs/js-ipfs-unixfs/packages/ipfs-unixfs-importer/src/dag-builder/file/buffer-importer.js:1:3472

Copy link
Member Author

Choose a reason for hiding this comment

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

yes it was trying to hash md4 and multihashing-async doesn’t know how to do that

Copy link
Member

Choose a reason for hiding this comment

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

I think it did at one point, otherwise this test would never have passed.

Copy link
Member Author

Choose a reason for hiding this comment

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

i think the hash table changed

Copy link
Member

Choose a reason for hiding this comment

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

Indeed. Why though?

Copy link
Member Author

Choose a reason for hiding this comment

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

@hugomrdias hugomrdias marked this pull request as draft April 23, 2020 14:00
@hugomrdias hugomrdias marked this pull request as ready for review April 24, 2020 13:47
@achingbrain achingbrain merged commit 5414412 into master Apr 24, 2020
@achingbrain achingbrain deleted the fix/remove-node-globals branch April 24, 2020 15:55
github-actions bot pushed a commit that referenced this pull request Apr 26, 2022
## ipfs-unixfs-v1.0.0 (2022-04-26)

### ⚠ BREAKING CHANGES

* ./src/dir-sharded is not in the exports map so cannot be imported

Co-authored-by: Alex Potsides <alex@achingbrain.net>
* uses new multiformats stack and takes a blockservice instead of the block api

Co-authored-by: Rod Vagg <rod@vagg.org>
Co-authored-by: achingbrain <alex@achingbrain.net>
* switches to named exports
* types are now included with all unixfs modules
* does not convert input to node Buffers any more, uses Uint8Arrays instead

### Features

* add types ([#114](#114)) ([ca26353](ca26353))

### Bug Fixes

* add pbjs namespace ([#145](#145)) ([dd26b92](dd26b92))
* declare types in .ts files ([#168](#168)) ([76ec6e5](76ec6e5))
* ignore high mode bits passed to constructor ([#53](#53)) ([8e8d83d](8e8d83d))
* ignore undefined values in options ([#173](#173)) ([200dff3](200dff3))
* individual packages can use npm 6 ([#167](#167)) ([2b429cc](2b429cc))
* publish with types in package.json ([#166](#166)) ([0318c98](0318c98))
* remove node globals ([#52](#52)) ([5414412](5414412))
* replace node buffers with uint8arrays ([#69](#69)) ([8a5aed2](8a5aed2)), closes [#66](#66)
* types with ipjs build ([#165](#165)) ([fea85b5](fea85b5))
* use @ipld/dag-pb instead of ipld-dag-pb ([#116](#116)) ([bab1985](bab1985))

### Trivial Changes

* add travis file and configure build scripts ([5a25c87](5a25c87))
* consolidate .gitignore files ([b05e468](b05e468))
* declare interface types in .d.ts file ([#122](#122)) ([eaa8449](eaa8449))
* dep updates ([cf9480b](cf9480b))
* **deps-dev:** bump aegir from 26.0.0 to 28.1.0 ([#86](#86)) ([87541c7](87541c7))
* **deps-dev:** bump aegir from 28.2.0 to 29.2.2 ([#101](#101)) ([010ab47](010ab47))
* exclude docs and tests from npm package ([63b8ba0](63b8ba0))
* move files into packages folder ([943be9d](943be9d))
* publish ([5203595](5203595))
* publish ([0f9092e](0f9092e))
* publish ([2713329](2713329))
* publish ([35e2059](35e2059))
* publish ([137a4ad](137a4ad))
* publish ([f173850](f173850))
* publish ([2ea467f](2ea467f))
* publish ([dedbd82](dedbd82))
* publish ([dc2d400](dc2d400))
* publish ([27d57df](27d57df))
* publish ([5ccac2f](5ccac2f))
* publish ([172548b](172548b))
* publish ([9a2b5f2](9a2b5f2))
* publish ([e57ba16](e57ba16))
* publish ([9e8f077](9e8f077))
* publish ([22e29bb](22e29bb))
* publish ([dabbb48](dabbb48))
* publish ([32e5165](32e5165))
* publish ([5d3f4bd](5d3f4bd))
* publish ([49c8c54](49c8c54))
* publish ([db2c878](db2c878))
* publish ([9237250](9237250))
* remove changes from readme ([7c727ef](7c727ef))
* remove node buffers from runtime code ([#66](#66)) ([db60a42](db60a42))
* remove redundant test files ([3078608](3078608))
* small readme change ([f45436c](f45436c))
* swap to prereleaseOnly ([efb01ac](efb01ac))
* switch to auto-release ([#208](#208)) ([99386e6](99386e6))
* switch to ESM ([#161](#161)) ([819267f](819267f)), closes [skypackjs/skypack-cdn#171](skypackjs/skypack-cdn#171)
* tighten up input types ([#133](#133)) ([47f295b](47f295b))
* update build scripts ([37d96ee](37d96ee))
* update deps ([#144](#144)) ([f5f5fe4](f5f5fe4))
* update deps ([#78](#78)) ([2bf5d07](2bf5d07))
* update lockfiles ([9d11252](9d11252))
* update package.json scripts and readmes ([bda3717](bda3717))
* update readme ([a012f22](a012f22))
* update readme ([7f93da1](7f93da1))
* update readmes ([#188](#188)) ([273a141](273a141))
* upgrade deps ([3a43e92](3a43e92))
* use npm 7 workspaces instead of lerna bootstrap ([#120](#120)) ([1ceb097](1ceb097))
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.

2 participants