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

upgrade to vite #624

Merged
merged 2 commits into from
Feb 22, 2024
Merged

upgrade to vite #624

merged 2 commits into from
Feb 22, 2024

Conversation

kentcdodds
Copy link
Member

Comment on lines +25 to +30
// This is for server-side utilities you want to colocate next to
// your routes without making an additional directory.
// If you need a route that includes "server" or "client" in the
// filename, use the escape brackets like: my-route.[server].tsx
'**/*.server.*',
'**/*.client.*',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably the most significant change. It's the primary reason source code was changed. Remix with vite is more strict about your code that can end up in the client not using anything that's server-only so if you export anything other than the standard exports in a route that uses server-only code it'll error.

@kentcdodds kentcdodds merged commit 42cbbb7 into main Feb 22, 2024
4 checks passed
@kentcdodds kentcdodds deleted the vite branch February 22, 2024 15:56
export function loader({ request }: LoaderFunctionArgs) {
return generateSitemap(request, routes, {
export async function loader({ request, context }: LoaderFunctionArgs) {
const serverBuild = (await context.serverBuild) as ServerBuild
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was another interesting change because importing @remix-run/dev/server-build is not allowed in vite.

serverBuild: getBuild(),
}),
mode: MODE,
// @sentry/remix needs to be updated to handle the function signature
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Successfully merging this pull request may close these issues.

1 participant