reaviz / reaflow

🎯 React library for building workflow editors, flow charts and diagrams. Maintained by @goodcodeus.
https://reaflow.dev
Apache License 2.0
2.11k stars 122 forks source link

Usage in web-components environment #186

Open K4CZP3R opened 2 years ago

K4CZP3R commented 2 years ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

Current behavior

I'm trying to make it work with lit (web components). I made one change in the source code to make it compile:

in index.js I've changed

return new PCancelable__default((resolve, reject) => {

to

return new Promise((resolve, reject) => {

Without it I will get

PCancelable__default is not a constructor

Expected behavior

I would love to know if there is any specific reason to not use Promise in this case. Because with the promise, it is possible to make it work with lit.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

I would love to use this library in my web component project, there are no good enough alternatives to this lib.

Environment


Libs:
- react-dom version: 18.2.0
- reaflow version: 5.0.7


Browser:
- [x] Chrome (desktop) version 106
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX

For Tooling issues:
- Node version: XX  
- Platform:  

Others: