Skip to content

Use hash for temporary files#43

Open
cprodescu wants to merge 2 commits intorxaviers:masterfrom
cprodescu:fix-42-tmp-file-paths
Open

Use hash for temporary files#43
cprodescu wants to merge 2 commits intorxaviers:masterfrom
cprodescu:fix-42-tmp-file-paths

Conversation

@cprodescu
Copy link
Copy Markdown

Hash temporary file names.

Current encoding transforms the file path from where the Globalize calls
were extracted into a file name. In deeply nested projects, this can
double the length of the path, causing E_NAMETOOLONG issues.

Before this:
/long/path/to/project/.tmp-globalize-webpack/-long-path-to-project-src-component-foo-index.js
After this:
/long/path/to/project/.tmp-globalize-webpack/5b4c40dd44a2cfde54a3e04cd183aa70edd64c1a.js

This has the downside that it makes the content of the files more opaque, being
harder to debug which content maps to which file. One would have to

echo -n `readlink -f src/component/foo/index.js` | shasum

Fixes #42 and #16.

Corneliu C. Prodescu added 2 commits March 18, 2017 15:37
Current encoding transforms the file path from where the Globalize calls
were extracted into a file name. In deeply nested projects, this can
double the length of the path, causing E_NAMETOOLONG issues.

Before this:
/long/path/to/project/.tmp-globalize-webpack/-long-path-to-project-src-component-foo-index.js
After this:
/long/path/to/project/.tmp-globalize-webpack/5b4c40dd44a2cfde54a3e04cd183aa70edd64c1a.js

This has the downside that it makes the content of the files more opaque, being
harder to debug which content maps to which file. One would have to
```
echo -n `readlink -f src/component/foo/index.js` | shasum
```

This fixes #42 and #16.
@rxaviers
Copy link
Copy Markdown
Owner

@cprodescu thank you for your PR... I am wondering what we could do to allow this to be done on user land? I mean, I'm wondering if we could expose a plugin option that takes a function, that in turn takes one argument: the filename; and return the processed filename.

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