Switch to an async api - #71
Conversation
|
What is the status of this PR? Can we maybe help in getting this PR merged (e.g. testing various use cases)? |
|
This is great. Is anyone still looking into this PR? Being able to handle asynchronous external deps would be very helpful. |
|
@RReverser unfortunately no, and it's a real shame :( In the mean time, I've found that https://github.com/sebastian-software/postcss-smart-asset is fork of this module but has async support so you can try that. I've been using it myself and it works. @sergcen any chance someone can look at this and help us get this merged? Async API would be really helpful. |
|
This branch is now out of sync with master to the point of conflicts. If there isn’t new activity soon, I would say this should unfortunately be closed. |
|
It would be real shame if this is missed opportunity. I think postcss-url is one od the most used PostCSS plugins and having async API (by default, but that's another story) is must have today. Can we do something to merge this? |
|
Don't panic, I repairing this PR :) |
|
@MrMeison There was no comment from maintainers for two years. There is no sense to write any code string, till we know, that this PR will be accepted. |
|
PR will be accepted after @MrMeison will fix conflicts |
|
goto #134 |
|
published |
refs #43
It was a mistake to say, that everything will fit in
fixUrl:)Nevertheless, I have finished with some draft implementation! And successfully tested it on my project. But there are, probably, quite a lot of changes...
I can reduce the amount of code, but I have some questions:
valueCallbackwill returnoldUrlin two cases: when the url should not be processed (isUrlShouldBeIgnored) and whenUrlProcessorreturned an empty url. Is the second case expected behavior or it is a bug? For now I've leaved this logic as it is and added warning for the case, whenUrlProcessorreturns bad value.String.replacecalls per url. I think, that this extra call is not expensive, but I can be wrong. So I've wrote separate code for sync and async replacements for now. If it is ok, I can wrap allUrlProcessorresults in Promises and drop sync logic to reduce the amount of code.And another one question: should I polyfill Promise for an old Node.js?