Package com.atlassian.plugin.webresource
Class DefaultResourceBatchingConfiguration
java.lang.Object
com.atlassian.plugin.webresource.DefaultResourceBatchingConfiguration
- All Implemented Interfaces:
ResourceBatchingConfiguration
public class DefaultResourceBatchingConfiguration
extends Object
implements ResourceBatchingConfiguration
Default configuration for the plugin resource locator, for those applications that do not want to perform
any super-batching.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the list of resource plugin modules that should be included in the superbatch, in the order that they should be batched.booleanbooleanDetermines whether web resources in the same context should be batched together.booleanCurrently (as of v2.14) this is false by default.booleanDetermines whether plugin resources of the same type defined within a single web resource are batched into one file.booleanEnables generation of the Source Map.booleanGets whether web resources in different resource modules should be batched together.booleanSource Map could be optimised for production or development.
-
Field Details
-
PLUGIN_WEBRESOURCE_BATCHING_OFF
- See Also:
-
PLUGIN_WEB_RESOURCE_BATCH_CONTENT_TRACKING
- See Also:
-
PLUGIN_WEB_RESOURCE_JAVASCRIPT_TRY_CATCH_WRAPPING
- See Also:
-
PLUGIN_WEB_RESOURCE_SOURCE_MAP_ENABLED
- See Also:
-
PLUGIN_WEB_RESOURCE_SOURCE_MAP_OPTIMISED_FOR_DEVELOPMENT
- See Also:
-
PLUGIN_WEB_RESOURCE_SUPER_BATCH_ENABLED
- See Also:
-
PLUGIN_WEB_RESOURCE_CONTEXT_BATCH_ENABLED
- See Also:
-
-
Constructor Details
-
DefaultResourceBatchingConfiguration
public DefaultResourceBatchingConfiguration()
-
-
Method Details
-
isSuperBatchingEnabled
public boolean isSuperBatchingEnabled()Description copied from interface:ResourceBatchingConfigurationGets whether web resources in different resource modules should be batched together.- Specified by:
isSuperBatchingEnabledin interfaceResourceBatchingConfiguration- Returns:
- true if web resources in different resource modules should be batched together
-
getSuperBatchModuleCompleteKeys
Description copied from interface:ResourceBatchingConfigurationGets the list of resource plugin modules that should be included in the superbatch, in the order that they should be batched. No dependency resolution is performed, so it is important that the configuration includes all dependent resources in the right order.Any call to
WebResourceManager.requireResource(String, Writer, UrlMode)for one of these resources will be a no-op, and any dependency resolution for resources will stop if the dependency is in the superbatch.- Specified by:
getSuperBatchModuleCompleteKeysin interfaceResourceBatchingConfiguration- Returns:
- a list of resource plugin modules that should be included in the superbatch.
-
isContextBatchingEnabled
public boolean isContextBatchingEnabled()Description copied from interface:ResourceBatchingConfigurationDetermines whether web resources in the same context should be batched together.- Specified by:
isContextBatchingEnabledin interfaceResourceBatchingConfiguration- Returns:
- true if web resources in the same context are batched together.
-
isPluginWebResourceBatchingEnabled
public boolean isPluginWebResourceBatchingEnabled()Description copied from interface:ResourceBatchingConfigurationDetermines whether plugin resources of the same type defined within a single web resource are batched into one file.- Specified by:
isPluginWebResourceBatchingEnabledin interfaceResourceBatchingConfiguration- Returns:
- true if plugin resources in the same web resource are batched together.
-
isJavaScriptTryCatchWrappingEnabled
public boolean isJavaScriptTryCatchWrappingEnabled()Currently (as of v2.14) this is false by default. It is likely to become true by default in the future.- Specified by:
isJavaScriptTryCatchWrappingEnabledin interfaceResourceBatchingConfiguration- Returns:
- true if try/catch wrapping of JavaScript batches is enabled.
-
isBatchContentTrackingEnabled
public boolean isBatchContentTrackingEnabled()- Specified by:
isBatchContentTrackingEnabledin interfaceResourceBatchingConfiguration- Returns:
- true if the HTML tags created for batch resources should include data attributes listing the contents of the batch. This would be useful to turn on if you want the front end client to be able to track what resources and contexts it is loading.
-
isSourceMapEnabled
public boolean isSourceMapEnabled()Description copied from interface:ResourceBatchingConfigurationEnables generation of the Source Map.Could be enabled in production too with `optimiseSourceMapsForDevelopment` set to `false`, with such setting it won't slow down the instance.
- Specified by:
isSourceMapEnabledin interfaceResourceBatchingConfiguration
-
optimiseSourceMapsForDevelopment
public boolean optimiseSourceMapsForDevelopment()Description copied from interface:ResourceBatchingConfigurationSource Map could be optimised for production or development.In production the JS & CSS generation will be fast (exactly the same as without the Source Map) but the Source Map generation will be slow.
In development the JS & CSS generation will be a little slower but the Source Map generation will be fast.
It's better to enable this option during development (it **must** be disabled in production).
- Specified by:
optimiseSourceMapsForDevelopmentin interfaceResourceBatchingConfiguration
-