You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implement is directly referencing all Vaadin components in react-components, regardless of the license of the component. This is problematic for users that are for some reason (e.g. government policy) required to only have open source dependencies in their application (in other words, it's not acceptable to have commercial dependencies even if those are not used). It is not practical to exclude specific components because of the way index.js directly imports all components. Tree shaking during the production build leaves out unused modules but Vite in dev mode will still try to load all the modules.
One way of solving this would be to configure Vite to have an alias for any missing dependency to replace that import with a dummy placeholder that just informs the user that the dependency was missing. We could make Vaadin's default Vite configuration (vite.generated.ts) check for the existence of each commercial web component dependency and include a corresponding alias in the Vite configuration if it's not present.
In addition to this, we also need to make it practical to exclude those dependencies on the npm level. One potential way for this is to have those web components as optional peer dependencies instead of regular dependencies. There has been some reports about version conflict issues in combination with peer dependencies so one alternative might to have a regular dependency in our own code but remove it from package.json when publishing the module to npm. In either case, we also need to have a separate dependency that applications should have in their package.json to explicitly include the optional components along with logic that automatically includes this dependency when com.vaadin:vaadin is on the classpath while not including it if only com.vaadin:vaadin-core is present.
The text was updated successfully, but these errors were encountered:
The current implement is directly referencing all Vaadin components in
react-components
, regardless of the license of the component. This is problematic for users that are for some reason (e.g. government policy) required to only have open source dependencies in their application (in other words, it's not acceptable to have commercial dependencies even if those are not used). It is not practical to exclude specific components because of the wayindex.js
directly imports all components. Tree shaking during the production build leaves out unused modules but Vite in dev mode will still try to load all the modules.One way of solving this would be to configure Vite to have an alias for any missing dependency to replace that import with a dummy placeholder that just informs the user that the dependency was missing. We could make Vaadin's default Vite configuration (
vite.generated.ts
) check for the existence of each commercial web component dependency and include a corresponding alias in the Vite configuration if it's not present.In addition to this, we also need to make it practical to exclude those dependencies on the npm level. One potential way for this is to have those web components as optional peer dependencies instead of regular dependencies. There has been some reports about version conflict issues in combination with peer dependencies so one alternative might to have a regular dependency in our own code but remove it from
package.json
when publishing the module to npm. In either case, we also need to have a separate dependency that applications should have in theirpackage.json
to explicitly include the optional components along with logic that automatically includes this dependency whencom.vaadin:vaadin
is on the classpath while not including it if onlycom.vaadin:vaadin-core
is present.The text was updated successfully, but these errors were encountered: