GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [Flight] Fix `reference` param type in `registerServerReference` by unstubbable · Pull Request #27688 · react/react

Conversation

@unstubbable

@unstubbable unstubbable commented Nov 10, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

The reference that is passed into registerServerReference can be a plain function. It does not need to have the three additonal properties of a ServerRefeference. In fact, adding these properties (plus bind) is precisely what registerServerReference does.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@facebook-github-bot facebook-github-bot added the CLA Signed label Nov 10, 2023
@react-sizebot

react-sizebot commented Nov 10, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Comparing: 6c7b41d...bbc6c29

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js = 175.90 kB 175.90 kB = 54.75 kB 54.75 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 177.97 kB 177.97 kB = 55.39 kB 55.39 kB
facebook-www/ReactDOM-prod.classic.js = 569.81 kB 569.81 kB = 100.29 kB 100.29 kB
facebook-www/ReactDOM-prod.modern.js = 553.67 kB 553.67 kB = 97.38 kB 97.38 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against bbc6c29

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@unstubbable
unstubbable force-pushed the fix-register-server-reference-signature branch from 28f709e to 0888c90 Compare November 15, 2023 15:51
@unstubbable
[Flight] Fix reference param type in registerServerReference
bbc6c29
The `reference` that is passed into `registerServerReference` can be a
plain function. It does not need to have the three additonal properties
of a `ServerRefeference`. In fact, adding these properties (plus `bind`)
is precisely what `registerServerReference` does.
@unstubbable
unstubbable force-pushed the fix-register-server-reference-signature branch from 0888c90 to bbc6c29 Compare November 24, 2023 16:45
@unstubbable

unstubbable commented Feb 15, 2024

Copy link
Copy Markdown
Collaborator Author

I think this is still valid, even with #28343.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sebmarkbage

sebmarkbage commented Feb 15, 2024

Copy link
Copy Markdown
Contributor

It technically shouldn't even be limited to Functions. It technically should be possible to export any object from a "use server" and pass it back to the server by reference. ServerReferences probably shouldn't even have extra properties and just be a WeakMap.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sebmarkbage

sebmarkbage commented Feb 15, 2024

Copy link
Copy Markdown
Contributor

There's a static typing thing here that comes into play and is not fully thought out yet. Really types should be enforced at the "use client" / "use server" boundaries so you should not be able to annotate something that is non-serializable as an argument across the boundary. This can be enforced by the list of types we know are allowed to pass.

However, function is not a type that is allowed to pass. So passing an action would be an error. Therefore these exports actually needs to get a special marker type when they're imported so that this type can make them allowed again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@unstubbable

unstubbable commented Feb 15, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator Author

Yeah, this was more meant from a framework's/bundler's perspective. When implementing the bundling part that generates the registerServerReference calls I stumbled upon this.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sebmarkbage
sebmarkbage merged commit 9268672 into react:main Feb 15, 2024
@unstubbable
unstubbable deleted the fix-register-server-reference-signature branch February 16, 2024 09:56
This was referenced Feb 20, 2024
Bump vendored react versions vercel/next.js#62302
Closed
Upgrade vendored react vercel/next.js#62326
Merged
huozhi added a commit to vercel/next.js that referenced this pull request Feb 23, 2024
@huozhi
Upgrade vendored react (#62326)
e5d604f
### React upstream changes

- react/react#28333
- react/react#28334
- react/react#28378
- react/react#28377
- react/react#28376
- react/react#28338
- react/react#28331
- react/react#28336
- react/react#28320
- react/react#28317
- react/react#28375
- react/react#28367
- react/react#28380
- react/react#28368
- react/react#28343
- react/react#28355
- react/react#28374
- react/react#28362
- react/react#28344
- react/react#28339
- react/react#28353
- react/react#28346
- react/react#25790
- react/react#28352
- react/react#28326
- react/react#27688
- react/react#28329
- react/react#28332
- react/react#28340
- react/react#28327
- react/react#28325
- react/react#28324
- react/react#28309
- react/react#28310
- react/react#28307
- react/react#28306
- react/react#28315
- react/react#28318
- react/react#28226
- react/react#28308
- react/react#27563
- react/react#28297
- react/react#28286
- react/react#28284
- react/react#28275
- react/react#28145
- react/react#28301
- react/react#28224
- react/react#28152
- react/react#28296
- react/react#28294
- react/react#28279
- react/react#28273
- react/react#28269
- react/react#28376
- react/react#28338
- react/react#28331
- react/react#28336
- react/react#28320
- react/react#28317
- react/react#28375
- react/react#28367
- react/react#28380
- react/react#28368
- react/react#28343
- react/react#28355
- react/react#28374
- react/react#28362
- react/react#28344
- react/react#28339
- react/react#28353
- react/react#28346
- react/react#25790
- react/react#28352
- react/react#28326
- react/react#27688
- react/react#28329
- react/react#28332
- react/react#28340
- react/react#28327
- react/react#28325
- react/react#28324
- react/react#28309
- react/react#28310
- react/react#28307
- react/react#28306
- react/react#28315
- react/react#28318
- react/react#28226
- react/react#28308
- react/react#27563
- react/react#28297
- react/react#28286
- react/react#28284
- react/react#28275
- react/react#28145
- react/react#28301
- react/react#28224
- react/react#28152
- react/react#28296
- react/react#28294
- react/react#28279
- react/react#28273
- react/react#28269

Closes NEXT-2542


Disable ppr test for strict mode for now, @acdlite will check it and
we'll sync again
@ztanner ztanner mentioned this pull request Mar 19, 2024
(backport) Update React from 60a927d04 to 14898b6a9 vercel/next.js#63442
Closed
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
@unstubbable @AndyPengc12
[Flight] Fix reference param type in registerServerReference (rea…
30eff0a
…ct#27688)

The `reference` that is passed into `registerServerReference` can be a
plain function. It does not need to have the three additonal properties
of a `ServerRefeference`. In fact, adding these properties (plus `bind`)
is precisely what `registerServerReference` does.
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
@sebmarkbage
[Flight] Fix reference param type in registerServerReference (#27688
c122bf0
)

The `reference` that is passed into `registerServerReference` can be a
plain function. It does not need to have the three additonal properties
of a `ServerRefeference`. In fact, adding these properties (plus `bind`)
is precisely what `registerServerReference` does.

DiffTrain build for commit 9268672.
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
@unstubbable
[Flight] Fix reference param type in registerServerReference (rea…
d39c68d
…ct#27688)

The `reference` that is passed into `registerServerReference` can be a
plain function. It does not need to have the three additonal properties
of a `ServerRefeference`. In fact, adding these properties (plus `bind`)
is precisely what `registerServerReference` does.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

CLA Signed

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@unstubbable @react-sizebot @sebmarkbage @facebook-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.