-
Notifications
You must be signed in to change notification settings - Fork 826
[Bug 1139127,1139128,1143941,1143945] Community top contributors #2430
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
Conversation
Uses React for UI, Babel for ES6+JSX compilation, and Browserify for a module system.
|
More helpful links
|
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.
Actually, there is with ElasticUtils--you can do .everything():
It does an ES request for the count, then does another ES request to get count number of things.
I don't know if that helps you or not.
Also, "This should be the higher..." should probably be "This should be higher...".
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.
Ooh, nice. I stole that comment, and the general approach of getting metric objects, and then getting user objects, from some stuff r1cky wrote for the first iteration of this feature.
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.
I did this for one place, but I think that we still need to use this trick for facets. Let me know if there is something clever I'm missing there too.
|
Seems like there's a blank |
This was preventing the tests from running.
|
|
|
I wrote some docs about all this jazz. |
This reverts commit cec2495.
kitsune/bundles.py
Outdated
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.
There's no bower/ directory, so I think these need to be de-bower-ified.
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.
+1
|
The title in the titlebar for http://localhost:8000/en-US/community/top-contributors/l10n/new doesn't match the title on the page: |
|
Using the filters feels kind of stuttery, but it's possible that's just when it's running on my machine. Everything else seems to work fine as far as I can tell. I can't really speak to the React code--I have no idea what that's supposed to look like or how it works, so it's hard to review it. Mmm... I think I've covered everything I can think of here. |
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.
thanks for adding this. i totally dropped the ball on adding bower docs!
|
I added tests and fixed some of the issues brought up in review. ^ |
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.
@willkg I know that I am going to be asked to be able to sort this data by last_contribution_date, but I don't really see a way to do that without getting every single user object instead of paginating just the IDs. This sounds quite slow to me. Do you have any clever ideas?
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.
So, I'm not entirely sure I understand the question. Why can't you do another ES search ordered by last_contribution_date and just retrieve that page of ids?
Generally, SUMO bugs tend to be under-specified, so I'd treat everything as a "first pass", land it and then create new bugs for optimization work or changes in requirements. The theory being that they need to see a prototype to help them figure out what it is they need and spending the least amount of time on the prototype gets it out there faster and "wastes" less time.
Going on that theory, I'd just leave it as is for now and push off additional work to new bugs.
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.
Huh. What you said here actually makes a lot of sense, so I can imagine being able to do this query without it being very inefficient. I'm not sure what my problem was earlier. Yay for more sets of eyes on a problem.
That being said, I think the idea of landing this and then following up is a good one. I'll do that.
|
Tests look ok to me. |
|
@rehandalal Any opinions on the front end of this? If not, I'm inclined to land this so I can get unblocked. |
|
@mythmon looks fine to me. I don't see anything glaringly obvious. Took me a bit to wrap my head around some of it. |
|
@rehandalal I'd be really interested in hearing about what parts were hard to understand. There is a lot of code here, so that is understandable, but I'm curious if we can improve any of it. I'm going to merge this as is, but I'd love to get feedback on it to improve this. |
[Bug 1139127,1139128,1143941,1143945] Community top contributors
This covers a lot of bugs, and a lot of functionality. I could split this up into multiple smaller PRs, but they would all have to be in a linear order, and I think it would just be more frustrating in the long run.
Some broad architecture notes
(foo, bar) => foo + bar, classes, and modules.ComponentName.jsx. They useexport default class ComponentName extends React.Component..browserify.js. Are treated as ES6 and as Browserify entry points for the module system. They and all the files they import will be packaged as a single file, compiled to ES5.React docs: http://facebook.github.io/react/docs/getting-started.html
Details of the feature in particular:
The main view loads a barebones view which simply renders the React component. It also embeds the needed data into the page via script tags. This avoids and extra round trip. All filtering on the client happens by modifying the querystring parameters, and essentially reloading the page. React is very efficient, and analyzes the before and after of the DOM, and only re-renders the parts that actually changed. It is magic. Both the backend view and the frontend renderer read from the query string, so this is the one source of truth for what data should be shown on the page.
I expect this to be a high touch review. I imagine I will have questions to answer, and that there needs to be more comments in some places. I also expect we will want to change some things about this, or at least do them differently in the future.
r?