Skip to content

Commit

Permalink
Single deprecation warning per remix index file
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Nov 21, 2022
1 parent 01f5ba5 commit 7774492
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/remix-dev/cli/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,16 @@ async function combineFilesInDirs(
dirs: string[],
ext: string
): Promise<string> {
let combined = "";
let logDeprecationWarning =
`console.warn("WARNING: All \`remix\` exports are considered deprecated as of v1.3.3. ` +
`All imports should come from their respective packages (i.e., ` +
`\`@remix-run/server-runtime\`, \`@remix-run/react\`, etc.). ` +
`Run \`npx @remix-run/dev@latest codemod replace-remix-magic-imports\` to ` +
`automatically migrate your code.");\n\n`;

// Don't include the warning in type declarations
let combined = ext === ".d.ts" ? "" : logDeprecationWarning;

for (let dir of dirs) {
let files = await fse.readdir(dir);
for (let file of files) {
Expand Down

0 comments on commit 7774492

Please sign in to comment.