Skip to content

Commit e7c5084

Browse files
Merge pull request #197 from oracle/viteMigration
Vite migration and dependency updates
2 parents f427b50 + 8562642 commit e7c5084

File tree

11 files changed

+68
-48
lines changed

11 files changed

+68
-48
lines changed

templates/ords-remix-jwt-sample/README.md

+6-9
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ To set up your Auth0 tenant and application follow the steps outlined in [The Au
4040

4141
#### 3. configure your `.env` file as it follows
4242

43-
You can create a `.env` file or rename the `.env.example` file to `.env` and use it to fill the following environment variables:
43+
You can create a `.env` file or rename the `.env.example` file to `.env` and use it to fill the following environment variables:
4444

4545
```bash
4646
# We refer to some variables as Autonomous Database specific but you can use whichever ORDS URL you want/have as well as the user, as long as this user is capable of creating and REST Enabling other schemas.
@@ -180,14 +180,11 @@ Once the server is up you will see the following output on your console:
180180

181181
```bash
182182
183-
> remix dev --manual
183+
> remix vite:dev
184184

185-
186-
💿 remix dev
187-
188-
info building...
189-
info built (3.1s)
190-
[remix-serve] http://localhost:3000 (http://<IP_HERE>:3000)
185+
➜ Local: http://localhost:3000/
186+
➜ Network: use --host to expose
187+
➜ press h + enter to show help
191188
```
192189

193190
Now you can go to `http://localhost:3000` and see the ORDS Concert App in action fell free to explore the Discover Functionalities and don't forget to Enable the Tooltips functionality to learn more about Oracle REST Data Services!
@@ -212,4 +209,4 @@ All names, characters, organizations, places, events and portrayals are entirely
212209

213210
Copyright (c) 2024 Oracle and/or its affiliates.
214211

215-
Released under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl/.
212+
Released under the Universal Permissive License v1.0 as shown at <https://oss.oracle.com/licenses/upl/>.

templates/ords-remix-jwt-sample/app/components/concerts/ConcertCard.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function ConcertCard(props: ConcertCardProps) {
8888
</AccordionComponent>
8989
)
9090
}
91-
<Link to={`/concerts/${concert.event_id}`}>
91+
<Link to={`../concerts/${concert.event_id}`}>
9292
<h1 className="font-sans font-bold hover:underline">
9393
{concertTitle}
9494
</h1>

