Khan / Khan/aphrodite

Async rendering and Aphrodite

Open
#245 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.3k
Forks
187
PR merge metrics
No merged PRs in 30d

Description

Aphrodite currently relies on the fact that rendering with React is synchronous in order to build up/pull out the css definitions. The `injectionBuffer` is actually a module level "global" that just gets appended to: https://github.com/Khan/aphrodite/blob/master/src/inject.js#L140

While this works great at the moment, asynchronous rendering of React components are going to become popular in the near future and libraries like this will need to adapt.

Putting this issue on your radar so we can discuss how we'd go about safely living in an async world.

There already exists a few implementations that either stream, or render to a promise:

https://github.com/aickin/react-dom-stream
https://github.com/FormidableLabs/rapscallion

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading src/inject.js around line 140, where the module-level injectionBuffer is appended during rendering. Compare Aphrodite's synchronous assumptions with the referenced react-dom-stream and rapscallion approaches; the issue is complete only after a safe async-rendering design is agreed and implemented.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.