Skip to content

Commit

Permalink
feat(remix-dev): show deprecation warning when serverBuildDirectory
Browse files Browse the repository at this point in the history
… config is used (#5704)
  • Loading branch information
MichaelDeBoey authored Mar 15, 2023
1 parent 6d0a298 commit 4b70f9f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/wild-beers-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": minor
---

show deprecation warning when `serverBuildDirectory` config is used
26 changes: 22 additions & 4 deletions packages/remix-dev/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,8 @@ const resolveServerBuildPath = (

// retain deprecated behavior for now
if (appConfig.serverBuildDirectory) {
warnOnce(serverBuildDirectoryWarning, "serverBuildDirectory");

serverBuildPath = path.join(appConfig.serverBuildDirectory, "index.js");
}

Expand All @@ -743,10 +745,26 @@ let listFormat = new Intl.ListFormat("en", {
type: "conjunction",
});

export let browserBuildDirectoryWarning = `⚠️ DEPRECATED: The \`browserBuildDirectory\` config option is deprecated. Use \`assetsBuildDirectory\` instead.`;
export let serverBuildTargetWarning = `⚠️ DEPRECATED: The \`serverBuildTarget\` config option is deprecated. Use a combination of \`publicPath\`, \`serverBuildPath\`, \`serverConditions\`, \`serverDependenciesToBundle\`, \`serverMainFields\`, \`serverMinify\`, \`serverModuleFormat\` and/or \`serverPlatform\` instead.`;

export let flatRoutesWarning = `⚠️ DEPRECATED: The old nested folders route convention has been deprecated in favor of "flat routes". Please enable the new routing convention via the \`future.v2_routeConvention\` flag in your \`remix.config.js\` file. For more information, please see https://remix.run/docs/en/main/file-conventions/route-files-v2.`;
export let browserBuildDirectoryWarning =
"⚠️ DEPRECATED: The `browserBuildDirectory` config option is deprecated. " +
"Use `assetsBuildDirectory` instead.";

export let serverBuildDirectoryWarning =
"⚠️ DEPRECATED: The `serverBuildDirectory` config option is deprecated. " +
"Use `serverBuildPath` instead.";

export let serverBuildTargetWarning =
"⚠️ DEPRECATED: The `serverBuildTarget` config option is deprecated. Use a " +
"combination of `publicPath`, `serverBuildPath`, `serverConditions`, " +
"`serverDependenciesToBundle`, `serverMainFields`, `serverMinify`, " +
"`serverModuleFormat` and/or `serverPlatform` instead.";

export let flatRoutesWarning =
"⚠️ DEPRECATED: The old nested folders route convention has been " +
"deprecated in favor of 'flat routes'. Please enable the new routing " +
"convention via the `future.v2_routeConvention` flag in your " +
"`remix.config.js` file. For more information, please see " +
"https://remix.run/docs/en/main/file-conventions/route-files-v2.";

export const errorBoundaryWarning =
"⚠️ DEPRECATED: The separation of `CatchBoundary` and `ErrorBoundary` has " +
Expand Down

0 comments on commit 4b70f9f

Please sign in to comment.