camunda / camunda-bpmn-js

Embeddable Camunda modeling distributions based on bpmn-js
MIT License
109 stars 23 forks source link

Cannot Use `camunda-bpmn-js` Without Installing `@bpmn-io/form-js` #333

Open philippfromme opened 11 months ago

philippfromme commented 11 months ago

Describe the Bug

I am forced to install @bpmn-io/form-js when using this library due to @bpmn-io/form-variable-provider listing it as a peer dependency and its implementation depending on the getSchemaVariables functionality.

camunda-bpmn-js 🔗 @bpmn-io/form-variable-provider 🔗 @bpmn-io/form-js

Steps to Reproduce

  1. Install this library
  2. @bpmn-io/form-js dependency must be installed

Expected Behavior

I can use this library without having to install @bpmn-io/form-js. Resolving form variables is optional or the functionality of getSchemaVariables is pulled out of bpmn-io/form-js.

philippfromme commented 10 months ago

@marstamm Are we aware of this?

marstamm commented 10 months ago

This was caused by https://github.com/bpmn-io/form-variable-provider/pull/4. I guess we were to eager to add peer-dependencies. Form-js should be a direct dependency for the variable resolver. I'll create a patch release

nikku commented 10 months ago

I'm not a fan of bundling form-js in the context of BPMN and raised this with the HTO team. Maybe we find a better way to inject the code intelligence, if forms are used (and recognized)?

This would also ensure there exists only a single instance of form-js in the tree.

marstamm commented 10 months ago

I think we are mixing 2 issues here.

  1. This Issue: The variable resolver requires a utility from form-js, but declares it as a peer dependency. We do not want to add form-js as direct dependency (or install it manually) for bpmn-js only bundles and still want the code completion ==> mark it as production dependency https://github.com/bpmn-io/form-variable-provider/pull/6

  2. The bundle then contains everything from form-js, not just the utility function ==> unrelated to the fist one, should be fixed in form-js

nikku commented 10 months ago

The bundle then contains everything from form-js, not just the utility function ==> unrelated to the fist one, should be fixed in form-js

This is what I reached out to HTO about.

philippfromme commented 10 months ago

I think shipping the utility as a separate library acknowledging the fact that it's used outside of the context of form-js would make sense. This is how we've handled such cases in the past.