Code Monkey home page Code Monkey logo

Comments (14)

kentcdodds avatar kentcdodds commented on July 30, 2024 3

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.

suchipi avatar suchipi commented on July 30, 2024 1

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.

kentcdodds avatar kentcdodds commented on July 30, 2024 1

Yes, I'll make that change right now. Thanks!

from babel-plugin-macros.

anikethsaha avatar anikethsaha commented on July 30, 2024 1

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.

gaearon avatar gaearon commented on July 30, 2024

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.

kentcdodds avatar kentcdodds commented on July 30, 2024

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.

hzoo avatar hzoo commented on July 30, 2024

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.

kentcdodds avatar kentcdodds commented on July 30, 2024

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.

kentcdodds avatar kentcdodds commented on July 30, 2024

Going to go ahead and close this for now. Happy to hear other thoughts though.

from babel-plugin-macros.

kentcdodds avatar kentcdodds commented on July 30, 2024

Done. Thanks again! πŸ‘ v0.5.0

from babel-plugin-macros.

tricoder42 avatar tricoder42 commented on July 30, 2024

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.

kentcdodds avatar kentcdodds commented on July 30, 2024

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.

tricoder42 avatar tricoder42 commented on July 30, 2024

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.

suchipi avatar suchipi commented on July 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.