diff --git a/src/desktop/apps/conversations/client.tsx b/src/desktop/apps/conversations/client.tsx deleted file mode 100644 index 454d52f6dfd..00000000000 --- a/src/desktop/apps/conversations/client.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { buildClientApp } from "v2/Artsy/Router/client" -import { data as sd } from "sharify" -import { conversationRoutes } from "v2/Apps/Conversation/routes" -import React from "react" -import ReactDOM from "react-dom" -import { loadableReady } from "@loadable/component" - -const mediator = require("desktop/lib/mediator.coffee") - -buildClientApp({ - routes: conversationRoutes, - context: { - user: sd.CURRENT_USER, - mediator, - } as any, -}) - .then(({ ClientApp }) => { - loadableReady(() => { - ReactDOM.hydrate(, document.getElementById("react-root")) - }) - }) - .catch(error => { - console.error(error) - }) - -if (module.hot) { - module.hot.accept() -} diff --git a/src/desktop/apps/conversations/server.tsx b/src/desktop/apps/conversations/server.tsx deleted file mode 100644 index 46bf050b532..00000000000 --- a/src/desktop/apps/conversations/server.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import { buildServerApp } from "v2/Artsy/Router/server" -import { stitch } from "@artsy/stitch" -import { conversationRoutes } from "v2/Apps/Conversation/routes" -import React from "react" -import { buildServerAppContext } from "desktop/lib/buildServerAppContext" -import express, { Request, Response, NextFunction } from "express" - -export const app = express() - -app.get( - "/user/conversations*", - async (req: Request, res: Response, next: NextFunction) => { - try { - const { - bodyHTML, - redirect, - status, - headTags, - styleTags, - scripts, - } = await buildServerApp({ - context: buildServerAppContext(req, res), - routes: conversationRoutes, - url: req.url, - userAgent: req.header("User-Agent"), - }) - - if (redirect) { - res.redirect(302, redirect.url) - return - } - - // Render layout - const layout = await stitch({ - basePath: __dirname, - layout: "../../components/main_layout/templates/react_redesign.jade", - blocks: { - head: () => {headTags}, - body: bodyHTML, - }, - locals: { - ...res.locals, - assetPackage: "conversations", - scripts, - styleTags, - }, - }) - - res.status(status).send(layout) - } catch (error) { - next(error) - } - } -) diff --git a/src/desktop/apps/purchases/client.tsx b/src/desktop/apps/purchases/client.tsx deleted file mode 100644 index 3b816e1bc1a..00000000000 --- a/src/desktop/apps/purchases/client.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { buildClientApp } from "v2/Artsy/Router/client" -import { data as sd } from "sharify" -import { routes } from "v2/Apps/Purchase/routes" -import React from "react" -import ReactDOM from "react-dom" -import { setupArtistSignUpModal } from "desktop/components/artistSignupModal/artistSignupModal" - -const mediator = require("desktop/lib/mediator.coffee") - -buildClientApp({ - routes, - context: { - user: sd.CURRENT_USER, - mediator, - } as any, -}) - .then(({ ClientApp }) => { - ReactDOM.hydrate( - , - document.getElementById("react-root"), - () => { - setupArtistSignUpModal() - } - ) - }) - .catch(error => { - console.error(error) - }) - -if (module.hot) { - module.hot.accept() -} diff --git a/src/desktop/apps/purchases/server.tsx b/src/desktop/apps/purchases/server.tsx deleted file mode 100644 index dd697500a50..00000000000 --- a/src/desktop/apps/purchases/server.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import { buildServerApp } from "v2/Artsy/Router/server" -import { stitch } from "@artsy/stitch" -import { routes } from "v2/Apps/Purchase/routes" -import React from "react" -import { buildServerAppContext } from "desktop/lib/buildServerAppContext" -import express, { Request, Response, NextFunction } from "express" - -export const app = express() - -app.get( - "/user/purchases", - async (req: Request, res: Response, next: NextFunction) => { - try { - const context = buildServerAppContext(req, res, {}) - const { - bodyHTML, - redirect, - status, - headTags, - styleTags, - scripts, - } = await buildServerApp({ - routes, - url: req.url, - userAgent: req.header("User-Agent"), - context, - }) - - if (redirect) { - res.redirect(302, redirect.url) - return - } - - // Render layout - const layout = await stitch({ - basePath: __dirname, - layout: "../../components/main_layout/templates/react_redesign.jade", - blocks: { - head: () => {headTags}, - body: bodyHTML, - }, - locals: { - ...res.locals, - assetPackage: "purchases", - scripts, - styleTags, - }, - }) - - res.status(status).send(layout) - } catch (error) { - next(error) - } - } -) diff --git a/src/desktop/index.ts b/src/desktop/index.ts index 8a946ee4ce0..03b1a42f926 100644 --- a/src/desktop/index.ts +++ b/src/desktop/index.ts @@ -26,9 +26,7 @@ app.use(require("./apps/auctions")) app.use(require("./apps/auctions2").app) app.use(require("./apps/auction_lots")) -// TODO: Remove after AB test ends. -app.use(require("./apps/purchases/server").app) -app.use(require("./apps/conversations/server").app) +// FIXME: Remove once JSONPage + new app shell is worked out app.use(require("./apps/art_keeps_going/server").app) app.use(require("./apps/artists")) diff --git a/src/v2/Apps/Conversation/Routes/Conversation/index.tsx b/src/v2/Apps/Conversation/Routes/Conversation/index.tsx index 8cc613eae1a..92b493b467b 100644 --- a/src/v2/Apps/Conversation/Routes/Conversation/index.tsx +++ b/src/v2/Apps/Conversation/Routes/Conversation/index.tsx @@ -80,5 +80,3 @@ export const ConversationFragmentContainer = createFragmentContainer( `, } ) - -export default ConversationFragmentContainer diff --git a/src/v2/Apps/Conversation/routes.tsx b/src/v2/Apps/Conversation/routes.tsx index f95e556bf9e..859e95db292 100644 --- a/src/v2/Apps/Conversation/routes.tsx +++ b/src/v2/Apps/Conversation/routes.tsx @@ -1,6 +1,7 @@ import loadable from "@loadable/component" import { RouteConfig } from "found" import { graphql } from "react-relay" +import { ConversationFragmentContainer as ConversationRoute } from "./Routes/Conversation" export const conversationRoutes: RouteConfig[] = [ { @@ -26,7 +27,7 @@ export const conversationRoutes: RouteConfig[] = [ { path: "/user/conversations/:conversationID", displayFullPage: true, - getComponent: () => loadable(() => import("./Routes/Conversation")), + Component: ConversationRoute, prepareVariables: (params, _props) => { return { conversationID: params.conversationID, diff --git a/src/v2/Apps/getAppRoutes.tsx b/src/v2/Apps/getAppRoutes.tsx index 8ad532cba2c..7d4a6fe272a 100644 --- a/src/v2/Apps/getAppRoutes.tsx +++ b/src/v2/Apps/getAppRoutes.tsx @@ -6,6 +6,7 @@ import { collectRoutes } from "v2/Apps/Collect/collectRoutes" import { conversationRoutes } from "v2/Apps/Conversation/routes" import { routes as identityVerificationRoutes } from "v2/Apps/IdentityVerification/routes" import { routes as orderRoutes } from "v2/Apps/Order/routes" +import { routes as purchasesRoutes } from "v2/Apps/Purchase/routes" import { routes as searchRoutes } from "v2/Apps/Search/routes" import { routes as viewingRoomRoutes } from "./ViewingRoom/routes" @@ -29,6 +30,9 @@ export function getAppRoutes(): RouteConfig[] { { routes: orderRoutes, }, + { + routes: purchasesRoutes, + }, { routes: searchRoutes, },