-
Notifications
You must be signed in to change notification settings - Fork 36
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
Order of bundles in bundle.result.json #71
Comments
Currently, the result order is simply based on the order the bundles leave the stream. One work-around is you could add a custom handler at the end of the stream that does a final reorder:
That is not ideal though. This functionality should be handled by this package. By default I would think the order would match the order of bundles as they appear in the |
Yes, the order would be intuitive, I think. |
Any progress on this? |
Sorry no. I'm always willing to accept PRs... |
Dropped in to see if someone reported this yet. My project requires bundles to be rendered in a particular order, so this would be an ideal enhancement. It would be great if the order would match the order of bundles as they appear in the I don't have time to submit a PR, but I did place a bounty: |
To change the ordering, I'd need to either add an order/weight attribute, or change the order they are coming through the stream. Which would be preferable? I'd think the former. |
@PlasmaPower see the thread above. The object key order in Given this
The
|
@chmontgomery Yes I get that, I'm talking about how to accomplish that. When the objects are piped through the stream, the result pipe will put them into the file. However, it doesn't know about the order of them in the config. Therefore, it must receive that information, I would put it in an order attribute for the bundle. Is that good? I could also simply ship the bundles in the correct order, but that could lead to a slow down and might be harder to implement. |
@PlasmaPower I think putting the order in an The only downside of this approach is that we'll be passing the result order down attached to every file in the stream, but as long as you keep the object small it shouldn't be a problem, e.g.:
Once you do that, you can use the order config in these two places: |
@chmontgomery Makes sense, I was just planning on storing that specific item's position in the result but your solution will probably be more stable and faster. |
this feature has been published into |
Big thanks to you both! |
What causes the order in bundle.result.json?
I would love to be able to set the order the bundles appear in the result.
Would that be possible?
The text was updated successfully, but these errors were encountered: