Skip to content

Commit

Permalink
fixed server-only leak from material ui package
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-burel committed Sep 28, 2021
1 parent bd1de65 commit 9bf4c21
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
1 change: 0 additions & 1 deletion packages/@vulcanjs/next-material-ui/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * from "./emotion/createEmotionCache";
export * from "./getAppEnhancer";

export { default as Link } from "./components/Link";
export { default as NextMuiLink } from "./components/Link"; // recommanded alias to use
1 change: 1 addition & 0 deletions packages/@vulcanjs/next-material-ui/server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./server/getAppEnhancer";
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { AppSheetsCollector, Sheets } from "@vulcanjs/next-style-collector";

import createEmotionServer from "@emotion/server/create-instance";
// import theme from "/src/theme";
import { createEmotionCache } from "./emotion/createEmotionCache";
import { createEmotionCache } from "../emotion/createEmotionCache";

export const getAppEnhancer = (): AppSheetsCollector => {
const cache = createEmotionCache();
Expand Down
1 change: 1 addition & 0 deletions packages/@vulcanjs/webpack/extendWebpackConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const extendWebpackConfig = (environment) => (webpackConfig) => {
events: false,
path: false,
stream: false,
util: false,
};

withMagicImports(webpackConfig);
Expand Down
7 changes: 6 additions & 1 deletion src/lib/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ const i18nInstance = new I18N({
defaultLanguage: "en",
otherLanguages: ["fr"],
localeSubpaths: {},
localePath: path.resolve("./public/locales"),
// TODO: this code seems to run client-side
// to be improved when updating i18n
localePath:
typeof path.resolve === "function"
? path.resolve("./public/locales")
: "./public/locales",
});

// reexport everything
Expand Down
2 changes: 1 addition & 1 deletion src/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import theme from "~/lib/style/defaultTheme";
import {
getAppEnhancer as getMuiAppEnhancer,
//getMuiDocumentInitialProps,
} from "@vulcanjs/next-material-ui";
} from "@vulcanjs/next-material-ui/server";
import { i18nPropsFromCtx, DocumentLanguageProps } from "~/lib/i18n";

interface VNSDocumentProps {
Expand Down

0 comments on commit 9bf4c21

Please sign in to comment.