fix(build): make build pass and fully esm bundle#9
fix(build): make build pass and fully esm bundle#9ecyrbe wants to merge 1 commit intopingdotgg:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| @@ -1,5 +1,3 @@ | |||
| "use client"; | |||
There was a problem hiding this comment.
Decent chance this won't work without this
There was a problem hiding this comment.
I'm pretty confident about this.
Here you are in a library.
Library code is built and bundled without knowing anything about RSC boundaries.
This should be at component level in your next app :
'use client'
import { useZact } from 'zact/client';cf https://github.com/reactjs/rfcs/blob/main/text/0227-server-module-conventions.md
There was a problem hiding this comment.
Well true, we should use this hook in client component anyway, user will have to specify the use client instead, so the directive is not really necessary in here.
However, it doesn't hurt to have the use client directive here tho, to tell React that this is one of the client entry, it's safer than nothing.
https://nextjs.org/docs/getting-started/react-essentials#third-party-packages
There was a problem hiding this comment.
The issue is, tsup used here to bundle does not honor 'use client' placement at the top of the file.
So that's why i propose to remove it, since it's not packaged correctly
use clienton lib level, this is app responsibility