Skip to content

feat(remix): Add Vite support. - #495

Merged
Lms24 merged 6 commits into
masterfrom
onur/remix-vite-support
Nov 17, 2023
Merged

Lms24 merged 6 commits into
masterfrom
onur/remix-vite-support

Conversation

@onurtemizkan

@onurtemizkan onurtemizkan commented Nov 13, 2023 •

Copy link
Copy Markdown
Contributor

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.

@github-actions

github-actions Bot commented Nov 13, 2023 •

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

Generated by 🚫 dangerJS against 8ee9afa

@Lms24 Lms24 left a comment

Copy link
Copy Markdown
Member

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 thread src/remix/sdk-setup.ts Outdated
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
Copy Markdown
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
Copy Markdown
Contributor 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 thread src/remix/sdk-setup.ts Outdated
Comment on lines +64 to +65
childProcess.execSync(REMIX_REVEAL_COMMAND, {
stdio: 'inherit',

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated 👍 -> a184b9f

Comment thread src/remix/sdk-setup.ts Outdated
Comment on lines +64 to +65
childProcess.execSync(REMIX_REVEAL_COMMAND, {
stdio: 'inherit',

Copy link
Copy Markdown
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
Copy Markdown
Contributor 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
Copy Markdown
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
Copy Markdown
Contributor 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.

@Lms24 Lms24 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great, LGTM now, thanks!

@Lms24 Lms24 left a comment

Copy link
Copy Markdown
Member

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
@Lms24
Lms24 deleted the onur/remix-vite-support branch November 17, 2023 10:11
@Lms24 Lms24 mentioned this pull request Nov 17, 2023
2 of 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