-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
Rename Chunks API to Blocks #18086
Rename Chunks API to Blocks #18086
Conversation
Sounds like this is the name we're going with. This also helps us distinguish it from other "chunking" implementation details.
8d09f1d
to
49130aa
Compare
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
React Bricks? 😅 |
🧱 |
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’m intrigued by bricks tho
I maybe dropping in with no context but based on the explanation @sebmarkbage gave above, maybe Tiles would fit? As Tiles don't have any size reference (at least to me), the only problem with tiles is that I don't recall them being related to CS but bricks are also not related.. |
Seems reasonable to me. Should we consider naming conflicts? Are there any other projects in this space that might be using the name? That said, "block" is pretty generic so it seems fine. Re the other suggestions - bricks or tiles - the naming doesn't work as well. "Blocks" makes me think of kids blocks which are all different shapes/sizes (like UI components) whereas bricks/tiles are usually all the same size or just a very limited set. |
Bricks wasn't a (very) serious suggestion 😅In fact, that both @sebmarkbage and @josephsavona (and most other people, probably) called Lego's blocks instead of bricks (the official name for a Lego piece #pedantic) is probably a good hint that blocks might be more appropriate 😛 My concern with those types of specific/skeuomorphic names like Brick or Tile is that they end up being imperfect analogies at best, and misleading at worst, where at least Block seems generic enough. |
Looking forward to buying the React-branded LEGO blocks. also, chunk + block = chonk? |
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.
Renamed chunks
to blocks
. Looks good!
@sebmarkbage, reading through the tests, I'm trying to come up with a basic example of this API. Not that I have any suggestions or pushing on something, just wanted to ask if I understood the idea correctly: function UserQuery(userId) {
// some sort of cache that can throw promise
let user = userCache.get(userId);
return { user };
}
function UserProfile(props, data) {
return <JSX />;
}
let loadUserProfile = React.block(UserQuery, UserProfile);
function UserProfileView({ userId }) {
let Profile = loadUserProfile(userId);
return (
<Suspense>
<Profile ... />
</Suspense>
)
} If this is approximately what the API is going to look like, I wonder if |
Yeah we'd like to support some form of context there. But not supported yet. |
Sounds like this is the name we're going with. This also helps us distinguish it from other "chunking" implementation details. Add Modern Event System fork Fix FIX FIX Refine comment Support handling of listening to comment nodes Update error codes FXI FXI Add test cases and revise traversal Fix Refactor twak Rename Address traversal of comment nodes
Sounds like this is the name we're going with. This also helps us distinguish it from other "chunking" implementation details. Add Modern Event System fork Fix FIX FIX Refine comment Support handling of listening to comment nodes Update error codes FXI FXI Add test cases and revise traversal Fix Refactor twak Rename Address traversal of comment nodes Fix
Sounds like this is the name we're going with. This also helps us distinguish it from other "chunking" implementation details. Add Modern Event System fork Fix FIX FIX Refine comment Support handling of listening to comment nodes Update error codes FXI FXI Add test cases and revise traversal Fix Refactor twak Rename Address traversal of comment nodes Fix Fix
Sounds like this is the name we're going with. This also helps us distinguish it from other "chunking" implementation details. Add Modern Event System fork Fix FIX FIX Refine comment Support handling of listening to comment nodes Update error codes FXI FXI Add test cases and revise traversal Fix Refactor twak Rename Address traversal of comment nodes Fix Fix WIP
Sounds like this is the name we're going with. This also helps us distinguish it from other "chunking" implementation details. Add Modern Event System fork Fix FIX FIX Refine comment Support handling of listening to comment nodes Update error codes FXI FXI Add test cases and revise traversal Fix Refactor twak Rename Address traversal of comment nodes Fix Fix WIP
Sounds like this is the name we're going with. Blocks is a general abstract term used for many times of units similar to Components. Chunks is more often used for a very specific mechanism in CS. This also helps us distinguish it from other "chunking" implementation details.
My only hesitation is that Block sounds too big where they can actually be very small. Lego-blocks is a good analogy though since they're small. Components used to thought of as fairly large too but become smaller with more use.
Another possible name could be Part but this is often used to represents things lower in the hierarchy than Component in Bill of Materials etc. Where as Blocks are higher than Component. Part could be a name for "Host component".
(h/t @devknoll)