-
-
Notifications
You must be signed in to change notification settings - Fork 49
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): Added Spotlight option in server config #547
base: master
Are you sure you want to change the base?
feat(Remix): Added Spotlight option in server config #547
Conversation
src/remix/sdk-setup.ts
Outdated
// uncomment the line below to enable Spotlight (https://spotlightjs.com) | ||
// spotlight: process.env.NODE_ENV === 'development', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tested this in a Remix application? I don't think this works as you'd expect. Unless I'm missing something, this is a pure code comment and won't be picked up by the function call builder that generates the AST for the Sentry.init call.
If you tested this and things work, please disregard the rest of this comment :)
It's very closely related to what I wrote in #546 about AST manipulation. Maybe we need to find a way to make this work rather sooner than later.
What I was trying to do earlier when reviewing #546 was using a recast builder to manually build the AST. It allows me to insert comments into an AST node like the options object. If you wanna take a look at this, we already do stuff like this in ast-utils.ts
: https://github.com/Shubhdeep12/sentry-wizard/blob/088ffb2452d0a7a00521282a3f5de59d53d2d832/src/utils/ast-utils.ts#L121-L152
Maybe we can use this here, too. So basically change the magiacst builder to a recast.types.builder
and manually construct things. But we have to find a way to preserve code formatting (as well as possible) when the code is generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, looks like magicast builder is removing the comments. my bad, I think I missed checking this.
let me try the suggested sol.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Lms24 not sure if we can add comments in objects in recast too using builder functions.
But with magicast and recast, there is this way to add comments viz. writing code itself instead of the builder function.
I tried to put the code directly and then parsed it. It's working fine and not removing the comments now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Shubhdeep12 yup, if that gets the job done, let's do it 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pushed the fix @Lms24
Added comment to add spotlight in Sentry.init for remix server config
Note: We did not include the installation and setup of Spotlight because it is not added by default, and it is also not mandatory.
#535