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

Use caches for getPolyfillMeta, listAliases, and listPolyfills #149

Merged
merged 2 commits into from
Feb 27, 2019

Conversation

JakeChampion
Copy link
Owner

@JakeChampion JakeChampion commented Feb 27, 2019

Resolves #147
Resolves #148

Jake Champion added 2 commits February 27, 2019 10:38
return readFile(path.join(polyfillDirectory, "aliases.json")).then(JSON.parse);
}
const listAliases = (function() {
const aliases = readFile(path.join(polyfillDirectory, "aliases.json")).then(JSON.parse);
Copy link

@bringking bringking Feb 27, 2019

Choose a reason for hiding this comment

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

👍

Copy link
Owner Author

Choose a reason for hiding this comment

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

Thanks for the review :-)

@bringking
Copy link

@JakeChampion, this is great. Thank you! Any particular reason you want to avoid using require? Just curious

@JakeChampion
Copy link
Owner Author

JakeChampion commented Feb 27, 2019

@bringking avoiding require is because it is a blocking call if it is the first time the file is being required. If polyfill-library is used on a HTTP server and that blocking call happened, it would stop other requests from being handled at the same moment in time.

@JakeChampion JakeChampion merged commit 2a77840 into master Feb 27, 2019
@JakeChampion JakeChampion deleted the moar-lru branch February 3, 2020 01:34
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cache fs readFile operations
2 participants