#2517 only fetch plugin package info from NPM when needed#2518
Open
RichardBradley wants to merge 1 commit intoalphagov:mainfrom
Open
#2517 only fetch plugin package info from NPM when needed#2518RichardBradley wants to merge 1 commit intoalphagov:mainfrom
RichardBradley wants to merge 1 commit intoalphagov:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2517
Changes
1; The "
pluginVersionSatisfies" function, which is called a lot, doesn't need to make a network fetch to NPM, it can be satisfied from the localpackage.jsondata. (This does mean that it will return true for non-plugin packages, but I can't see why that would do any harm)This saves some dev startup time (see deleted
pluginCacheMiddleware)2: The plugin cache can be made fetch-on-demand, instead of polling every 36 seconds.
I wonder if the 36 second config was a typo for 10 hours:
36000millis vs36000seconds.I have set the stale time to 1 minute, now that it's not polling all the time.
See deleted
startPackageTrackerTesting
All unit tests pass
I have ran a new prototype locally and it starts ok and looks good to me.
The plugins page looks good to me.
The plugin data is fetched from NPM only when the plugins page is viewed.
The prototype will start with no internet (before it refused to even start).
Please let me know if you have any questions