templates/ords-remix-jwt-sample/app/components/homepage/ArtistCard.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function ArtistCard(props: ArtistCardProps) {
4040
<CardContent>
4141
<div className="flex flex-row justify-center">
4242
<div className="flex flex-col items-center">
43-
<Link to={`/artists/${artist.artist_id}${enableTooltips ? '?tooltips' : ''}`}>
43+
<Link to={`../artists/${artist.artist_id}${enableTooltips ? '?tooltips' : ''}`}>
4444
<h3 className="my-2 text-xl font-medium hover:underline">
4545
{ artist.name }
4646
</h3>

templates/ords-remix-jwt-sample/app/components/homepage/ConcertCard.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function ConcertCard(props: ConcertCardProps) {
4444
<CardContent sx={{ maxWidth: '500px' }}>
4545
<div className="mx-4">
4646
<div className="flex items-center">
47-
<Link to={`/concerts/${concert.event_id}?${enableTooltips ? 'tooltips' : ''}`}>
47+
<Link to={`../concerts/${concert.event_id}?${enableTooltips ? 'tooltips' : ''}`}>
4848
<h1 className="font-sans font-bold hover:underline">
4949
{`${concert.artist_name} at ${concert.venue_name}, ${concert.city_name}`}
5050
</h1>

templates/ords-remix-jwt-sample/app/components/search/DatePicker.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
** All rights reserved
55
** Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
66
*/
7-
import ReactDatePicker from 'react-datepicker';
7+
import DatePicker from 'react-datepicker';
8+
import 'react-datepicker/dist/react-datepicker.css?url';
89

910
interface DateRangePickerProps {
1011
startDate: null | Date;
@@ -22,7 +23,6 @@ function DateRangePicker(props : DateRangePickerProps) {
2223
startDate, endDate, handleSetEndDate, handleSetStartDate,
2324
} = props;
2425

25-
const DatePicker = ReactDatePicker.default;
2626
return (
2727
<div className="flex flex-col items-center justify-center space-y-4">
2828
<DatePicker

templates/ords-remix-jwt-sample/app/root.tsx

+2-15
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
** Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
66
*/
77
import type {
8-
LinksFunction,
98
LoaderFunctionArgs,
109
} from '@remix-run/node';
1110
import { json, ErrorResponse } from '@remix-run/node';
1211
import {
1312
Links,
14-
LiveReload,
1513
Meta,
1614
Outlet,
1715
Scripts,
@@ -22,7 +20,6 @@ import {
2220
} from '@remix-run/react';
2321
import { ReactElement } from 'react';
2422
import { StyledEngineProvider } from '@mui/material';
25-
import datepicker from 'react-datepicker/dist/react-datepicker.css';
2623
import stylesheet from './tailwind.css?url';
2724
import type { LoaderError } from './models/LoaderError';
2825
import {
@@ -83,7 +80,6 @@ export function ErrorBoundary() : ReactElement {
8380
<TooltipButton />
8481
<ScrollRestoration />
8582
<Scripts />
86-
<LiveReload />
8783
</StyledEngineProvider>
8884
</body>
8985
</html>
@@ -108,7 +104,6 @@ export function ErrorBoundary() : ReactElement {
108104
<TooltipButton />
109105
<ScrollRestoration />
110106
<Scripts />
111-
<LiveReload />
112107
</StyledEngineProvider>
113108
</body>
114109
</html>
@@ -117,15 +112,8 @@ export function ErrorBoundary() : ReactElement {
117112
return <h1 className="text-3xl font-semibold">Unknown Error</h1>;
118113
}
119114

120-
export const links: LinksFunction = () => [
121-
{
122-
rel: 'stylesheet',
123-
href: stylesheet,
124-
},
125-
{
126-
rel: 'stylesheet',
127-
href: datepicker,
128-
},
115+
export const links = () => [
116+
{ rel: 'stylesheet', href: stylesheet },
129117
];
130118

131119
/**
@@ -153,7 +141,6 @@ export default function App() : ReactElement {
153141
<Footer />
154142
<ScrollRestoration />
155143
<Scripts />
156-
<LiveReload />
157144
</StyledEngineProvider>
158145
</body>
159146
</html>

templates/ords-remix-jwt-sample/app/routes/private.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ export default function Screen() : ReactElement {
8282
</div>
8383
<div className="flex h-4/5 flex-row justify-center p-8">
8484
<div className="flex w-1/5 flex-col items-start">
85-
<Link to="/private/profile" onClick={() => { handleTabSelect(Tabs.PROFILE); }} className={`w-full py-4 text-xl ${selectedTab === Tabs.PROFILE ? 'bg-slate-100' : ''}`}>
85+
<Link to="../private/profile" onClick={() => { handleTabSelect(Tabs.PROFILE); }} className={`w-full py-4 text-xl ${selectedTab === Tabs.PROFILE ? 'bg-slate-100' : ''}`}>
8686
Profile
8787
</Link>
88-
<Link to="/private/followed-artists" onClick={() => { handleTabSelect(Tabs.FOLLOWED_ARTISTS); }} className={`w-full py-4 text-xl ${selectedTab === Tabs.FOLLOWED_ARTISTS ? 'bg-slate-100' : ''}`}>
88+
<Link to="../private/followed-artists" onClick={() => { handleTabSelect(Tabs.FOLLOWED_ARTISTS); }} className={`w-full py-4 text-xl ${selectedTab === Tabs.FOLLOWED_ARTISTS ? 'bg-slate-100' : ''}`}>
8989
Followed Artists
9090
</Link>
91-
<Link to="/private/followed-events" onClick={() => { handleTabSelect(Tabs.UPCOMING_SHOWS); }} className={`w-full py-4 text-xl ${selectedTab === Tabs.UPCOMING_SHOWS ? 'bg-slate-100' : ''}`}>
91+
<Link to="../private/followed-events" onClick={() => { handleTabSelect(Tabs.UPCOMING_SHOWS); }} className={`w-full py-4 text-xl ${selectedTab === Tabs.UPCOMING_SHOWS ? 'bg-slate-100' : ''}`}>
9292
Followed Events
9393
</Link>
9494
</div>

templates/ords-remix-jwt-sample/package.json

+17-16
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "ORDS sample application",
55
"main": "index.js",
66
"scripts": {
7-
"build": "remix build",
7+
"build": "remix vite:build",
88
"migrate": "node ./ords/migrate.js",
99
"seed": "node ./ords/seed.js",
1010
"drop": "node ./ords/drop.js",
@@ -14,10 +14,10 @@
1414
"lint:frontend": "eslint ./app --ext .js,.jsx,.ts,.tsx",
1515
"lint:backend": "eslint ./ords --ext .js,.ts",
1616
"lint": "npm run lint:frontend && npm run lint:backend",
17-
"start": "remix-serve ./build/index.js",
17+
"start": "remix-serve ./build/server/index.js",
1818
"typecheck": "tsc",
1919
"icons": "npx @svgr/cli --out-dir app/components/icons -- app/assets/icons",
20-
"dev": "remix dev --manual"
20+
"dev": "remix vite:dev"
2121
},
2222
"watch": {
2323
"icons": {
@@ -36,12 +36,12 @@
3636
"@emotion/cache": "^11.13.0",
3737
"@emotion/react": "^11.13.0",
3838
"@emotion/styled": "^11.13.0",
39-
"@mui/icons-material": "6.0.2",
40-
"@mui/material": "6.0.2",
41-
"@remix-run/css-bundle": "2.13.1",
42-
"@remix-run/node": "2.13.1",
43-
"@remix-run/react": "2.13.1",
44-
"@remix-run/serve": "2.13.1",
39+
"@mui/icons-material": "5.16.14",
40+
"@mui/material": "5.16.14",
41+
"@remix-run/dev": "2.15.2",
42+
"@remix-run/node": "2.15.2",
43+
"@remix-run/react": "2.15.2",
44+
"@remix-run/serve": "2.15.2",
4545
"dotenv": "^16.4.5",
4646
"embla-carousel": "^8.2.0",
4747
"embla-carousel-react": "^8.2.0",
@@ -50,13 +50,13 @@
5050
"material-ui-popup-state": "^5.3.1",
5151
"node-fetch": "3.3.2",
5252
"react": "18.3.1",
53-
"react-datepicker": "7.3.0",
53+
"react-datepicker": "7.5.0",
5454
"react-dom": "18.3.1",
5555
"remix-auth": "3.7.0",
56-
"remix-auth-auth0": "1.10.0"
56+
"remix-auth-auth0": "1.10.0",
57+
"vite": "5.4.11"
5758
},
5859
"devDependencies": {
59-
"@remix-run/dev": "2.13.1",
6060
"@svgr/cli": "8.1.0",
6161
"@svgr/plugin-jsx": "8.1.0",
6262
"@svgr/plugin-prettier": "8.1.0",
@@ -76,10 +76,11 @@
7676
"eslint-plugin-jsx-a11y": "6.10.2",
7777
"eslint-plugin-react": "7.34.3",
7878
"eslint-plugin-react-hooks": "4.6.2",
79-
"eslint-plugin-tailwindcss": "3.17.4",
80-
"eslint-plugin-tsdoc": "0.2.17",
79+
"eslint-plugin-tailwindcss": "3.17.5",
80+
"eslint-plugin-tsdoc": "0.4.0",
8181
"postcss": "8.4.47",
8282
"tailwindcss": "3.4.3",
83-
"typescript": "5.1.6"
83+
"typescript": "5.1.6",
84+
"vite-tsconfig-paths": "^5.1.4"
8485
}
85-
}
86+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
plugins: {
3+
tailwindcss: {},
4+
},
5+
};
6+

templates/ords-remix-jwt-sample/tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"isolatedModules": true,
77
"esModuleInterop": true,
88
"jsx": "react-jsx",
9+
"module": "ESNext",
910
"moduleResolution": "Bundler",
1011
"resolveJsonModule": true,
1112
"target": "ES2022",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { vitePlugin as remix } from '@remix-run/dev';
2+
import { defineConfig } from 'vite';
3+
import tsconfigPaths from 'vite-tsconfig-paths';
4+
5+
declare module '@remix-run/node' {
6+
// or cloudflare, deno, etc.
7+
interface Future {
8+
v3_singleFetch: true;
9+
}
10+
}
11+
12+
export default defineConfig({
13+
server: {
14+
port: 3000,
15+
},
16+
plugins: [remix(
17+
{
18+
future: {
19+
unstable_optimizeDeps: true,
20+
v3_fetcherPersist: true,
21+
v3_relativeSplatPath: true,
22+
v3_throwAbortReason: true,
23+
v3_lazyRouteDiscovery: true,
24+
v3_singleFetch: true,
25+
},
26+
},
27+
), tsconfigPaths()],
28+
});

0 commit comments

Comments
 (0)