Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: bring deno fixture template in line with actual template #3229

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
**/__tests__/fixtures

# deno
integration/helpers/deno-template
packages/remix-deno
templates/deno
5 changes: 3 additions & 2 deletions integration/helpers/deno-template/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/node_modules/
node_modules

/.cache
/build
/public/build
/public/build
.env
6 changes: 3 additions & 3 deletions integration/helpers/deno-template/app/entry.client.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import ReactDOM from "react-dom";
import { RemixBrowser } from "@remix-run/react";
import * as React from "react";
import { hydrate } from "react-dom";

ReactDOM.hydrate(<RemixBrowser />, document);
hydrate(<RemixBrowser />, document);
12 changes: 6 additions & 6 deletions integration/helpers/deno-template/app/entry.server.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React from "react";
import { renderToString } from "react-dom/server";
import { RemixServer } from "@remix-run/react";
import type { EntryContext } from "@remix-run/deno";
import { RemixServer } from "@remix-run/react";
import * as React from "react";
import { renderToString } from "react-dom/server";

export default function handleRequest(
request: Request,
responseStatusCode: number,
responseHeaders: Headers,
remixContext: EntryContext
remixContext: EntryContext,
) {
let markup = renderToString(
<RemixServer context={remixContext} url={request.url} />
const markup = renderToString(
<RemixServer context={remixContext} url={request.url} />,
);

responseHeaders.set("Content-Type", "text/html");
Expand Down
4 changes: 2 additions & 2 deletions integration/helpers/deno-template/app/root.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import type { MetaFunction } from "@remix-run/deno";
import {
Links,
LiveReload,
Expand All @@ -7,7 +7,7 @@ import {
Scripts,
ScrollRestoration,
} from "@remix-run/react";
import type { MetaFunction } from "@remix-run/deno";
import * as React from "react";

export const meta: MetaFunction = () => ({
charset: "utf-8",
Expand Down
10 changes: 5 additions & 5 deletions integration/helpers/deno-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"private": true,
"sideEffects": false,
"dependencies": {
"@remix-run/deno": "*",
"@remix-run/react": "*",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"@remix-run/deno": "0.0.0-local-version",
"@remix-run/react": "0.0.0-local-version",
"react": "0.0.0-local-version",
"react-dom": "0.0.0-local-version"
},
"devDependencies": {
"@remix-run/dev": "*"
"@remix-run/dev": "0.0.0-local-version"
},
"engines": {
"node": ">=14"
Expand Down
6 changes: 5 additions & 1 deletion integration/helpers/deno-template/remix.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
module.exports = {
serverBuildTarget: "deno",
server: "./server.ts",

/*
If live reload causes page to re-render without changes (live reload is too fast),
increase the dev server broadcast delay.

If live reload seems slow, try to decrease the dev server broadcast delay.
*/
devServerBroadcastDelay: 300,
ignoredRouteFiles: ["**/.*"],
// appDirectory: "app",
// assetsBuildDirectory: "public/build",
// serverBuildPath: "build/index.js",
// publicPath: "/build/",
};