devongovett / unplugin-parcel-macros

MIT License
205 stars 3 forks source link

This library vs unplugin-macros #2

Open husayt opened 2 months ago

husayt commented 2 months ago

Hi I am trying to understand how two libraries compare? Just to better understand usecases for both.

Here is the link to unplugin-macros

Thank you

husayt commented 2 months ago

I found this. Is it accurate for these two libraries as well?

https://parceljs.org/features/macros/#:~:text=Differences%20from%20Bun&text=Parcel%20supports%20returning%20functions%20from,Response%20objects%2C%20or%20Blob%20objects.

devongovett commented 2 months ago

Yes those are all true. Returning functions and generating assets are the main things. However, unplugin-macros has very limited evaluation support as well. I believe the arguments and return value must be literals (eg strings and numbers), not objects/arrays, and there is no support for evaluating constants either.