Skip to content
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

add ability to run svgr in sync mode #106

Closed
lifeiscontent opened this issue May 24, 2018 · 4 comments
Closed

add ability to run svgr in sync mode #106

lifeiscontent opened this issue May 24, 2018 · 4 comments

Comments

@lifeiscontent
Copy link
Contributor

@neoziro I was thinking of creating a svgr/macro to run svgr as a macro but realize when writing a macro the code needs to run synchronously. Do you think we could make a sync option for svgr to add this functionality?

@gregberge
Copy link
Owner

gregberge commented May 24, 2018

I think it is already done https://github.com/evenchange4/svgr.macro. And for the sync mode, the answer is no. I prefer to keep it asynchronous.

@lifeiscontent
Copy link
Contributor Author

lifeiscontent commented May 24, 2018

@neoziro I understand that the preferred method is async, but sometimes there are reasons why you would run in sync mode, e.g. this macro. the macro currently is using a execSync function from child process, it'd be nice to have an API so you don't have to run a separate process. Also, it'd be cool to support a glob pattern.

TLDR, the reason why I'm asking is @evenchange4 's current implementation is incredibly slow do to the way the code is executed.

@gregberge
Copy link
Owner

Yes, but I don't know if it is even possible to run it synchronously. Let's reopen it.

@gregberge
Copy link
Owner

Follow up in #185.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants