-
Notifications
You must be signed in to change notification settings - Fork 41
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: manual-edits.json file added to dropdown #134
Conversation
imrishabh18
commented
Oct 29, 2024
![Screenshot 2024-10-29 at 5 07 07 PM](https://private-user-images.githubusercontent.com/38923768/381106171-3e48111e-e93a-45f7-8a9c-aa9b8dd518c7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4MzIxNTksIm5iZiI6MTczODgzMTg1OSwicGF0aCI6Ii8zODkyMzc2OC8zODExMDYxNzEtM2U0ODExMWUtZTkzYS00NWY3LThhOWMtYWE5YjhkZDUxOGM3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA2VDA4NTA1OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTc4NWM2MzFmYTM4Zjk1M2ZjMGFjM2YyODFiMzk1ZDcyNTIxMTZmZWY1OGNiZjEzZDU1NjliZmRjNjJlMjdmYmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.k3T14to0LZQOve8lT9GhboCXtid8mrtkpgw2r75LCdE)
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
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.
Note before merging: there is an important change that will break production with the apiUrl, make sure to revert that line!
Look good, i think more code is now in CodeEditor when our goal should be to reduce the size of CodeEditor since its so complex. Could we make the CodeEditorHeader a separate component to hopefully start to break down that massive component?
src/components/CodeEditor.tsx
Outdated
@@ -93,10 +117,9 @@ export const CodeEditor = ({ | |||
const pathInPackage = fullPackageName.split("/").slice(1).join("/") | |||
const jsdelivrPath = `${packageName}${pathInPackage ? `/${pathInPackage}` : ""}` | |||
return fetch( | |||
`${apiUrl}/snippets/download?jsdelivr_resolve=${input.includes("/resolve/")}&jsdelivr_path=${encodeURIComponent(jsdelivrPath)}`, | |||
`/snippets/download?jsdelivr_resolve=${input.includes("/resolve/")}&jsdelivr_path=${encodeURIComponent(jsdelivrPath)}`, |
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.
This apiUrl is important, without it production wont go to the right server
src/components/CodeEditor.tsx
Outdated
}) | ||
} | ||
} | ||
}, [code]) | ||
}, [files, currentFile]) |
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.
I think we should probably keep this the same, we could also make "code = files["index.tsx"]
}, [files, currentFile]) | |
}, [files["index.tsx"]]) |
This code sometimes can cause the cursor to jump while editing if it fires too often, or typescript to not be typechecked if it fires late
src/components/CodeEditor.tsx
Outdated
if (ataRef.current) { | ||
ataRef.current(code) | ||
if (ataRef.current && currentFile === "index.tsx") { | ||
ataRef.current(`${DEFAULT_IMPORTS}${files["index.tsx"]}`) |
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.
I think we should keep the "code" alias to simplify the diff imo
Another random note, this code can be a bit sensitive to changes, so definitely test stuff like editing code and making sure new typescript imports are recognized and dynamically imported etc. also that the cursor is stable when editing. We could potentially incorporate that into a playwright test later |
Editing and formatting, both are looking good. Screen.Recording.2024-10-29.at.8.23.26.PM.mov |