Constructor
new ComponentLoader(reporter, settings)
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
reporter |
Reporter | |||||||||||||||||||||||||||||||
settings |
Object |
Properties
|
Extends
Members
(protected) _buildQueue :Array.<BuildRequest>
Queue of BuildableComponents in the order in which they should be loaded/built.
By calling the .build() method, components can be added to this queue.
Type:
- Array.<BuildRequest>
(protected) _concurrentLoadsPerBase :number
Number of files that can be requested simultaneously per loading base.
The assumption here is that the maximum number of concurrent loads
depends on the browser, not on the host/base and therefore
one value suffices, default is 2.
Type:
- number
_currentLoads :Array.<BaseLoadTracker>
Register of the current loads per loading base
Type:
- Array.<BaseLoadTracker>
_defaultLoadingQuality :LoadingQuality
Type:
(protected) _loadableQueue :Array.<LoadableComponent>
Queue of LoadableComponents in the order in which they should be loaded to
deliver on the BuildRequests in the _buildQueue in the right order and as
quickly as possible
Type:
- Array.<LoadableComponent>
(protected) _loadingBases :Array.<LoadingBase>
Component loads can be distributed over different bases
to prevent/minimize browser throttling
Type:
- Array.<LoadingBase>
(protected) _reporter :Reporter
Type:
- Overrides:
- Source:
id :UUID
Type:
- Overrides:
- Source:
label :string
Type:
- string
- Overrides:
- Source:
name :string
Type:
- string
- Overrides:
- Source:
slug :string
Type:
- string
- Overrides:
- Source:
socketTable :Object.<string, number>
Presumed number of loading sockets per browser
Type:
- Object.<string, number>
Methods
(static) getLoadableDependencies(stuffToLoad, depSetsArropt)
Builds sets of dependency paths, only taking into account the main part of components
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
stuffToLoad |
Component | Array.<Component> | ||
depSetsArr |
Array.<Set> |
<optional> |
(static) optimalLoadingOrder(components, qualityopt)
Determines the optimal loading order for an array of components that
need to be loaded at the same quality, only taking into account the 'main'
part of the component.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
components |
Array.<Component> | |||
quality |
LoadingQuality |
<optional> |
'medium' |
(protected) _rescheduleLoadingOrder()
(async) build(component, partopt, qualityopt, highPriorityopt) → {Promise.<BuildableComponent>}
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
component |
BuildableComponent | |||
part |
ComponentPart |
<optional> |
'main' | |
quality |
LoadingQuality |
<optional> |
'medium' | |
highPriority |
Boolean |
<optional> |
false |
Returns:
- Type
- Promise.<BuildableComponent>
report(log)
Parameters:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
log |
Object |
Properties
|
- Overrides:
- Source: