You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -58,7 +62,7 @@ export function action({ request }) {
58
62
}
59
63
```
60
64
61
-
The server build will contain the entire module in the final bundle. However, the client build will remove the loader and action, along with the dependencies, resulting in this:
65
+
The server build will contain the entire module in the final bundle. However, the client build will remove the headers, loader, and action, along with the dependencies, resulting in this:
62
66
63
67
```tsx filename=routes/settings.tsx
64
68
import { useLoaderData } from"@remix-run/react";
@@ -87,6 +91,6 @@ You can force code out of either the client or the server with the `*.client.tsx
87
91
88
92
While rare, sometimes server code makes it to client bundles because of how the compiler determines the dependencies of a route module, or because you accidentally try to use it in code that needs to ship to the client. You can force it out by adding `*.server.tsx` on the end of the file name.
89
93
90
-
For example, we could name a module `app/user.server.ts` instead of `app/user.ts` to ensure that the code in that module is never bundled into the client--even if you try to use it in the component.
94
+
For example, we could name a module `app/user.server.ts` instead of `app/user.ts` to ensure that the code in that module is never bundled into the client - even if you try to use it in the component.
91
95
92
-
Additionally, you may depend on client libraries that are unsafe to even bundle on the server--maybe it tries to access `window` by simply being imported. You can likewise remove these modules from the server build by appending `*.client.tsx` to the file name.
96
+
Additionally, you may depend on client libraries that are unsafe to even bundle on the server - maybe it tries to access `window` by simply being imported. You can likewise remove these modules from the server build by appending `*.client.tsx` to the file name.
0 commit comments