-
Notifications
You must be signed in to change notification settings - Fork 2
Home
- Less code
- Pure functions are first class citizens.
- Easy debugging
- React, Apollo, RxJS, Immer
- Java Server: Redis
- Node Server: Express
- MongoDB
- Data Visualization: WebGL, D3, Canvas, SVG, WebWorker, Progressive Rendering
Reduce react code. Simple code are robust and easy to reason.
- Use
hooks
instead ofComponents
; - No more
withConnect
,withGraphQL
. - No more
redux
,reselect
. Components generally don't need such complication. System core components will still keep global state inredux
.
Resource caching is especially valuable in a GraphQL server because it unlocks partial query caching — a design pattern that lets the GraphQL layer cache responses from underlying APIs and then assemble them into arbitrary query results without refetching from the server.
Apollo caches static resources and get data from REST API for dynamic resources only:
- getSeries, getEpisodes are static ones
- getUserProgress will change along with time, therefore it is dynamic.
It is adopted in an 'opt-in' fashion. We can connect existing REST api to GraphQL
Single event streaming
Developers get constant reminders that they are not using 'pure javascript' with immutablejs
, therefore cannot focus on business logic constantly.
Immer
is adopted because developers always manipulate plain javascript objects.
Performance is not a significant factor of this design.
immutablejs
code are difficult to debug, while reducers that are in plain ES6 are easy to debug and test.
We need to complete all of our updating and drawing before the browser wants to draw the next frame. With 60 frames a second, that works out to less than 17ms to do all of our calculations and updates.
We pass computation from CPU to the GPU.
- A vertex shader updates a special value called
gl_Position
that determines where a vertex is positioned on screen. - A fragment shader updates a special value called
gl_FragColor
that determines which color a pixel will be.