asset-pipe / asset-pipe-js-writer

Module for reading a CommonJS module entry point and resolves all dependencies into a asset feed.
2 stars 0 forks source link

fix: prevent modules from producing same id hash #82

Closed digitalsadhu closed 6 years ago

digitalsadhu commented 6 years ago

JIRA Issue

COREWEB-196

Status

READY

Description

There was an obscure bug where the source code of 2 feed items was totally identical which, when hashed, produced the same ids. Since we can't have 2 different modules with the same id hash, we needed to add another parameter to the hashing. I've simply taken the previous id value (that generated by browserify) which is the path to the file and prepended it to content to be hashed.

See source content for object.entries and object.values: https://github.com/es-shims/Object.entries/blob/master/index.js https://github.com/es-shims/Object.values/blob/master/index.js

Todos

Deploy Notes

Related PRs

digitalsadhu commented 6 years ago

rats, ids a different on different machines. Breaks tests on CI