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

custom use directives + using closure serializer #28619

Open
harrysolovay opened this issue Mar 23, 2024 · 6 comments
Open

custom use directives + using closure serializer #28619

harrysolovay opened this issue Mar 23, 2024 · 6 comments

Comments

@harrysolovay
Copy link

I'd like guidance around reusing the (canary) compiler's closure serializer. It seems the "use [env]" directive approach could work well for a wide range of multi-env use cases. I'm not sure if the React team's intention is to make this pluggable / if there's a good approach to patching it today... but any guidance would be greatly appreciated.

For example, how might we implement a "use worker" directive?

worker.ts

"use worker"

export function computeTheThing(): Promise<string> {
  // ...
  return result
}

MyPage.tsx

import { computeTheThing } from "./worker.ts"

export default function MyPage() {
  return (
    <button onClick={() => computeTheThing().then((v) => console.log(v))}>
      Click me!
    </button>
  )
}

Ideally, we could associate the new "use worker" directive with a transform function. This directive could then be used similarly to "use server".

Copy link

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@github-actions github-actions bot added the Resolution: Stale Automatically closed due to inactivity label Jun 21, 2024
@harrysolovay
Copy link
Author

bump

@github-actions github-actions bot removed the Resolution: Stale Automatically closed due to inactivity label Jun 21, 2024
Copy link

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@github-actions github-actions bot added the Resolution: Stale Automatically closed due to inactivity label Sep 19, 2024
@harrysolovay
Copy link
Author

bump

@github-actions github-actions bot removed the Resolution: Stale Automatically closed due to inactivity label Sep 20, 2024
Copy link

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@github-actions github-actions bot added the Resolution: Stale Automatically closed due to inactivity label Dec 19, 2024
@harrysolovay
Copy link
Author

Ping

@github-actions github-actions bot removed the Resolution: Stale Automatically closed due to inactivity label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant