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

feat(remix): Add Vite support. #495

Merged
merged 6 commits into from
Nov 17, 2023
Merged

feat(remix): Add Vite support. #495

merged 6 commits into from
Nov 17, 2023

Conversation

onurtemizkan
Copy link
Collaborator

@onurtemizkan onurtemizkan commented Nov 13, 2023

Resolves: #487

Adds Vite sourcemaps upload support to Remix wizard.

Also:

  • Runs npx run reveal when entry.client / entry.server files do not exist in the project.
  • Fixes a bug (using project.name instead of project.slug) while populating build upload script with the project argument.

Copy link

github-actions bot commented Nov 13, 2023

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 8ee9afa

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

This looks good, thank you Onur!

Just have a couple of small comments.

Also one question: I saw that the "remix reveal" command adds some stuff to the server entry file around handling bot vs human requests. Is this what's present if there was no entry file at all (aka the sensible defaults they talk about) or is this something in addition? I just want to make sure that people do not confuse this with Sentry-relevant code.

Comment on lines 70 to 86
export async function modifyViteConfig(
selectedProject: {
organization: { slug: string };
slug: string;
},
sentryUrl: string,
authToken: string,
selfHosted: boolean,
): Promise<void> {
await configureVitePlugin({
orgSlug: selectedProject.organization.slug,
projectSlug: selectedProject.slug,
url: sentryUrl,
selfHosted,
authToken,
});
}
Copy link
Member

Choose a reason for hiding this comment

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

l: Can we just directly call configureVitePlugin? Maybe I missed something but looks like we only call this once. WDYT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, makes sense 👍 updated -> 177ab2b

Comment on lines 64 to 65
childProcess.execSync(REMIX_REVEAL_COMMAND, {
stdio: 'inherit',
Copy link
Member

Choose a reason for hiding this comment

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

l: Can we pipe the output from the command and wrap it in a clack call? Currently this somewhat breaks the UI:
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated 👍 -> a184b9f

Comment on lines 64 to 65
childProcess.execSync(REMIX_REVEAL_COMMAND, {
stdio: 'inherit',
Copy link
Member

Choose a reason for hiding this comment

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

I don't know how remix reveal works but should we check for the return value or try/catch it? Just to ensure we don't crash but e.g. link to the manual setup if something goes wrong.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is handled on the remix-wizard.ts. This will throw on any non-zero exit code, which will be caught on the upper level.

Copy link
Member

Choose a reason for hiding this comment

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

Ohh right, I missed this, thanks!

@onurtemizkan
Copy link
Collaborator Author

I saw that the "remix reveal" command adds some stuff to the server entry file around handling bot vs human requests. Is this what's present if there was no entry file at all (aka the sensible defaults they talk about) or is this something in addition? I just want to make sure that people do not confuse this with Sentry-relevant code.

As far as I know, those are also a part of their sensible defaults. I have seen them on default Remix application templates too.

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Great, LGTM now, thanks!

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Oh, please add an entry to CHANGELOG.md under the ## Unreleased section.

@Lms24 Lms24 merged commit 2d5b8f8 into master Nov 17, 2023
10 checks passed
@Lms24 Lms24 deleted the onur/remix-vite-support branch November 17, 2023 10:11
@Lms24 Lms24 mentioned this pull request Nov 17, 2023
3 tasks
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.

Update Wizard for Vite in Remix 2.2
2 participants