Class FrontendDependencies

java.lang.Object
com.vaadin.flow.server.frontend.scanner.FrontendDependencies
All Implemented Interfaces:
FrontendDependenciesScanner, Serializable

public class FrontendDependencies extends Object
Represents the class dependency tree of the application.

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

Since:
2.0.3
See Also:
  • Field Details

    • LUMO

      public static final String LUMO
      See Also:
    • ERROR_INVALID_LOAD_DEPENDENCIES_ANNOTATION

      protected static final String ERROR_INVALID_LOAD_DEPENDENCIES_ANNOTATION
    • ERROR_INVALID_PWA_ANNOTATION

      protected static final String ERROR_INVALID_PWA_ANNOTATION
  • Constructor Details

    • FrontendDependencies

      public FrontendDependencies(ClassFinder finder, boolean generateEmbeddableWebComponents, com.vaadin.experimental.FeatureFlags featureFlags, boolean reactEnabled)
    • FrontendDependencies

      public FrontendDependencies(ClassFinder finder, boolean generateEmbeddableWebComponents, com.vaadin.experimental.FeatureFlags featureFlags, boolean reactEnabled, boolean productionMode)
      Scans the application classes for frontend dependencies.
      Parameters:
      finder - a class finder
      generateEmbeddableWebComponents - checks WebComponentExporter classes for dependencies if true, doesn't check otherwise
      featureFlags - available feature flags and their status
      reactEnabled - true if react is enabled, false otherwise
      productionMode - true if scanning for a production build, in which case routes marked with Route.developmentOnly() are not collected as entry points
      Since:
      25.3.4
  • Method Details

    • getPackages

      public Map<String,String> getPackages()
      Get all npm packages the application depends on.
      Returns:
      the set of npm packages
    • getDevPackages

      public Map<String,String> getDevPackages()
      Description copied from interface: FrontendDependenciesScanner
      Get all npm packages needed only for development.
      Returns:
      the `devDependencies` packages
    • getAssets

      public Map<String,List<String>> getAssets()
      Description copied from interface: FrontendDependenciesScanner
      Get all npm package assets for the application.
      Returns:
      the npm packages assets
    • getDevAssets

      public Map<String,List<String>> getDevAssets()
      Description copied from interface: FrontendDependenciesScanner
      Get all npm packages assets needed only for development.
      Returns:
      the `dev` npm package assets
    • getPwaConfiguration

      public com.vaadin.flow.server.PwaConfiguration getPwaConfiguration()
      Get the PWA configuration of the application.
      Returns:
      the PWA configuration
      Since:
      6.0
    • getModules

      public Map<ChunkInfo,List<String>> getModules()
      Get all JS modules needed for run the application.
      Returns:
      list of JS modules
    • getModulesDevelopment

      public Map<ChunkInfo,List<String>> getModulesDevelopment()
      Get all JS modules needed in development mode.
      Returns:
      list of JS modules
      Since:
      24.2
    • getScripts

      public Map<ChunkInfo,List<String>> getScripts()
      Get all the JS files used by the application.
      Returns:
      the set of JS files
    • getScriptsDevelopment

      public Map<ChunkInfo,List<String>> getScriptsDevelopment()
      Get all the JS files needed in development mode.
      Returns:
      the set of JS files
      Since:
      24.2
    • getCss

      public Map<ChunkInfo,List<CssData>> getCss()
      Get all the CSS files used by the application.
      Returns:
      the set of CSS files
    • getClasses

      public Set<String> getClasses()
      Get all Java classes considered when looking for used dependencies.
      Returns:
      the set of JS files
    • getEntryPoints

      public Collection<EntryPointData> getEntryPoints()
      Get all entryPoints in the application.
      Returns:
      the set of JS files
      Since:
      24.1
    • getThemeDefinition

      public com.vaadin.flow.theme.ThemeDefinition getThemeDefinition()
      Get the ThemeDefinition of the application.
      Returns:
      the theme definition
    • getTheme

      public com.vaadin.flow.theme.AbstractTheme getTheme()
      Get the AbstractTheme instance used in the application.
      Returns:
      the theme instance
    • shouldVisit

      protected boolean shouldVisit(String className)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getFinder

      protected final ClassFinder getFinder()
    • isDisabledExperimentalClass

      protected final boolean isDisabledExperimentalClass(String className)
    • getLumoTheme

      protected Class<? extends com.vaadin.flow.theme.AbstractTheme> getLumoTheme()
    • loadsRuntimeDependencies

      protected boolean loadsRuntimeDependencies(Class<?> clazz)
      Tells whether runtime @JsModule and @JavaScript values declared on the given class are added to the page at runtime. That is only done for components and the app shell, which also inherit annotations from the interfaces they implement. For any other class, runtime URL @JsModule values are left to the bundle as before, while runtime @JavaScript values are not loaded at all.
      Parameters:
      clazz - the class declaring the annotation, loaded through the finder
      Returns:
      true if runtime values of the class are loaded at runtime
    • addValues

      protected void addValues(Map<String,List<String>> map, String key, List<String> values)