Security News
The Dark Side of Open Source
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
babel-plugin-glamorous-displayname
Advanced tools
Readme
add a displayName property to glamorous components
You want to use glamorous, but you want to have a better experience with the
DevTools (because you lose the automatic displayName
magic that the react
babel preset gives you).
Adds the displayName
to glamorous components.
In
const MyStyledButton = glamorous.button()
Out
const MyStyledButton = glamorous.button.withConfig({
displayName: 'MyStyledButton',
})
This module is distributed via npm which is bundled with node and
should be installed as one of your project's devDependencies
:
npm install --save-dev babel-plugin-glamorous-displayname
.babelrc
(Recommended).babelrc
{
"plugins": ["glamorous-displayname"]
}
$ babel --plugins glamorous-displayname script.js
require('babel').transform('code', {
plugins: ['glamorous-displayname'],
})
babel-plugin-macros
Once you've configured babel-plugin-macros
you can import/require the glamorous
macro at babel-plugin-glamorous/macro
.
For example:
import glamorous from 'babel-plugin-glamorous/macro'
const MyStyledInput = glamorous.input({
/* your styles */
})
You could also use
glamorous.macro
if you'd prefer to type less 😀
I'm not aware of any, if you are please make a pull request and add it here!
Thanks goes to these people (emoji key):
Bernard Lin 💻 📖 ⚠️ | Kent C. Dodds 🐛 💻 📖 🤔 🚇 📢 ⚠️ |
---|
This project follows the all-contributors specification. Contributions of any kind welcome!
MIT
FAQs
add a displayName property to glamorous components
The npm package babel-plugin-glamorous-displayname receives a total of 52 weekly downloads. As such, babel-plugin-glamorous-displayname popularity was classified as not popular.
We found that babel-plugin-glamorous-displayname demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.