Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Idea] overlay-kit devtools #81

Open
jgjgill opened this issue Aug 29, 2024 · 2 comments
Open

[Idea] overlay-kit devtools #81

jgjgill opened this issue Aug 29, 2024 · 2 comments

Comments

@jgjgill
Copy link
Contributor

jgjgill commented Aug 29, 2024

hello. Since I first came across overlay-kit, I've been playing around with the code and finding it very useful.
During this process, I realized the need for a convenient debugging environment along with the desire to make the library even better.

Personally, the initial process of adapting to the library was a bit of a learning curve.

  • You can't create overlays with duplicate IDs.
  • Unlike unmount, close doesn't remove from the DOM.

And even when I was actually using the library, I still needed to debug the data in the overlay.
I could have used the useOverlayData hook provided by the library, but I found it cumbersome to call and remove it whenever I needed to.

I was thinking about how to improve this and came up with overlay-kit-devtools, inspired by usefunnel - Funnel Debugger.

I think that since overlay-kit organizes the flow of overlays based on an id, it would be handy to be able to explicitly control this id.

I want to share a little more of the direction I think, so I created unofficial devtools, although it's very incomplete.

Example

361804988-d7158967-b50b-414c-93af-514de0c211f7.mov

Currently, I arbitrarily configured useEffect to communicate with devtools based on events.
If I could improve the structure, I could add the code for devtools in dispatchOverlay instead of calling events from useEffect.

store.tsx

export function dispatchOverlay(action: OverlayReducerAction) {
  overlays = overlayReducer(overlays, action);
  const event = new CustomEvent('sendToExtension', { detail: { overlayList: overlays.overlayOrderList, currentId: overlays.current } });
  window.dispatchEvent(event);
  emitChangeListener();
}

What do you think of this idea? I want to hear what you think of it, whether you think it could be improved, or if you think it's a negative.

please feel free to comment. Thank. 🙇‍♂️

@jungpaeng
Copy link
Member

Hello, as you mentioned, if there are dev tools, it would be very helpful to track the currently open overlays. I think it would also be effective for tracking cases where an overlay needs to be unmounted but isn’t, which causes memory leaks.

Currently, I can’t think of any major features to add to the overlay-kit, so I think making dev tools could be our next goal.

@jgjgill
Copy link
Contributor Author

jgjgill commented Sep 5, 2024

Oh, Thank you for leaving a comment.

Currently, I can’t think of any major features to add to the overlay-kit, so I think making dev tools could be our next goal.

Oh I see, I was thinking that I could contribute more if there was an extensible interface 🤔
I'll come back when devtools or other major features are added, thanks. 🙇‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants