Skip to content

Commit f77ca0b

Browse files
authored
chore: Merge PR #18 from chore/update-expo-48.0.19
2 parents e0a8cf9 + 1237877 commit f77ca0b

15 files changed

Lines changed: 405 additions & 311 deletions

File tree

apps/expo/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828
"@react-navigation/native": "^6.1.5",
2929
"@react-navigation/stack": "^6.3.15",
3030
"app": "*",
31-
"expo": "~48.0.4",
31+
"expo": "~48.0.19",
3232
"expo-font": "~11.1.1",
33-
"expo-image": "~1.0.1",
34-
"expo-router": "^1.0.1",
33+
"expo-image": "~1.2.3",
34+
"expo-router": "^1.5.3",
3535
"expo-status-bar": "~1.4.4",
36-
"expo-updates": "~0.16.3",
36+
"expo-updates": "~0.16.4",
3737
"react": "18.2.0",
3838
"react-dom": "18.2.0",
3939
"react-native": "0.71.3",

apps/next/app/ClientRootLayout.tsx

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
'use client'
2+
// Analytics
3+
import { Analytics } from '@vercel/analytics/react'
4+
// Config
5+
import tailwindConfig from 'app/tailwind.config'
6+
// Context
7+
import { AetherContextManager } from 'aetherspace/context'
8+
// Hooks
9+
import useLoadFonts from 'app/hooks/useLoadFonts'
10+
// Utils
11+
import { setPublicEnvVars } from 'aetherspace/utils'
12+
13+
/* --- Public Env Vars ------------------------------------------------------------------------- */
14+
15+
// -i- This ensures that public env vars can be retrieved via the getEnvVar() util
16+
// -i- @expo/next-adapter rewrites process.env to {}, but does inject statically known env vars
17+
// -i- Meaning utils for getting env vars cross platform would not work, since they don't know the keys beforehand
18+
// -!- Use only for public env vars (client-side any process.env.SOME_KEY without NEXT_PUBLIC_ would be undefined)
19+
setPublicEnvVars({
20+
APP_LINKS: process.env.NEXT_PUBLIC_APP_LINKS,
21+
BACKEND_URL: process.env.NEXT_PUBLIC_BACKEND_URL,
22+
DOCS_URL: process.env.NEXT_PUBLIC_DOCS_URL,
23+
})
24+
25+
/* --- <NextRootLayout/> ----------------------------------------------------------------------- */
26+
27+
const NextClientRootLayout = (props: { children: React.ReactNode }) => {
28+
// Props
29+
const { children } = props
30+
31+
// -- Fonts --
32+
33+
useLoadFonts()
34+
35+
// -- Render --
36+
37+
return (
38+
<>
39+
<Analytics />
40+
<AetherContextManager assets={{}} icons={{}} twConfig={tailwindConfig} isNextJS isAppDir>
41+
{children}
42+
</AetherContextManager>
43+
</>
44+
)
45+
}
46+
47+
/* --- Exports --------------------------------------------------------------------------------- */
48+
49+
export default NextClientRootLayout

apps/next/app/layout.tsx

Lines changed: 9 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,16 @@
1-
'use client'
2-
import RootLayout from 'app/routes/document'
3-
// Analytics
4-
import { Analytics } from '@vercel/analytics/react'
5-
// Config
6-
import tailwindConfig from 'app/tailwind.config'
7-
// Context
8-
import { AetherContextManager } from 'aetherspace/context'
9-
// Hooks
10-
import useLoadFonts from 'app/hooks/useLoadFonts'
11-
// Utils
12-
import { setPublicEnvVars } from 'aetherspace/utils'
13-
14-
/* --- Public Env Vars ------------------------------------------------------------------------- */
15-
16-
// -i- This ensures that public env vars can be retrieved via the getEnvVar() util
17-
// -i- @expo/next-adapter rewrites process.env to {}, but does inject statically known env vars
18-
// -i- Meaning utils for getting env vars cross platform would not work, since they don't know the keys beforehand
19-
// -!- Use only for public env vars (client-side any process.env.SOME_KEY without NEXT_PUBLIC_ would be undefined)
20-
setPublicEnvVars({
21-
APP_LINKS: process.env.NEXT_PUBLIC_APP_LINKS,
22-
BACKEND_URL: process.env.NEXT_PUBLIC_BACKEND_URL,
23-
DOCS_URL: process.env.NEXT_PUBLIC_DOCS_URL,
24-
})
1+
// Layouts
2+
import Document, { metadata } from 'app/routes/document'
3+
import NextClientRootLayout from './ClientRootLayout'
254

265
/* --- <NextRootLayout/> ----------------------------------------------------------------------- */
276

28-
const NextRootLayout = (props: { children: React.ReactNode }) => {
29-
// Props
30-
const { children } = props
31-
32-
// -- Fonts --
33-
34-
useLoadFonts()
35-
36-
// -- Render --
37-
38-
return (
39-
<RootLayout>
40-
<Analytics />
41-
<AetherContextManager assets={{}} icons={{}} twConfig={tailwindConfig} isNextJS isAppDir>
42-
{children}
43-
</AetherContextManager>
44-
</RootLayout>
45-
)
46-
}
7+
const NextRootLayout = ({ children }: { children: React.ReactNode }) => (
8+
<Document>
9+
<NextClientRootLayout>{children}</NextClientRootLayout>
10+
</Document>
11+
)
4712

4813
/* --- Exports --------------------------------------------------------------------------------- */
4914

15+
export { metadata }
5016
export default NextRootLayout

apps/next/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
"@expo/next-adapter": "^5.0.2",
1818
"@vercel/analytics": "^1.0.1",
1919
"aetherspace": "*",
20-
"airtable": "^0.11.6",
20+
"airtable": "^0.12.1",
2121
"app": "*",
2222
"encoding": "^0.1.13",
2323
"expo-asset-web": "npm:expo-asset@8.7.0",
24-
"next": "^13.4.4",
24+
"next": "^13.4.7",
2525
"next-fonts": "^1.5.1",
2626
"next-images": "^1.8.5",
2727
"next-pwa": "^5.6.0",

features/app-core/hooks/useLoadFonts.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
'use client'
12
import { useFonts } from 'expo-font'
23
import {
34
Roboto_100Thin,

features/app-core/routes/document.tsx

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
/* eslint-disable @next/next/no-head-element */
22
import React from 'react'
3-
import { AppRegistry } from 'react-native'
4-
import { useServerInsertedHTML } from 'next/navigation'
53
// Layouts
64
import RootLayout from './layout'
75
// Styles
8-
import { getInjectableMediaQueries } from 'aetherspace/styles'
6+
import ServerStylesInjector from './ssr-style-injector'
97
// Constants
108
import { getBaseUrl } from 'aetherspace/utils/envUtils'
119

@@ -63,37 +61,23 @@ div[data-nextjs-scroll-focus-boundary] {
6361
}
6462
`
6563

64+
/* --- Metadata -------------------------------------------------------------------------------- */
65+
66+
export const metadata = {
67+
metadataBase: getBaseUrl(),
68+
}
69+
6670
/* --- <Document> ------------------------------------------------------------------------------ */
6771

6872
const Document = (props: { children: React.ReactNode }) => {
6973
// Props
7074
const { children } = props
7175

72-
// -- Serverside Styles --
73-
74-
useServerInsertedHTML(() => {
75-
// Get react-native-web styles
76-
const Main = () => <RootLayout>{children}</RootLayout>
77-
AppRegistry.registerComponent('Main', () => Main) // @ts-ignore
78-
const mainApp = AppRegistry.getApplication('Main')
79-
const reactNativeStyleElement = mainApp.getStyleElement()
80-
// Get aetherspace styles
81-
const aetherQueries = getInjectableMediaQueries()
82-
// Inject styles
83-
return (
84-
<>
85-
{reactNativeStyleElement}
86-
<style type="text/css" dangerouslySetInnerHTML={{ __html: aetherQueries.css }} />
87-
</>
88-
)
89-
})
90-
9176
// -- Render --
9277

9378
return (
9479
<html>
9580
<head>
96-
<link rel="canonical" href={getBaseUrl()} />
9781
{/* - Icons - */}
9882
<link rel="icon" href="/favicon.ico" sizes="any" />
9983
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
@@ -118,6 +102,7 @@ const Document = (props: { children: React.ReactNode }) => {
118102
/>
119103
<meta name="category" content="software development" />
120104
{/* - Styling - */}
105+
<ServerStylesInjector>{children}</ServerStylesInjector>
121106
<style type="text/css" dangerouslySetInnerHTML={{ __html: cssReset }} />
122107
<style type="text/css" dangerouslySetInnerHTML={{ __html: nextReset }} />
123108
{/* - Other - */}

features/app-core/routes/layout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
'use client'
12
import React from 'react'
23
// Screens
34
import ErrorBoundary from '../screens/ErrorBoundary'
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
'use client'
2+
/* eslint-disable @next/next/no-head-element */
3+
import React from 'react'
4+
import { AppRegistry } from 'react-native'
5+
import { useServerInsertedHTML } from 'next/navigation'
6+
// Layouts
7+
import RootLayout from './layout'
8+
// Styles
9+
import { getInjectableMediaQueries } from 'aetherspace/styles'
10+
11+
/* --- <ServerStylesInjector> ------------------------------------------------------------------------------ */
12+
13+
const ServerStylesInjector = (props: { children: React.ReactNode }) => {
14+
// Props
15+
const { children } = props
16+
17+
// -- Serverside Styles --
18+
19+
useServerInsertedHTML(() => {
20+
// Get react-native-web styles
21+
const Main = () => <RootLayout>{children}</RootLayout>
22+
AppRegistry.registerComponent('Main', () => Main) // @ts-ignore
23+
const mainApp = AppRegistry.getApplication('Main')
24+
const reactNativeStyleElement = mainApp.getStyleElement()
25+
// Get aetherspace styles
26+
const aetherQueries = getInjectableMediaQueries()
27+
// Inject styles
28+
return (
29+
<>
30+
{reactNativeStyleElement}
31+
<style type="text/css" dangerouslySetInnerHTML={{ __html: aetherQueries.css }} />
32+
</>
33+
)
34+
})
35+
36+
// -- Render --
37+
38+
return null
39+
}
40+
41+
/* --- Exports --------------------------------------------------------------------------------- */
42+
43+
export default ServerStylesInjector

features/links-page/screens/BioScreen.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,10 @@ export const BioScreen = (props: BioScreenProps) => {
187187

188188
<View tw="max-w-[600px] w-full lg:w-3/4 xl:w-2/4 mt-8 px-5 items-center">
189189
<Text tw="roboto-light text-slate-200 text-center text-sm sm:text-base">
190-
Ready for <Text tw="roboto">Organic leads</Text> from Web
190+
Ready for <Text tw="roboto">Organic leads</Text> from the Web,
191191
</Text>
192192
<Text tw="roboto-light text-slate-200 text-center text-sm sm:text-base">
193-
+ <Text tw="roboto">Higher conversions</Text> on Mobile?
193+
*and* <Text tw="roboto">Higher conversions</Text> on Mobile?
194194
</Text>
195195
<View tw="h-3" />
196196
<Text tw="flex-row">

packages/@aetherspace/hooks/useAetherStyles/useAetherStyles.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const useAetherStyles = <
4949
// Start off without breakpoints
5050
let breakpointIds = ''
5151
// Return nothing when no style related props were found
52-
if (!style && !twStrings) return [null, breakpointIds]
52+
if (!style && !twStrings) return [undefined, breakpointIds]
5353
// Return regular styles when no tailwind classes were passed
5454
if (!twStrings) return [style as unknown as ComponentProps<C>['style'], breakpointIds]
5555
// Determine tailwind classes

0 commit comments

Comments
 (0)