Skip to content

Commit c9cc830

Browse files
committed
Update template to use RR7 app template and Polaris web components
1 parent 8faaecd commit c9cc830

27 files changed

+714
-599
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
node_modules
22
build
33
public/build
4-
shopify-app-remix
54
*/*.yml
65
.shopify
Lines changed: 80 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,84 @@
1-
/** @type {import('@types/eslint').Linter.BaseConfig} */
1+
/**
2+
* This is intended to be a basic starting point for linting in your app.
3+
* It relies on recommended configs out of the box for simplicity, but you can
4+
* and should modify this configuration to best suit your team's needs.
5+
*/
6+
7+
/** @type {import('eslint').Linter.Config} */
28
module.exports = {
39
root: true,
4-
extends: [
5-
"@remix-run/eslint-config",
6-
"@remix-run/eslint-config/node",
7-
"@remix-run/eslint-config/jest-testing-library",
8-
"prettier",
9-
],
10-
globals: {
11-
shopify: "readonly"
10+
parserOptions: {
11+
ecmaVersion: "latest",
12+
sourceType: "module",
13+
ecmaFeatures: {
14+
jsx: true,
15+
},
16+
},
17+
env: {
18+
browser: true,
19+
commonjs: true,
20+
es6: true,
1221
},
22+
ignorePatterns: ["!**/.server", "!**/.client"],
23+
24+
// Base config
25+
extends: ["eslint:recommended"],
26+
27+
overrides: [
28+
// React
29+
{
30+
files: ["**/*.{js,jsx,ts,tsx}"],
31+
plugins: ["react", "jsx-a11y"],
32+
extends: [
33+
"plugin:react/recommended",
34+
"plugin:react/jsx-runtime",
35+
"plugin:react-hooks/recommended",
36+
"plugin:jsx-a11y/recommended",
37+
],
38+
settings: {
39+
react: {
40+
version: "detect",
41+
},
42+
formComponents: ["Form"],
43+
linkComponents: [
44+
{ name: "Link", linkAttribute: "to" },
45+
{ name: "NavLink", linkAttribute: "to" },
46+
],
47+
"import/resolver": {
48+
typescript: {},
49+
},
50+
},
51+
},
52+
53+
// Typescript
54+
{
55+
files: ["**/*.{ts,tsx}"],
56+
plugins: ["@typescript-eslint", "import"],
57+
parser: "@typescript-eslint/parser",
58+
settings: {
59+
"import/internal-regex": "^~/",
60+
"import/resolver": {
61+
node: {
62+
extensions: [".ts", ".tsx"],
63+
},
64+
typescript: {
65+
alwaysTryTypes: true,
66+
},
67+
},
68+
},
69+
extends: [
70+
"plugin:@typescript-eslint/recommended",
71+
"plugin:import/recommended",
72+
"plugin:import/typescript",
73+
],
74+
},
75+
76+
// Node
77+
{
78+
files: [".eslintrc.cjs"],
79+
env: {
80+
node: true,
81+
},
82+
},
83+
],
1384
};

sample-apps/delivery-customizations/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@ pnpm-lock.yaml
2222
# Ignore shopify files created during app dev
2323
.shopify/*
2424
.shopify.lock
25+
26+
# Hide files auto-generated by react router
27+
.react-router/
28+

sample-apps/delivery-customizations/.graphqlrc.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,6 @@ function getConfig() {
3737
return config;
3838
}
3939

40-
module.exports = getConfig();
40+
const config = getConfig();
41+
42+
export default config;

sample-apps/delivery-customizations/CHANGELOG.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,35 @@
1+
# @shopify/shopify-app-template-react-router
2+
3+
## July 2025
4+
5+
Forked the [shopify-app-template repo](https://github.com/Shopify/shopify-app-template-remix)
6+
17
# @shopify/shopify-app-template-remix
28

9+
## 2025.03.18
10+
11+
-[#998](https://github.com/Shopify/shopify-app-template-remix/pull/998) Update to Vite 6
12+
13+
## 2025.03.01
14+
15+
- [#982](https://github.com/Shopify/shopify-app-template-remix/pull/982) Add Shopify Dev Assistant extension to the VSCode extension recommendations
16+
17+
## 2025.01.31
18+
19+
- [#952](https://github.com/Shopify/shopify-app-template-remix/pull/952) Update to Shopify App API v2025-01
20+
21+
## 2025.01.23
22+
23+
- [#923](https://github.com/Shopify/shopify-app-template-remix/pull/923) Update `@shopify/shopify-app-session-storage-prisma` to v6.0.0
24+
25+
## 2025.01.8
26+
27+
- [#923](https://github.com/Shopify/shopify-app-template-remix/pull/923) Enable GraphQL autocomplete for Javascript
28+
329
## 2024.12.19
430

531
- [#904](https://github.com/Shopify/shopify-app-template-remix/pull/904) bump `@shopify/app-bridge-react` to latest
6-
-
32+
-
733
## 2024.12.18
834

935
- [875](https://github.com/Shopify/shopify-app-template-remix/pull/875) Add Scopes Update Webhook
@@ -19,6 +45,7 @@
1945
- [#891](https://github.com/Shopify/shopify-app-template-remix/pull/891) Enable remix future flags.
2046

2147
## 2024.11.26
48+
2249
- [888](https://github.com/Shopify/shopify-app-template-remix/pull/888) Update restResources version to 2024-10
2350

2451
## 2024.11.06

sample-apps/delivery-customizations/README.md

Lines changed: 60 additions & 153 deletions
Large diffs are not rendered by default.
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import { PrismaClient } from "@prisma/client";
22

33
declare global {
4-
var prisma: PrismaClient;
4+
// eslint-disable-next-line no-var
5+
var prismaGlobal: PrismaClient;
56
}
67

78
if (process.env.NODE_ENV !== "production") {
8-
if (!global.prisma) {
9-
global.prisma = new PrismaClient();
9+
if (!global.prismaGlobal) {
10+
global.prismaGlobal = new PrismaClient();
1011
}
1112
}
1213

13-
const prisma: PrismaClient = global.prisma || new PrismaClient();
14+
const prisma = global.prismaGlobal ?? new PrismaClient();
1415

1516
export default prisma;

sample-apps/delivery-customizations/app/entry.server.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import { PassThrough } from "stream";
22
import { renderToPipeableStream } from "react-dom/server";
3-
import { RemixServer } from "@remix-run/react";
4-
import {
5-
createReadableStreamFromReadable,
6-
type EntryContext,
7-
} from "@remix-run/node";
3+
import { ServerRouter } from "react-router";
4+
import { createReadableStreamFromReadable } from "@react-router/node";
5+
import { type EntryContext } from "react-router";
86
import { isbot } from "isbot";
97
import { addDocumentResponseHeaders } from "./shopify.server";
108

@@ -14,7 +12,7 @@ export default async function handleRequest(
1412
request: Request,
1513
responseStatusCode: number,
1614
responseHeaders: Headers,
17-
remixContext: EntryContext
15+
reactRouterContext: EntryContext
1816
) {
1917
addDocumentResponseHeaders(request, responseHeaders);
2018
const userAgent = request.headers.get("user-agent");
@@ -24,8 +22,8 @@ export default async function handleRequest(
2422

2523
return new Promise((resolve, reject) => {
2624
const { pipe, abort } = renderToPipeableStream(
27-
<RemixServer
28-
context={remixContext}
25+
<ServerRouter
26+
context={reactRouterContext}
2927
url={request.url}
3028
/>,
3129
{

sample-apps/delivery-customizations/app/root.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
import {
2-
Links,
3-
Meta,
4-
Outlet,
5-
Scripts,
6-
ScrollRestoration,
7-
} from "@remix-run/react";
1+
import { Links, Meta, Outlet, Scripts, ScrollRestoration } from "react-router";
82

93
export default function App() {
104
return (
11-
<html>
5+
<html lang="en">
126
<head>
137
<meta charSet="utf-8" />
148
<meta name="viewport" content="width=device-width,initial-scale=1" />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import { flatRoutes } from "@remix-run/fs-routes";
1+
import { flatRoutes } from "@react-router/fs-routes";
22

33
export default flatRoutes();

0 commit comments

Comments
 (0)