A simple package loader to attempt to load slow packages in the background.
automaticallyAddSlowLoadingPackagesTurn on/off automatically adding packages that take over longer than
slowLoadingPackageThresholdmilliseconds to load.
delayBeforeStartingThe delay in milliseconds before beginning to load slow packages after this package is loaded.
delayBetweenPackagesThe delay in milliseconds between loading each slow package. This prevents freezing the UI during load.
ignorePackageNamesA list of packages that will never be considered slow loading, and thus are always loaded before the window is shown.
deferredLoadingPackageNamesA list of packages that will be loaded in the background. This is automatically populated if
slowLoadingPackageThresholdMaximum time in milliseconds a package can take before being considered slow.
This package works by attempting to be the first package to load (which is why it starts with "a"). We can then insert dummy packages into the package manager to skip loading the real package. This is due to this check
return pack if pack = @getLoadedPackage(name) in
We then do a fixed delay
setTimeout(..., 1500) instead of a
atom.getCurrentWindow().isLoading() can take up to 100ms. This value can be changed in the config.
After loading a package, we then wait a bit (default:
25ms) in order for the UI loop to iterate. This prevents the UI from completely freezing. The UI might freeze if a single package takes forever.
Once completely loaded, we sweep the package load+activation times to see if they are considered slow (default:
loadTime + activationTime > 30ms).
Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.