-
Notifications
You must be signed in to change notification settings - Fork 181
remove lazy loading #1018
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
remove lazy loading #1018
Changes from 9 commits
f9746e8
2687031
a453900
44b42e7
fe50017
0c1e85a
1f5097e
65610b5
1a31669
5e4132c
1cb758f
3b755fa
ee75663
0530864
8a64eda
aa1ed33
185822a
da1c094
f3fee6f
b410840
789e98d
1695718
cf72cb7
2ef0748
6180c10
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| // SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc. | ||
| // SPDX-License-Identifier: BUSL-1.1 | ||
| // NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE. | ||
|
|
||
| import React, { createElement, forwardRef } from 'react'; | ||
| import { Platform } from 'react-native'; | ||
|
|
||
| // Platform-specific SvgXml component | ||
| const SvgXmlWrapper = forwardRef< | ||
| HTMLDivElement | SVGSVGElement, | ||
| { | ||
| xml: string; | ||
| width?: number; | ||
| height?: number; | ||
| style?: React.CSSProperties; | ||
| } | ||
| >(({ xml, width, height, style, ...props }, ref) => { | ||
| if (Platform.OS === 'web') { | ||
| // Use our mock for web | ||
| return createElement('div', { | ||
| ref, | ||
| style: { | ||
| width: width || 'auto', | ||
| height: height || 'auto', | ||
| display: 'inline-block', | ||
| ...style, | ||
| }, | ||
| dangerouslySetInnerHTML: { __html: xml }, | ||
| ...props, | ||
| }); | ||
| } | ||
|
||
|
|
||
| // Use the real SvgXml for native platforms | ||
| // eslint-disable-next-line @typescript-eslint/no-require-imports | ||
| const { SvgXml } = require('react-native-svg'); | ||
| return ( | ||
| <SvgXml xml={xml} width={width} height={height} style={style} {...props} /> | ||
| ); | ||
| }); | ||
|
|
||
| SvgXmlWrapper.displayName = 'SvgXmlWrapper'; | ||
|
|
||
| export { SvgXmlWrapper as SvgXml }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| // SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc. | ||
| // SPDX-License-Identifier: BUSL-1.1 | ||
| // NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE. | ||
|
|
||
| import React from 'react'; | ||
|
|
||
| // Mock BlurView component for web builds | ||
| export const BlurView = React.forwardRef< | ||
| HTMLDivElement, | ||
| React.HTMLAttributes<HTMLDivElement> & { | ||
| blurType?: string; | ||
| blurAmount?: number; | ||
| reducedTransparencyFallbackColor?: string; | ||
| } | ||
| >(({ children, style, ...props }, ref) => { | ||
| return React.createElement( | ||
| 'div', | ||
| { | ||
| ref, | ||
| style: { | ||
| backgroundColor: 'rgba(255, 255, 255, 0.1)', | ||
| backdropFilter: 'blur(10px)', | ||
| ...style, | ||
| }, | ||
| ...props, | ||
| }, | ||
| children, | ||
| ); | ||
| }); | ||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| BlurView.displayName = 'BlurView'; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| // SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc. | ||
| // SPDX-License-Identifier: BUSL-1.1 | ||
| // NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE. | ||
|
|
||
| import React from 'react'; | ||
|
|
||
| export const Circle = React.forwardRef< | ||
| SVGCircleElement, | ||
| React.SVGProps<SVGCircleElement> | ||
| >((props, ref) => { | ||
| return React.createElement('circle', { ref, ...props }); | ||
| }); | ||
|
|
||
| Circle.displayName = 'Circle'; | ||
|
|
||
| export const Path = React.forwardRef< | ||
| SVGPathElement, | ||
| React.SVGProps<SVGPathElement> | ||
| >((props, ref) => { | ||
| return React.createElement('path', { ref, ...props }); | ||
| }); | ||
|
|
||
| Path.displayName = 'Path'; | ||
|
|
||
| export const Rect = React.forwardRef< | ||
| SVGRectElement, | ||
| React.SVGProps<SVGRectElement> | ||
| >((props, ref) => { | ||
| return React.createElement('rect', { ref, ...props }); | ||
| }); | ||
|
|
||
| Rect.displayName = 'Rect'; | ||
|
|
||
| // Re-export other common SVG components that might be used | ||
| export const Svg = React.forwardRef< | ||
| SVGSVGElement, | ||
| React.SVGProps<SVGSVGElement> | ||
| >((props, ref) => { | ||
| return React.createElement('svg', { ref, ...props }); | ||
| }); | ||
|
|
||
| Svg.displayName = 'Svg'; | ||
|
|
||
| // Mock SvgXml component for web builds | ||
| export const SvgXml = React.forwardRef< | ||
| HTMLDivElement, | ||
| { | ||
| xml: string; | ||
| width?: number; | ||
| height?: number; | ||
| style?: React.CSSProperties; | ||
| } | ||
| >(({ xml, width, height, style, ...props }, ref) => { | ||
| return React.createElement('div', { | ||
| ref, | ||
| style: { | ||
| width: width || 'auto', | ||
| height: height || 'auto', | ||
| display: 'inline-block', | ||
| ...style, | ||
| }, | ||
| dangerouslySetInnerHTML: { __html: xml }, | ||
| ...props, | ||
| }); | ||
| }); | ||
|
|
||
| SvgXml.displayName = 'SvgXml'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Replace direct cache usage with a composite cache-built-deps action (aligns with repo policy).
This block is fine for diagnostics, but the surrounding restore/save steps use actions/cache directly, which violates our workflow guideline to use shared composite caching actions from .github/actions. Please introduce a ./.github/actions/cache-built-deps composite that wraps restore/save for common/dist and packages/mobile-sdk-alpha/dist and exposes cache-hit, then consume it here and in all jobs (build-deps, test, build-ios, build-android). Do the same for Xcode caches via a cache-xcode composite to remove raw actions/cache calls.
Example composite (new file):
Then replace all “Restore/Save Built Dependencies” pairs with a single:
🤖 Prompt for AI Agents