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

Update sandboxes to use vite and typescript #9

Merged
merged 1 commit into from
Aug 9, 2023

Conversation

ChristianMurphy
Copy link
Member

@ChristianMurphy ChristianMurphy commented Aug 9, 2023

Initial checklist

  • I read the support docs
  • I read the contributing guide
  • I agree to follow the code of conduct
  • I searched issues and couldn’t find anything (or linked relevant results below)
  • If applicable, I’ve added docs and tests

Description of changes

the native dependencies in parcel no longer work in browser sandboxes like stackblitz
create react app has been (for all intents and purposes) deprecated by the react team
vite offers a replacement for both

also run sandboxes through typescript to catch potential issues with plugin compatibility and options.

temporary stackblitz links to test with:
https://stackblitz.com/github/ChristianMurphy/.github-remark/tree/migrate-sandboxes-to-vite/sandbox-templates/remark-with-vite
https://stackblitz.com/github/ChristianMurphy/.github-remark/tree/migrate-sandboxes-to-vite/sandbox-templates/remark-rehype-with-vite
https://stackblitz.com/github/ChristianMurphy/.github-remark/tree/migrate-sandboxes-to-vite/sandbox-templates/react-markdown-with-vite

CodeSandbox currently has issues with any repo with a . in it's name getting blocked by cloudflare or triggering a not authorized error.

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Aug 9, 2023
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"skipLibCheck": true
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 should be removed, currently it is blocked by rehypejs/rehype#147

"main": "src/main.tsx",
"type": "module",
"dependencies": {
"react": "^18.0.0",
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 also updates to React 18

@@ -48,7 +48,8 @@
"sandbox-templates/**/*.tsx"
],
"rules": {
"@typescript-eslint/naming-convention": "off"
"@typescript-eslint/naming-convention": "off",
"react/react-in-jsx-scope": "off"
Copy link
Member Author

Choose a reason for hiding this comment

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

the vite react transform does not require react in scope

Comment on lines +2 to +3
// eslint-disable-next-line n/file-extension-in-import
import ReactDOM from 'react-dom/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 lint rule will break the code by adding a .js extension.
react-dom/client is in the export map, react-dom/client.js is not a thing.

the native dependencies in parcel no longer work in browser sandboxes
like stackblitz
create react app has been (for all intents and purposes) deprecated by
the react team
vite offers a replacement for both

also run sandboxes through typescript to catch potential issues with
plugin compatibility and options.
@ChristianMurphy ChristianMurphy added 📚 area/docs This affects documentation 🏗 area/tools This affects tooling labels Aug 9, 2023
@wooorm wooorm changed the title update sandboxes to use vite and typescript Update sandboxes to use vite and typescript Aug 9, 2023
@wooorm wooorm merged commit 545e7e2 into remarkjs:main Aug 9, 2023
6 checks passed
@wooorm wooorm added the 💪 phase/solved Post is done label Aug 9, 2023
@github-actions

This comment has been minimized.

@github-actions github-actions bot removed the 🤞 phase/open Post is being triaged manually label Aug 9, 2023
@ChristianMurphy ChristianMurphy deleted the migrate-sandboxes-to-vite branch August 9, 2023 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 area/docs This affects documentation 🏗 area/tools This affects tooling 💪 phase/solved Post is done
Development

Successfully merging this pull request may close these issues.

2 participants