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

Are content scripts injecting multiple instances of React? #706

Open
onurkerimov opened this issue Sep 6, 2024 · 2 comments
Open

Are content scripts injecting multiple instances of React? #706

onurkerimov opened this issue Sep 6, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@onurkerimov
Copy link

onurkerimov commented Sep 6, 2024

First of all, sorry if my analysis is wrong. Thanks a lot for this clear and effective template, it really makes things a lot easier!

As far as I understood, content and content-ui entries under pages are injected automatically to the website we're on. Also we have the ability to inject the content-runtime if we click to the "Click to inject Content Script" button.

I'm wondering if both bundles are injecting their own node_modules into the current document, even when they're shared across. OR do they share the same React instance (or perhaps other common modules) somehow? If they do, I think I have missed it, and I'd be curious to see where it's being done. 🙂

If marking shared node_modules as externals or similar isn't practical, I think an alternative way to go could be causing a dynamic import to run in the content/content-ui scripts via chrome.runtime.onMessage or a similar mechanism, instead of appending another IIFE.

I think this could be a good feature request, if it isn't already covered. Thank you.

@onurkerimov onurkerimov added the enhancement New feature or request label Sep 6, 2024
Copy link

github-actions bot commented Sep 6, 2024

Thank you for your contribution. We will check and reply to you as soon as possible.

@Jonghakseo
Copy link
Owner

Hi. Thanks for the nice comment. Each page context's bundle has its own files for the shared dependencies. I think we can try some things to fix this inefficiency, thanks for the great suggestion!

@PatrykKuniczak PatrykKuniczak added the question Further information is requested label Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants