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

Vite Support #227

Open
BennyAlex opened this issue Apr 13, 2023 · 6 comments
Open

Vite Support #227

BennyAlex opened this issue Apr 13, 2023 · 6 comments
Assignees

Comments

@BennyAlex
Copy link

@theKashey Hello,

I want to know how to use this libary with vite? (Without SSR)

Since there is no babel I cant use the babel plugin, so is this libary not working with vite? (And therefore not bundler independent?)

Thanks, have a good day.

@theKashey
Copy link
Owner

😃 yeah, independent from a bundler, but not from babel 🤷‍♂️

In any case - babel is not required for anything NOT involving SSR, and you've said you don't have it.
The responsibility of babel is to "inline" filenames and might name webpack chunks via magic comments to communicate what was done during SSR and shall be redone on the client. One can easily replicate the same via rollup plugin (especially if rollup plugin can just call a babel one)

So, let me be honest, I never tried imported with Vite. Is it working? Is it not?

@BennyAlex
Copy link
Author

I can try it. Is there any config need than or do I just install the package and use the imports?

@theKashey
Copy link
Owner

Just using should be fine. Marks are important only for hydration phase, later they are used only as fallback - https://github.com/theKashey/react-imported-component/blob/master/src/loadable/loadable.ts#L43

@theKashey theKashey self-assigned this Jun 1, 2023
@PawanKolhe
Copy link

PawanKolhe commented May 10, 2024

Hey @theKashey. We are using react-imported-component in our app (with Vite bundler) without SSR (clIent side SPA only). Do I need to worry about the warning about no mark found in the browser console?

Screenshot 2024-05-10 at 8 05 16 AM

@theKashey
Copy link
Owner

Without SSR marks are not important and I might need to provide a way to suppress this error after hydration as it only creates noise

@PawanKolhe
Copy link

@theKashey Right. The warnings are creating a lot of noise in the console. A way to suppress them would be very helpful.

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

3 participants