-
Couldn't load subscription status.
- Fork 1.3k
feat: Style macro devtool #8305
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
base: main
Are you sure you want to change the base?
Conversation
# Conflicts: # yarn.lock
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
994911b to
2706cd1
Compare
|
Build successful! 🎉 |
|
Build successful! 🎉 |
# Conflicts: # package.json # packages/@react-spectrum/s2/chromatic/CardView.stories.tsx # packages/@react-spectrum/s2/stories/CardView.stories.tsx # packages/@react-spectrum/s2/style/__tests__/style-macro.test.js
# Conflicts: # package.json # yarn.lock
# Conflicts: # eslint.config.mjs # packages/@react-spectrum/s2/style/__tests__/style-macro.test.js # yarn.lock
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
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:
📝 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: