-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Put negative implementors first and apply same ordering logic to foreign implementors #142380
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
base: master
Are you sure you want to change the base?
Conversation
Some changes occurred in HTML/CSS/JS. |
This comment has been minimized.
This comment has been minimized.
27e69ca
to
2b0bda6
Compare
This comment has been minimized.
This comment has been minimized.
2b0bda6
to
2dd2db9
Compare
This comment has been minimized.
This comment has been minimized.
2dd2db9
to
cc15898
Compare
Took me a while to figure out where the typescript definition was stored to fix the error. ^^' |
let part = OrderedJson::array_sorted( | ||
implementors.sort_unstable(); | ||
|
||
let part = OrderedJson::array_unsorted( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely an improvement, as it eliminates an allocation, but we're still allocating an intermediate string for each element.
OrderedJson
could be much more efficient if it had a method that appended using serde_json::to_writer
.
I can open an issue for improving the OrderedJson
interface, if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An issue would be welcome indeed.
cc15898
to
80a06df
Compare
This comment has been minimized.
This comment has been minimized.
80a06df
to
3028afb
Compare
alternate interface for OrderedJson to reduce allocations inspired by #142380 (comment) r? `@GuillaumeGomez` <!-- homu-ignore:start --> <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r? <reviewer name> --> <!-- homu-ignore:end -->
☔ The latest upstream changes (presumably #142667) made this pull request unmergeable. Please resolve the merge conflicts. |
3028afb
to
bc014e0
Compare
Fixed merge conflicts. |
Either JavaScript-loaded content needs to go on the bottom, or it needs to be loaded in a blocking manner. Otherwise, you get layout shift and potential misclicks. output.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a solution to the layout shift problem.
Fair enough. I can make the implementors content to be hidden by default (when JS is enabled) and display it when the updated is done. |
Fixes #51129.
This PR changeda surprisingly small amount of things to put negative trait impls before the others: basically just adding a new information in the generated JS file for foreign implementors and a "negative marker" DOM element to know where to insert negative impls.
I also used this occasion to make the foreign implementors sort the same as the local ones by using
compare_names
.You can test it here.
r? @notriddle