Skip to content

Commit

Permalink
Merge branch 'dev' into pedro/allow-any-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
pcattori authored Aug 9, 2023
2 parents 5894f13 + fc8a3e2 commit 6ffeaf2
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .changeset/lovely-drinks-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": patch
---

allow jsx in js files during hmr
2 changes: 1 addition & 1 deletion packages/remix-dev/__tests__/utils/withApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ export default async <Result>(
// errors when attempting to removing the temporary directory.
// Retrying a couple times seems to get it to succeed.
// See https://github.com/jprichardson/node-fs-extra/issues?q=EBUSY%3A+resource+busy+or+locked%2C+rmdir
retry(async () => await fse.remove(TEMP_DIR), 3, 200);
await retry(async () => await fse.remove(TEMP_DIR), 3, 200);
}
};
2 changes: 1 addition & 1 deletion packages/remix-dev/cli/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export async function watch(
: await readConfig(remixRootOrConfig);

let resolved = await resolveDev(config);
devServer.liveReload(config, resolved);
void devServer.liveReload(config, resolved);
return await new Promise(() => {});
}

Expand Down
2 changes: 1 addition & 1 deletion packages/remix-dev/compiler/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export let create = async (ctx: Context): Promise<Compiler> => {
if (error === undefined) {
error = thrown;
}
cancel();
void cancel();
return err(thrown);
};

Expand Down
2 changes: 1 addition & 1 deletion packages/remix-dev/compiler/fileWatchCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export function createFileWatchCache(): FileWatchCache {
): Promise<CacheValue<T>> {
promiseForCacheKey.set(key, promise);

promise
void promise
.catch(() => {
// Swallow errors to prevent the build from crashing and remove the
// rejected promise from the cache so consumers can retry
Expand Down
2 changes: 1 addition & 1 deletion packages/remix-dev/compiler/js/plugins/hmr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ declare global {
sourceCode,
output: {
contents: resultCode,
loader: args.path.endsWith("x") ? "tsx" : "ts",
loader: "tsx",
resolveDir: path.dirname(args.path),
},
};
Expand Down
4 changes: 2 additions & 2 deletions packages/remix-dev/compiler/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export async function watch(

let restart = debounce(async () => {
let start = Date.now();
compiler.dispose();
void compiler.dispose();

try {
ctx.config = await reloadConfig(ctx.config.rootDirectory);
Expand Down Expand Up @@ -130,6 +130,6 @@ export async function watch(

return async () => {
await watcher.close().catch(() => undefined);
compiler.dispose();
void compiler.dispose();
};
}
10 changes: 6 additions & 4 deletions packages/remix-react/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,13 @@ function useKeyedPrefetchLinks(matches: AgnosticDataRouteMatch[]) {
React.useEffect(() => {
let interrupted: boolean = false;

getKeyedPrefetchLinks(matches, manifest, routeModules).then((links) => {
if (!interrupted) {
setKeyedPrefetchLinks(links);
void getKeyedPrefetchLinks(matches, manifest, routeModules).then(
(links) => {
if (!interrupted) {
setKeyedPrefetchLinks(links);
}
}
});
);

return () => {
interrupted = true;
Expand Down
2 changes: 1 addition & 1 deletion packages/remix-react/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export async function parseDeferredReadableStream(
}

// Read the rest of the stream and resolve deferred promises
(async () => {
void (async () => {
try {
for await (let section of sectionReader) {
// Determine event type and data
Expand Down
2 changes: 1 addition & 1 deletion packages/remix-serve/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ let onListen = () => {
);
}
if (process.env.NODE_ENV === "development") {
broadcastDevReady(build);
void broadcastDevReady(build);
}
};

Expand Down

0 comments on commit 6ffeaf2

Please sign in to comment.