Comments (6)
Hi, I think I can handle this :)
from covid.
Hi @sebas-alarconr !
Just assigned the issue to you.
This issue is a bit complicated. If in any doubt (like how to do something or which implementations take within all the possible ones), don't hesitate to comment it here.
from covid.
@emibcn thanks :)
Btw, already created a PR, I think it is covering the initial proposal, but let me know if you imagined it different.
Since I saw some spots where the backend data is being re-generated I provided the data handlers themselves through the Providers.
If you want me to add / modify anything, just let me know.
(I can even add JSDocs if you want)
from covid.
Great!! This is in the line I was thinking about. This can be further improved here or on next issues/PRs, as you prefer.
Things to improve even more:
- Stop passing backend indexes from Widget/List to the actual widgets: they'll get them from consumer. Ensure they all do it cleanly (sorry about differences between widgets, this project is growing fast).
- Include in the HOC a condition to show a
<Loading/>
instead of wrapped component while index is not loaded (and subscribe to index download, passing it to wrapped component once loaded).Backend/Map
uses a static index: might be needed to create an auto-resolved Promise to homogenize interfaces. - Include in the HOC the possibility to subscribe to data by props. For example, in
Widgets/Bcn/Widget.jsx
, we will be able to remove almost all class methods fromChartDataHandler
class (hence simplifying new widgets creation and maintenance ). Here, the consumer will need to detect ifthis.prop.dataset
is defined and, if yes, use it to download data and show a<Loading/>
while loading that.
Tell me if you prefer to merge what you've already done and create new (sub)issues or do it right here.
About JSDocs
It would be great, even if only this part is done. We'll need to link it to a workflow to update project's wiki (using GitHub API?) or some docs/
directory to automatically update it. Once merged, we can create a new issue for that.
from covid.
FYI: Done in issue #40 with PR #47 .
Great!! This is in the line I was thinking about. This can be further improved here or on next issues/PRs, as you prefer.
Things to improve even more:
- Stop passing backend indexes from Widget/List to the actual widgets: they'll get them from consumer. Ensure they all do it cleanly (sorry about differences between widgets, this project is growing fast).
- Include in the HOC a condition to show a
<Loading/>
instead of wrapped component while index is not loaded (and subscribe to index download, passing it to wrapped component once loaded).Backend/Map
uses a static index: might be needed to create an auto-resolved Promise to homogenize interfaces.- Include in the HOC the possibility to subscribe to data by props. For example, in
Widgets/Bcn/Widget.jsx
, we will be able to remove almost all class methods fromChartDataHandler
class (hence simplifying new widgets creation and maintenance ). Here, the consumer will need to detect ifthis.prop.dataset
is defined and, if yes, use it to download data and show a<Loading/>
while loading that.Tell me if you prefer to merge what you've already done and create new (sub)issues or do it right here.
About JSDocs
It would be great, even if only this part is done. We'll need to link it to a workflow to update project's wiki (using GitHub API?) or some
docs/
directory to automatically update it. Once merged, we can create a new issue for that.
from covid.
@sebas-alarconr I think you might like to take a look into the code that tests yours: https://github.com/emibcn/covid/blob/add-tests/app/src/Backend/Base/ContextCreator.test.jsx (not yet merged into master).
Well, you created a context for each backend. I abstracted it into a ContextCreator
, which basically does the same, but is meant to be used from each backend handler to create the exported functions/components.
from covid.
Related Issues (20)
- Maps widget is not updating on time slide HOT 1
- (JS-0466) Prefer React components to have a `shouldComponentUpdate` method
- (JS-0463) Consider adding `propTypes` to the React component definition
- (JS-0752) `label` tags should have a text label and an associated control
- (JS-0128) Should not have unused variables
- (JS-0393) Prevent missing displayName in a React component definition
- (JS-0393) Prevent missing displayName in a React component definition
- (JS-0129) Variable used before definition
- (JS-0128) Should not have unused variables
- (JS-0128) Should not have unused variables
- Widget/Slider.jsx: (JS-0128) Should not have unused variables
- Widget/Slider/PlayPause.jsx: (JS-0463) Consider adding `propTypes` to the React component definition
- (JS-0128) Should not have unused variables
- Add widget to consume BCN's timeline
- Add visual mark on App Menu opener when app update is available
- Add unit tests with `jest` HOT 1
- Improve backends context provider/consumers
- Add ESLint to CI/CD
- Add data source "Evolució dels casos, altes hospitalàries i defuncions per Covid-19 a Catalunya"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from covid.