Class BundleUtils

java.lang.Object
com.vaadin.flow.internal.BundleUtils

public final class BundleUtils extends Object
Utility class for bundle operations.

For internal use only. May be renamed or removed in a future release.

  • Method Details

    • loadBundleImports

      public static Set<String> loadBundleImports()
      Loads stats.json from the classpath (from the production bundle) and returns the "bundleImports" part of it.
      Returns:
      the bundle imports as a set
    • getChunkId

      public static String getChunkId(Class<? extends Component> componentClass)
      Gets the id for a chunk defined by the given class.
      Parameters:
      componentClass - the class
      Returns:
      an identifier for the component class that does not reveal the name of the component class
    • getChunkId

      public static String getChunkId(String className)
      Gets the id for a chunk defined by the given class.
      Parameters:
      className - the name of the class
      Returns:
      an identifier for the component class that does not reveal the name of the component class
    • getChunkHash

      public static String getChunkHash(List<String> chunkLines)
      Calculates a hash for bundle JavaScript chunk containing given string lines.
      Parameters:
      chunkLines - content of the chunk, collection of string lines
      Returns:
      chunk's hash
    • isPreCompiledProductionBundle

      public static boolean isPreCompiledProductionBundle()
      Returns whether the application uses pre-compiled production bundle or a custom bundle.
      Returns:
      true in case of pre-compiled bundle, false otherwise