Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Add option to not cache source code. #64

Merged
merged 2 commits into from
Apr 4, 2016
Merged

Conversation

cpojer
Copy link

@cpojer cpojer commented Mar 31, 2016

For some repositories it is not possible to store (or JSON.stringify) every file's source code and transformed output. Node.js will actually run out of memory and crash.

Some clients of node-haste might not need this at all. I made the least invasive change I could – add an option that determines what should be cached for a module. It is by default enabled, so a new release of node-haste should be fully backwards compatible.

Later we may have to implement a better way of caching transformed files. We might want to do what Jest does and create one output file per input file. In the meantime, this will suffice :)

@cpojer
Copy link
Author

cpojer commented Mar 31, 2016

cc @davidaurelio

@cpojer cpojer merged commit b6b7e3f into facebookarchive:master Apr 4, 2016
@@ -90,7 +92,7 @@ class Module {
}

getDependencies(transformOptions) {
return this.read(transformOptions).then(data => data.dependencies);
return this.read(transformOptions).then(({dependencies}) => dependencies);

Choose a reason for hiding this comment

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

this is longer and contains more syntax ;-)

Copy link
Author

Choose a reason for hiding this comment

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

just made it consistent with the other methods in this file :)

Choose a reason for hiding this comment

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

I don’t actually care, just couldn’t resist commenting :D

@davidaurelio
Copy link

lgtm. sorry for not responding, I was on pto

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants