Skip to content

Commit 5c23f66

Browse files
committed
feat: Update to Next.js 14
1 parent 983d144 commit 5c23f66

File tree

12 files changed

+101
-216
lines changed

12 files changed

+101
-216
lines changed

apps/next/app/ClientRootLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ setPublicEnvVars({
2626

2727
const NextClientRootLayout = (props: { children: React.ReactNode }) => {
2828
// Props
29-
const { children } = props
29+
const { children } = props // FIXME: Why is children null on hydration??
3030

3131
// -- Fonts --
3232

apps/next/app/layout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import NextClientRootLayout from './ClientRootLayout'
44

55
/* --- <NextRootLayout/> ----------------------------------------------------------------------- */
66

7+
// FIXME: Why is children null when passing it to NextClientRootLayout?
8+
79
const NextRootLayout = ({ children }: { children: React.ReactNode }) => (
810
<Document>
911
<NextClientRootLayout>{children}</NextClientRootLayout>

apps/next/next.config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,14 @@ const nextConfig = {
6969
ignoreBuildErrors: true,
7070
},
7171
images: {
72-
domains: ['i3.ytimg.com'],
72+
remotePatterns: [
73+
{
74+
protocol: 'https',
75+
hostname: 'i3.ytimg.com',
76+
// port: '',
77+
// pathname: '/account123/**',
78+
},
79+
],
7380
},
7481
webpack: (config, { isServer }) => {
7582
// -i- Run aetherspace automation scripts in DEV mode

apps/next/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
"app": "*",
2020
"encoding": "^0.1.13",
2121
"expo-asset-web": "npm:expo-asset@8.7.0",
22-
"next": "13.4.8",
22+
"next": "14.0.0",
2323
"next-fonts": "^1.5.1",
2424
"next-images": "^1.8.5",
2525
"next-pwa": "^5.6.0",
26-
"next-transpile-modules": "^10.0.0",
26+
"next-transpile-modules": "^10.0.1",
2727
"raf": "^3.4.1",
2828
"registries": "*",
2929
"setimmediate": "^1.0.5",

features/app-core/hooks/useLoadFonts.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ const useLoadFonts = () => {
2828
Roboto700: Roboto_700Bold,
2929
Roboto800: Roboto_900Black, // Fallback
3030
Roboto900: Roboto_900Black,
31-
// - Icon Fonts -
32-
AntDesign: require('@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/AntDesign.ttf'),
3331
}
3432

3533
const [googleFontsLoaded, googleFontsError] = useFonts(fontsToLoad)

features/cv-page/icons/registry.tsx

Lines changed: 0 additions & 17 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"packages/*"
1212
],
1313
"engines": {
14-
"node": ">=18.0.0"
14+
"node": ">=18.17.0"
1515
},
1616
"browser": {
1717
"fs": false,

packages/@aetherspace/components/AetherIcon/README.md

Lines changed: 0 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ There’s many different ways to use icons and icon sets in Aetherspace. Here’
66
→ SSR support, fast & easy, no layout shift on web, limited options
77
- Custom SVG components using `react-native-svg`
88
→ SSR support, can [convert from .svg file](https://transform.tools/svg-to-react-native), but could be more time-consuming
9-
- Third party iconfont libraries, such as `@expo/vector-icons`
10-
→ Fast & easy, needs icon font preloaded, layout shift on web, locked out of SWC
119
- Image icons through src urls
1210
→ Straight forward, easy, not super optimised, fixed colors, layout shift on web
1311

@@ -155,99 +153,6 @@ Downsides of this strategy:
155153
- Time consuming: Requires some copy-pasting between transform tools and your code
156154
- Therefore, even if it’s most reliable and configurable, also not very fast or scalable
157155

158-
## Using `@expo/vector-icons`
159-
160-
[Expo Docs: @expo/vector-icons](https://docs.expo.dev/guides/icons/)
161-
162-
> Check which iconset you want to use and how to use them on [https://icons.expo.fyi/](https://icons.expo.fyi/)
163-
164-
Benefits of using this strategy:
165-
166-
- Fast, choose icons from existing third party icon providers
167-
- Most @expo/vector-icons are also compatible with the web
168-
169-
Downsides of using icon fonts under the hood:
170-
171-
- You’ll need to preload your icon font somehow, easy on mobile but harder on web
172-
- Loading flicker, meaning you might not see the icon immediately if the icon font isn’t loaded yet
173-
- Cannot use Next.js’s SWC compiler when using any of the @expo/vector-icons (no loader for importing .ttf files)
174-
175-
Example usage:
176-
177-
```tsx
178-
import { AntDesign } from '@expo/vector-icons'
179-
180-
<AntDesign
181-
name="caretup"
182-
size={24}
183-
color="#333333"
184-
/>
185-
```
186-
187-
Example preloading of icon font on mobile:
188-
189-
`/features/app-core/hooks/useLoadFonts.ts`
190-
191-
```tsx
192-
'use client'
193-
import { useFonts } from 'expo-font'
194-
import { /* Google Fonts */ } from '@expo-google-fonts/roboto'
195-
196-
/* --- useLoadFonts() -------------------------------------------------------------------------- */
197-
198-
const useLoadFonts = () => {
199-
const fontsToLoad = {
200-
// - Google Fonts -
201-
/* ... */
202-
// - Icon Fonts -
203-
AntDesign: require('@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/AntDesign.ttf'),
204-
// -!- important: always double check this path (^) for your icon fonts
205-
}
206-
207-
const [fontsLoaded, fontsError] = useFonts(fontsToLoad)
208-
209-
if (fontsError) console.error('fontErrors:', fontsLoaded)
210-
211-
// -- Return --
212-
213-
return fontsLoaded // <- Keep splash screen open until this is true
214-
}
215-
216-
/* --- Exports --------------------------------------------------------------------------------- */
217-
218-
export default useLoadFonts
219-
```
220-
221-
Example usage with `<AetherIcon/>`
222-
223-
`/packages/{workspace-folder}/icons/registry.tsx`
224-
225-
```tsx
226-
import React from 'react'
227-
import { registerIconRenderer } from 'aetherspace/utils'
228-
import { AntDesign } from '@expo/vector-icons'
229-
import { ComponentProps } from 'react'
230-
231-
/** --- iconRegistry --------------------------------------------------------------------------- */
232-
/** -i- Register any icons by preferred AetherIcon "name" key */
233-
export const iconRegistry = {
234-
// Register any icons from e.g. AntDesign you want by
235-
// registering them by strings 👇 array (readonly) + render function
236-
...registerIconRenderer(['caretup'] as const, ({ name, size, fill, ...restIconProps }) => (
237-
<AntDesign
238-
name={name as ComponentProps<typeof AntDesign>['name']}
239-
size={size}
240-
color={fill}
241-
{...restIconProps}
242-
/>
243-
)),
244-
} as const // <-- Readonly is important here for accurate type hints
245-
```
246-
247-
```tsx
248-
<AetherIcon name="caretup" size={24} fill="#333333" />
249-
```
250-
251156
## Using `AetherImage` with `.svg` files
252157

253158
> Using `AetherImage` with `.svg` files might be the most bundle size friendly way of using SVGs in your app. Since it will always result in only using the SVGs that you actually use in your app.

packages/@aetherspace/docs/addons/gqlPlaygroundAddon.js

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
3-
var react_1 = require("react");
4-
var addons_1 = require("@storybook/addons");
3+
const react_1 = require("react");
4+
const addons_1 = require("@storybook/addons");
55
/* --- GraphQL Storybook Plugin ---------------------------------------------------------------- */
6-
addons_1.addons.register('/graphql', function () {
6+
addons_1.addons.register('/graphql', () => {
77
addons_1.addons.add('graphql-playground/tab', {
88
type: addons_1.types.TAB,
99
title: 'GraphQL',
10-
route: function (_a) {
11-
var storyId = _a.storyId;
12-
return "/graphql/".concat(storyId);
13-
},
14-
match: function (_a) {
15-
var viewMode = _a.viewMode;
16-
return viewMode === 'graphql';
17-
},
18-
render: function () {
19-
var graphqlUrl = 'http://localhost:3000/api/graphql';
20-
var isDev = process.env.NODE_ENV === 'development';
10+
route: ({ storyId }) => `/graphql/${storyId}`,
11+
match: ({ viewMode }) => viewMode === 'graphql',
12+
render: () => {
13+
let graphqlUrl = 'http://localhost:3000/api/graphql';
14+
const isDev = process.env.NODE_ENV === 'development';
2115
if (!isDev)
22-
graphqlUrl = "".concat(process.env.STORYBOOK_BACKEND_URL, "/api/graphql");
16+
graphqlUrl = `${process.env.STORYBOOK_BACKEND_URL}/api/graphql`;
2317
return (0, react_1.createElement)('iframe', {
2418
style: { width: '100%', height: '100%' },
2519
src: graphqlUrl,

packages/@config/transpiledModules.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ module.exports = [
77
// - Modules -
88
'twrnc',
99
'@react-native/assets-registry',
10-
'@expo/vector-icons',
1110
// - Packages & Features -
1211
...transpiledWorkspaces,
1312
]

0 commit comments

Comments
 (0)