Skip to content

Cozy-bar should be a peer dependency in cozy-intent #1477

@acezard

Description

@acezard

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--

Metadata

Metadata

Assignees

Labels

cozy-intentEvent-based library allowing interactions between React-Native and React applications

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions