-
Notifications
You must be signed in to change notification settings - Fork 12k
Order of parameters not preserved when using x-prompt #14402
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
Comments
The versions of V8 used within Node.js 10 and earlier use an unstable quicksort for arrays with a length larger than 10. Node.js 11/12+ use V8 7.0+ which implements a stable sort instead. |
Node.js versions prior to 11 used an unstable sort for arrays with a length greater than 10. This caused the prompt order of a schematic with more than 10 prompts to be inconsistent the the content of the file and the same schematic with several of the prompts removed. Since priorities were never fully implemented and property dependencies will most likely be used at a higher level instead, the underlying elements have been removed with this change. Fixes angular#14402
Node.js versions prior to 11 used an unstable sort for arrays with a length greater than 10. This caused the prompt order of a schematic with more than 10 prompts to be inconsistent with the content of the file and the same schematic with several of the prompts removed. Since priorities were never fully implemented and property dependencies will most likely be used at a higher level instead, the underlying elements have been removed with this change. Fixes angular#14402
Node.js versions prior to 11 used an unstable sort for arrays with a length greater than 10. This caused the prompt order of a schematic with more than 10 prompts to be inconsistent with the content of the file and the same schematic with several of the prompts removed. Since priorities were never fully implemented and property dependencies will most likely be used at a higher level instead, the underlying elements have been removed with this change. Fixes #14402
Node.js versions prior to 11 used an unstable sort for arrays with a length greater than 10. This caused the prompt order of a schematic with more than 10 prompts to be inconsistent with the content of the file and the same schematic with several of the prompts removed. Since priorities were never fully implemented and property dependencies will most likely be used at a higher level instead, the underlying elements have been removed with this change. Fixes #14402
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 Bug report
Command (mark with an
x
)Description
When Angular CLI is asking for parameters specified with x-prompt in a schematics, the order should be preserved. This seems to be true for small number of prompts, but breaks when more are used.
The likely culprit is the sort on top of _applyPrompts in https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/core/src/json/schema/registry.ts
It seems that older V8 versions didn't implement stable sort. I don't follow exactly the Node releases, so it's possible this is fixed in the absolutely newest one.
Seeing that the priorities are currently not configurable, maybe commenting-out the sort call is the quickest fix.
🔬 Minimal Reproduction
🌍 Your Environment
The text was updated successfully, but these errors were encountered: