Comments (14)
Yeah, I think that we should probably only have one (macro
) and stick with that... Otherwise it will make things confusing.
from babel-plugin-macros.
This kind of really doesn't matter, but...
import css from "glam.macros"
Using "macros" (the plural) is kinda weird since that file only exports one macro.
Should we consider maybe doing .macro
?
from babel-plugin-macros.
Yes, I'll make that change right now. Thanks!
from babel-plugin-macros.
I find it very unlikely that something like this would make it to the TC39 ever (I don't even know how that'd work) because it's a compile-time thing
I guess the ecosystem need something named CT39 - Compile-Time 39
π
from babel-plugin-macros.
I guess letβs go with .macros
naming for now and revisit after we have real world feedback from using it.
from babel-plugin-macros.
Sounds fine to me. I expect that if it's changed we could write a codemod to upgrade people's code in a pretty straightforward way anyway π
Still open to other thoughts though!
from babel-plugin-macros.
I'd say I'd like to stay away from having to handle new syntax in Babel itself? Although we made exceptions in the past for JSX/Flow/TS and same with proposals - we aren't adding anything if it's not proposed to TC39?
from babel-plugin-macros.
Sounds good. I think the best way forward is to continue as we are. I find it very unlikely that something like this would make it to the TC39 ever (I don't even know how that'd work) because it's a compile-time thing. We'll see what the future holds. Thanks for the input @hzoo!
from babel-plugin-macros.
Going to go ahead and close this for now. Happy to hear other thoughts though.
from babel-plugin-macros.
Done. Thanks again! π v0.5.0
from babel-plugin-macros.
What if there're more macros?
import { Translation, Plural, Select } from 'i18n.macros'
I guess it could be written on separate lines, but it's just shorter/faster.
from babel-plugin-macros.
What you have there is totally supported (except the source must end in macro). See this and this.
Though that's a good point. Perhaps we should support both macro
and macros
?
from babel-plugin-macros.
I really don't mind about naming, whatever works. Let's stick to macro
;) I thought I read through test cases, but I definitely missed that.
Awesome work!
from babel-plugin-macros.
I don't see too much of an issue supporting both macro
and macros
. Only downside I can think of would be documentation/learning overhead.
from babel-plugin-macros.
Related Issues (20)
- Can automatically import a macro οΌ HOT 1
- Add hook after all files have been processed? HOT 6
- Failure with ts-jest and babel HOT 13
- Migrate to github actions HOT 1
- "Duplicate declaration" error due to identifier traversal change HOT 6
- Add to docs that plugin config can also come from babel plugin config HOT 1
- Initialization, scopes and assignments - possible bugs / possible improvements HOT 10
- How to show errors in vscode or other editor when macro is throwing MacroError or buildCodeFrameError? HOT 3
- How to apply macro in live coding app (made with create-react-app) HOT 2
- How to handle nests macro HOT 2
- webpack 5 build error HOT 5
- Maintenance is frozen HOT 10
- isMacrosName doesn't provide the full path HOT 9
- Feature: re-entrant macros. HOT 3
- Can we run babel-plugin-macros in the browser HOT 10
- Critical dependency: require function is used in a way in which dependencies cannot be statically extracted HOT 10
- Proposal: Allow macros to be defined in `.macro.mjs` files HOT 6
- Depending on vulnerable version of cosmiconfig HOT 14
- Can we bump "cosmiconfig" dependency to its latest HOT 2
- Facing issue with fortawesome integration with babel-plugin-macros. HOT 16
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from babel-plugin-macros.