Skip to content

Conversation

@snowystinger
Copy link
Member

@snowystinger snowystinger commented May 27, 2025

Closes

Open question: Do we want to attach all of this data and behaviour in production builds? Or only during dev. For all testing in this PR you'll need to build locally so that it's the dev build otherwise you won't see anything when looking at the extension.

Follow instructions in README to run the plugin. There is also a description of the extension architecture in there as it is non-trivial due to the various sandbox that chrome imposes in addition to the different ways that a macro could be updated ie. static, dynamic, conditional static.

Note, there is a parcel bug which will cause all tabs that have had the content script injected to reload on every change. I cannot resolve this right now. If you build instead so that the extension doesn't change, then it won't do this. It's only during HMR. This will also cause every tab to refresh if a tab that had loaded the extension is closed.
For this reason, it can be easier to build the extension instead of running it as if you're developing.

Some notes, this is currently meant to be used in addition to the regular panels and AtomicCSS to determine where styles are coming from. It is not designed to replace those extensions and inspectors.

I also haven't solved how to maintain the object in the panel when doing things like hover, so it can be a little hard to inspect fleeting styles like that
None of that should prevent us from starting to use it and merging and iterating.

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

I added a style macro in the commit e5ab27b which is static and is swapped with another static one on a span inside buttons. It reacts to the button being focused. You can see the extensions dev panel is updated when this swap occurs despite it being a static macro.

I removed that afterwards. So to test the updates on static macros, use that storybook build.

Otherwise, you can inspect elements and view the results in the dev tools panel.

🧢 Your Project:

@rspbot
Copy link

rspbot commented Jun 3, 2025

Build successful! 🎉

@snowystinger snowystinger marked this pull request as ready for review June 3, 2025 06:14
@rspbot
Copy link

rspbot commented Jun 3, 2025

Build successful! 🎉

@rspbot
Copy link

rspbot commented Jun 3, 2025

Build successful! 🎉

@rspbot
Copy link

rspbot commented Jun 4, 2025

Build successful! 🎉

@rspbot
Copy link

rspbot commented Jun 5, 2025

Build successful! 🎉

@snowystinger snowystinger changed the title [WIP] feat: Style macro devtool feat: Style macro devtool Jun 5, 2025
@rspbot
Copy link

rspbot commented Jun 5, 2025

Build successful! 🎉

@rspbot
Copy link

rspbot commented Jun 5, 2025

Build successful! 🎉

@rspbot
Copy link

rspbot commented Jun 5, 2025

Build successful! 🎉

@rspbot
Copy link

rspbot commented Jun 6, 2025

Build successful! 🎉

@rspbot
Copy link

rspbot commented Jun 6, 2025

Build successful! 🎉

@snowystinger snowystinger force-pushed the style-macro-devtool branch from 994911b to 2706cd1 Compare June 6, 2025 05:03
@rspbot
Copy link

rspbot commented Jun 6, 2025

Build successful! 🎉

@rspbot
Copy link

rspbot commented Jun 16, 2025

Build successful! 🎉

@rspbot
Copy link

rspbot commented Oct 29, 2025

@rspbot
Copy link

rspbot commented Oct 29, 2025

@rspbot
Copy link

rspbot commented Oct 29, 2025

@rspbot
Copy link

rspbot commented Oct 29, 2025

@rspbot
Copy link

rspbot commented Oct 29, 2025

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.

3 participants