diff --git a/static/js/publisher/pages/Releases/components/channelMenu.js b/static/js/publisher/pages/Releases/components/channelMenu.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/channelMenu.js rename to static/js/publisher/pages/Releases/components/channelMenu.jsx diff --git a/static/js/publisher/pages/Releases/components/contextualMenu.js b/static/js/publisher/pages/Releases/components/contextualMenu.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/contextualMenu.js rename to static/js/publisher/pages/Releases/components/contextualMenu.jsx diff --git a/static/js/publisher/pages/Releases/components/defaultTrackModifier.js b/static/js/publisher/pages/Releases/components/defaultTrackModifier.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/defaultTrackModifier.js rename to static/js/publisher/pages/Releases/components/defaultTrackModifier.jsx diff --git a/static/js/publisher/pages/Releases/components/historyIcon.js b/static/js/publisher/pages/Releases/components/historyIcon.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/historyIcon.js rename to static/js/publisher/pages/Releases/components/historyIcon.jsx diff --git a/static/js/publisher/pages/Releases/components/historyPanel.js b/static/js/publisher/pages/Releases/components/historyPanel.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/historyPanel.js rename to static/js/publisher/pages/Releases/components/historyPanel.jsx diff --git a/static/js/publisher/pages/Releases/components/modal.js b/static/js/publisher/pages/Releases/components/modal.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/modal.js rename to static/js/publisher/pages/Releases/components/modal.jsx diff --git a/static/js/publisher/pages/Releases/components/notification.js b/static/js/publisher/pages/Releases/components/notification.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/notification.js rename to static/js/publisher/pages/Releases/components/notification.jsx diff --git a/static/js/publisher/pages/Releases/components/progressiveBar.js b/static/js/publisher/pages/Releases/components/progressiveBar.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/progressiveBar.js rename to static/js/publisher/pages/Releases/components/progressiveBar.jsx diff --git a/static/js/publisher/pages/Releases/components/progressiveBarControl.js b/static/js/publisher/pages/Releases/components/progressiveBarControl.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/progressiveBarControl.js rename to static/js/publisher/pages/Releases/components/progressiveBarControl.jsx diff --git a/static/js/publisher/pages/Releases/components/progressiveConfirm.js b/static/js/publisher/pages/Releases/components/progressiveConfirm.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/progressiveConfirm.js rename to static/js/publisher/pages/Releases/components/progressiveConfirm.jsx diff --git a/static/js/publisher/pages/Releases/components/releasesConfirmActions.js b/static/js/publisher/pages/Releases/components/releasesConfirmActions.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/releasesConfirmActions.js rename to static/js/publisher/pages/Releases/components/releasesConfirmActions.jsx diff --git a/static/js/publisher/pages/Releases/components/releasesConfirmDetails/cancelProgressiveRow.js b/static/js/publisher/pages/Releases/components/releasesConfirmDetails/cancelProgressiveRow.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/releasesConfirmDetails/cancelProgressiveRow.js rename to static/js/publisher/pages/Releases/components/releasesConfirmDetails/cancelProgressiveRow.jsx diff --git a/static/js/publisher/pages/Releases/components/releasesConfirmDetails/closeChannelsRow.js b/static/js/publisher/pages/Releases/components/releasesConfirmDetails/closeChannelsRow.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/releasesConfirmDetails/closeChannelsRow.js rename to static/js/publisher/pages/Releases/components/releasesConfirmDetails/closeChannelsRow.jsx diff --git a/static/js/publisher/pages/Releases/components/releasesConfirmDetails/index.js b/static/js/publisher/pages/Releases/components/releasesConfirmDetails/index.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/releasesConfirmDetails/index.js rename to static/js/publisher/pages/Releases/components/releasesConfirmDetails/index.jsx diff --git a/static/js/publisher/pages/Releases/components/releasesConfirmDetails/releaseRow.js b/static/js/publisher/pages/Releases/components/releasesConfirmDetails/releaseRow.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/releasesConfirmDetails/releaseRow.js rename to static/js/publisher/pages/Releases/components/releasesConfirmDetails/releaseRow.jsx diff --git a/static/js/publisher/pages/Releases/components/releasesConfirmDetails/releaseRowGroup.js b/static/js/publisher/pages/Releases/components/releasesConfirmDetails/releaseRowGroup.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/releasesConfirmDetails/releaseRowGroup.js rename to static/js/publisher/pages/Releases/components/releasesConfirmDetails/releaseRowGroup.jsx diff --git a/static/js/publisher/pages/Releases/components/releasesHeading.js b/static/js/publisher/pages/Releases/components/releasesHeading.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/releasesHeading.js rename to static/js/publisher/pages/Releases/components/releasesHeading.jsx diff --git a/static/js/publisher/pages/Releases/components/releasesTable/cellViews.js b/static/js/publisher/pages/Releases/components/releasesTable/cellViews.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/releasesTable/cellViews.js rename to static/js/publisher/pages/Releases/components/releasesTable/cellViews.jsx diff --git a/static/js/publisher/pages/Releases/components/releasesTable/channelRow.js b/static/js/publisher/pages/Releases/components/releasesTable/channelRow.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/releasesTable/channelRow.js rename to static/js/publisher/pages/Releases/components/releasesTable/channelRow.jsx diff --git a/static/js/publisher/pages/Releases/components/releasesTable/index.js b/static/js/publisher/pages/Releases/components/releasesTable/index.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/releasesTable/index.js rename to static/js/publisher/pages/Releases/components/releasesTable/index.jsx diff --git a/static/js/publisher/pages/Releases/components/releasesTable/releaseCell.js b/static/js/publisher/pages/Releases/components/releasesTable/releaseCell.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/releasesTable/releaseCell.js rename to static/js/publisher/pages/Releases/components/releasesTable/releaseCell.jsx diff --git a/static/js/publisher/pages/Releases/components/releasesTable/releaseMenuItem.js b/static/js/publisher/pages/Releases/components/releasesTable/releaseMenuItem.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/releasesTable/releaseMenuItem.js rename to static/js/publisher/pages/Releases/components/releasesTable/releaseMenuItem.jsx diff --git a/static/js/publisher/pages/Releases/components/releasesTable/revisionCell.js b/static/js/publisher/pages/Releases/components/releasesTable/revisionCell.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/releasesTable/revisionCell.js rename to static/js/publisher/pages/Releases/components/releasesTable/revisionCell.jsx diff --git a/static/js/publisher/pages/Releases/components/releasesTable/revisionsRow.js b/static/js/publisher/pages/Releases/components/releasesTable/revisionsRow.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/releasesTable/revisionsRow.js rename to static/js/publisher/pages/Releases/components/releasesTable/revisionsRow.jsx diff --git a/static/js/publisher/pages/Releases/components/revisionLabel.js b/static/js/publisher/pages/Releases/components/revisionLabel.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/revisionLabel.js rename to static/js/publisher/pages/Releases/components/revisionLabel.jsx diff --git a/static/js/publisher/pages/Releases/components/revisionsList.js b/static/js/publisher/pages/Releases/components/revisionsList.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/revisionsList.js rename to static/js/publisher/pages/Releases/components/revisionsList.jsx diff --git a/static/js/publisher/pages/Releases/components/revisionsListRow.js b/static/js/publisher/pages/Releases/components/revisionsListRow.jsx similarity index 100% rename from static/js/publisher/pages/Releases/components/revisionsListRow.js rename to static/js/publisher/pages/Releases/components/revisionsListRow.jsx diff --git a/static/js/publisher/pages/Releases/releasesController.js b/static/js/publisher/pages/Releases/releasesController.jsx similarity index 100% rename from static/js/publisher/pages/Releases/releasesController.js rename to static/js/publisher/pages/Releases/releasesController.jsx diff --git a/vite.config.js b/vite.config.js index 68e426e0c2..768f76d499 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,5 +1,5 @@ import react from "@vitejs/plugin-react-swc"; -import { defineConfig, loadEnv, transformWithEsbuild } from "vite"; +import { defineConfig, loadEnv } from "vite"; import autoprefixer from "autoprefixer"; import { execSync } from "node:child_process"; @@ -52,30 +52,10 @@ const flaskViteImportPlugin = () => ({ }, }); -/** - * Vite is opinionated and doesn't support JSX in .js files (and that's cool). - * This plugin makes it clear that we don't care about its opinions: process - * all .js files with esbuild as if they were .jsx. - * - * This has a small performance penalty compared to renaming the files, but - * for the moment it's fine and we can easily get rid of it later - */ -export const jsxInJsPlugin = () => ({ - name: "jsx-in-js", - async transform(code, id) { - if (!id.match(/\.js$/)) return null; - - return transformWithEsbuild(code, id, { - loader: "jsx", - jsx: "automatic", - }); - }, -}); - const env = loadEnv("all", process.cwd()); export default defineConfig({ - plugins: [flaskViteImportPlugin(), react(), jsxInJsPlugin()], + plugins: [flaskViteImportPlugin(), react()], server: { port: env?.VITE_PORT || 5173, host: true, diff --git a/vitest.config.js b/vitest.config.js index 6fe3e1bcb0..60be14e622 100644 --- a/vitest.config.js +++ b/vitest.config.js @@ -1,9 +1,8 @@ import { coverageConfigDefaults, defineConfig } from "vitest/config"; -import { jsxInJsPlugin } from "./vite.config"; export default defineConfig({ css: false, - plugins: [jsxInJsPlugin()], + plugins: [], test: { dir: "static/js", // base directory for tests globals: true, // inject global `vi` object in tests so we don't have to import it