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

fix(core): Ensure there's only one global spotlight event target #121

Merged
merged 2 commits into from
Nov 22, 2023

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Nov 22, 2023

This is sort of a workaround for #68 which should ensure that even if two spotlight bundle variants end up in the build, still the same event target is used for communication. Not ideal and I'd like to revisit this but for now it should permit opening spotlight in astro apps again (🤞)

This change puts the eventTarget of spotlight onto the global window, thereby ensuring that all bundles get the same instance of the target.

Ideally, we find a way to avoid the double bundling un Astro but we might still keep this around. I have the feeling that something like this could occur in other framework/bundler combinations.

Copy link

vercel bot commented Nov 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
spotlightjs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 22, 2023 10:52pm

Copy link

codecov bot commented Nov 22, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e3f88d1) 30.85% compared to head (3877f38) 30.85%.
Report is 3 commits behind head on main.

❗ Current head 3877f38 differs from pull request most recent head 30e5e94. Consider uploading reports for the commit 30e5e94 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #121   +/-   ##
=======================================
  Coverage   30.85%   30.85%           
=======================================
  Files          30       30           
  Lines        1465     1465           
  Branches       48       48           
=======================================
  Hits          452      452           
  Misses       1013     1013           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Lms24 Lms24 merged commit 8b3e1e8 into main Nov 22, 2023
2 of 3 checks passed
@Lms24 Lms24 deleted the lms/fix-astro-toolbar-not-opening-iii branch November 22, 2023 22:51
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

Successfully merging this pull request may close these issues.

1 participant