Skip to content

Commit

Permalink
Quieter builds (#6058)
Browse files Browse the repository at this point in the history
This patch cleans up warnings we were seeing when doing a full build. Specifically:

- fixtures/remix-pages-app had a bunch of warnings about impending features that it should be upgraded to, so I did that. (tbh this one needs a full upgrade of packages, but we'll get to that later when we're upgrading across the codebase)
- updated `@microsoft/api-extractor` so it didn't complain that it didn't match the `typescript` version (that we'd recently upgraded)
- it also silenced a bunch of warnings when exporting types from `wrangler`. We'll need to fix those, but we'll do that when we work on unstable_dev etc.
- workers-playground was complaining about the size of the bundle being generated, so I increased the limit on it
  • Loading branch information
threepointone committed Jun 15, 2024
1 parent b20036c commit 31cd51f
Show file tree
Hide file tree
Showing 11 changed files with 209 additions and 137 deletions.
13 changes: 13 additions & 0 deletions .changeset/moody-papayas-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"miniflare": patch
"wrangler": patch
---

Quieter builds

This patch cleans up warnings we were seeing when doing a full build. Specifically:

- fixtures/remix-pages-app had a bunch of warnings about impending features that it should be upgraded to, so I did that. (tbh this one needs a full upgrade of packages, but we'll get to that later when we're upgrading across the codebase)
- updated `@microsoft/api-extractor` so it didn't complain that it didn't match the `typescript` version (that we'd recently upgraded)
- it also silenced a bunch of warnings when exporting types from `wrangler`. We'll need to fix those, but we'll do that when we work on unstable_dev etc.
- workers-playground was complaining about the size of the bundle being generated, so I increased the limit on it
4 changes: 2 additions & 2 deletions fixtures/remix-pages-app/app/entry.client.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RemixBrowser } from "@remix-run/react";
import { hydrate } from "react-dom";
import { hydrateRoot } from "react-dom/client";

hydrate(<RemixBrowser />, document);
hydrateRoot(document, <RemixBrowser />);
13 changes: 7 additions & 6 deletions fixtures/remix-pages-app/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import {
Scripts,
ScrollRestoration,
} from "@remix-run/react";
import type { MetaFunction } from "@remix-run/cloudflare";

export const meta: MetaFunction = () => ({
charset: "utf-8",
title: "New Remix App",
viewport: "width=device-width,initial-scale=1",
});
export const meta = () => {
return [
{ charset: "utf-8" },
{ title: "New Remix App" },
{ viewport: "width=device-width,initial-scale=1" },
];
};

export default function App() {
return (
Expand Down
16 changes: 15 additions & 1 deletion fixtures/remix-pages-app/remix.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
/** @type {import('@remix-run/dev').AppConfig} */
module.exports = {
serverBuildTarget: "cloudflare-pages",
publicPath: "/build/",
serverBuildPath: "functions/[[path]].js",
serverConditions: ["worker"],
serverMainFields: ["workerd", "browser", "module", "main"],
serverModuleFormat: "esm",
serverPlatform: "neutral",
serverDependenciesToBundle: "all",
serverMinify: true,
server: "./server.js",
devServerBroadcastDelay: 1000,
ignoredRouteFiles: ["**/.*"],
future: {
v2_errorBoundary: true,
v2_normalizeFormMethod: true,
v2_meta: true,
v2_headers: true,
v2_routeConvention: true,
},
// appDirectory: "app",
// assetsBuildDirectory: "public/build",
// serverBuildPath: "functions/[[path]].js",
Expand Down
2 changes: 1 addition & 1 deletion packages/miniflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"@ava/typescript": "^4.0.0",
"@cloudflare/kv-asset-handler": "workspace:*",
"@cloudflare/workers-types": "^4.20240605.0",
"@microsoft/api-extractor": "^7.36.3",
"@microsoft/api-extractor": "^7.47.0",
"@types/debug": "^4.1.7",
"@types/estree": "^1.0.0",
"@types/glob-to-regexp": "^0.4.1",
Expand Down
3 changes: 3 additions & 0 deletions packages/workers-playground/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@ export default defineConfig(({ mode }) => {

appType: "spa",
base: "/playground",
build: {
chunkSizeWarningLimit: 1000,
},
};
});
4 changes: 4 additions & 0 deletions packages/wrangler/api-extractor.json
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@
"default": {
"logLevel": "none"
// "addToApiReportFile": false
},
"ae-forgotten-export": {
"logLevel": "none",
"addToApiReportFile": true
}

// "ae-extra-release-tag": {
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"@cloudflare/workers-types": "^4.20240605.0",
"@cspotcode/source-map-support": "0.8.1",
"@iarna/toml": "^3.0.0",
"@microsoft/api-extractor": "^7.28.3",
"@microsoft/api-extractor": "^7.47.0",
"@sentry/node": "^7.86.0",
"@sentry/types": "^7.86.0",
"@sentry/utils": "^7.86.0",
Expand Down
3 changes: 0 additions & 3 deletions packages/wrangler/src/api/startDevWorker/DevEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ import type { Controller, RuntimeController } from "./BaseController";
import type { ErrorEvent } from "./events";
import type { DevWorker, StartDevWorkerOptions } from "./types";

/**
* @internal
*/
export class DevEnv extends EventEmitter {
config: ConfigController;
bundler: BundlerController;
Expand Down
Loading

0 comments on commit 31cd51f

Please sign in to comment.