cozy-bar v7 is an "ambient" dependency, you can access it from Webpack dev server scope or from DOM scope in production.
That is not the case for cozy-bar v8 which does not expose an ambient API.
Currently, as a fast fix, it was chosen to inject the required setWebviewContext method as props to WebviewProvider. A more elegant solution would be to use cozy-bar as a peerDep in cozy-intent. That way we can try/catch to import the module in production and fall back to v7 API if the cozy-app doesn't have cozy-bar 8.
In the end, that would allow us to keep the initial aim of cozy-intent to be "config-free", and keep WebviewProvider with 0 React props.
cc @Crash--
cozy-bar v7 is an "ambient" dependency, you can access it from Webpack dev server scope or from DOM scope in production.
That is not the case for cozy-bar v8 which does not expose an ambient API.
Currently, as a fast fix, it was chosen to inject the required setWebviewContext method as props to WebviewProvider. A more elegant solution would be to use cozy-bar as a peerDep in cozy-intent. That way we can try/catch to import the module in production and fall back to v7 API if the cozy-app doesn't have cozy-bar 8.
In the end, that would allow us to keep the initial aim of cozy-intent to be "config-free", and keep WebviewProvider with 0 React props.
cc @Crash--