Skip to content
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

Merged
merged 1 commit into from
Feb 21, 2020
Merged

Conversation

sebmarkbage
Copy link
Collaborator

@sebmarkbage sebmarkbage commented Feb 20, 2020

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)

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Feb 20, 2020
Sounds like this is the name we're going with. This also helps us
distinguish it from other "chunking" implementation details.
@codesandbox-ci
Copy link

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.

@sizebot
Copy link

sizebot commented Feb 20, 2020

No significant bundle size changes to report.

Size changes (experimental)

Generated by 🚫 dangerJS against 49130aa

@sizebot
Copy link

sizebot commented Feb 20, 2020

No significant bundle size changes to report.

Size changes (stable)

Generated by 🚫 dangerJS against 49130aa

@devknoll
Copy link
Contributor

Lego-blocks is a good analogy though since they're small

React Bricks? 😅

@gaearon
Copy link
Collaborator

gaearon commented Feb 20, 2020

🧱

Copy link
Collaborator

@gaearon gaearon left a 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

@MatanBobi
Copy link

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..

@josephsavona
Copy link
Contributor

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.

@devknoll
Copy link
Contributor

devknoll commented Feb 20, 2020

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.

@sophiebits
Copy link
Collaborator

Looking forward to buying the React-branded LEGO blocks.

also, chunk + block = chonk?

Copy link

@AshishKapoor AshishKapoor left a 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 sebmarkbage merged commit 65bbda7 into facebook:master Feb 21, 2020
@alexeyraspopov
Copy link
Contributor

@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 useContext can be used inside the query function or how limited the function is?

@gaearon
Copy link
Collaborator

gaearon commented Feb 21, 2020

Yeah we'd like to support some form of context there. But not supported yet.

trueadm pushed a commit to trueadm/react that referenced this pull request Feb 21, 2020
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
trueadm pushed a commit to trueadm/react that referenced this pull request Feb 21, 2020
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
trueadm pushed a commit to trueadm/react that referenced this pull request Feb 21, 2020
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
trueadm pushed a commit to trueadm/react that referenced this pull request Feb 21, 2020
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
trueadm pushed a commit to trueadm/react that referenced this pull request Feb 21, 2020
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants