Skip to content

Commit

Permalink
Speed up preview
Browse files Browse the repository at this point in the history
  • Loading branch information
Rustem Mussabekov committed Dec 3, 2024
1 parent 2f68dda commit 78fd120
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 14 deletions.
4 changes: 2 additions & 2 deletions build/xcode/Save to Raindrop.io/App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>5.6.60</string>
<string>5.6.63</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand All @@ -32,7 +32,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>367</string>
<string>369</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
<key>LSMinimumSystemVersion</key>
Expand Down
4 changes: 2 additions & 2 deletions build/xcode/Save to Raindrop.io/Extension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>5.6.60</string>
<string>5.6.63</string>
<key>CFBundleVersion</key>
<string>367</string>
<string>369</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSExtension</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@
CODE_SIGN_ENTITLEMENTS = Extension/Extension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 367;
CURRENT_PROJECT_VERSION = 369;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 7459JWM5TY;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -452,7 +452,7 @@
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
MARKETING_VERSION = 5.6.60;
MARKETING_VERSION = 5.6.63;
PRODUCT_BUNDLE_IDENTIFIER = io.raindrop.safari.extension;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -467,7 +467,7 @@
CODE_SIGN_ENTITLEMENTS = Extension/Extension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 367;
CURRENT_PROJECT_VERSION = 369;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 7459JWM5TY;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -478,7 +478,7 @@
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
MARKETING_VERSION = 5.6.60;
MARKETING_VERSION = 5.6.63;
PRODUCT_BUNDLE_IDENTIFIER = io.raindrop.safari.extension;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -497,7 +497,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 367;
CURRENT_PROJECT_VERSION = 369;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 7459JWM5TY;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -508,7 +508,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
MARKETING_VERSION = 5.6.60;
MARKETING_VERSION = 5.6.63;
PRODUCT_BUNDLE_IDENTIFIER = io.raindrop.safari;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -525,7 +525,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 367;
CURRENT_PROJECT_VERSION = 369;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 7459JWM5TY;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -536,7 +536,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
MARKETING_VERSION = 5.6.60;
MARKETING_VERSION = 5.6.63;
PRODUCT_BUNDLE_IDENTIFIER = io.raindrop.safari;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down
Binary file not shown.
3 changes: 3 additions & 0 deletions src/co/bookmarks/item/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Highlights from './highlights'
import Reminder from './reminder'
import Info from './info'
import Actions from './actions'
import { PreloadPreviewLink } from '~routes/my/item/tab/preview'

export default function BookmarkItemView(props) {
const { innerRef, isDragging } = props
Expand Down Expand Up @@ -98,6 +99,8 @@ export default function BookmarkItemView(props) {
onKeyUp={onKeyUp}>
{title}
</SuperLink>

<PreloadPreviewLink item={props} />
</article>
)}</DragItem>
)
Expand Down
14 changes: 12 additions & 2 deletions src/routes/my/item/tab/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ import { API_ENDPOINT_URL } from '~data/constants/app'
import useWithWebView from '~co/highlights/useWithWebView'
import Preloader from '~co/common/preloader'

export default function PageMyItemTabPreview({ item: { _id, type, link }, webViewRef }) {
function getPreviewLink(_id) {
return `${API_ENDPOINT_URL}raindrop/preview/${_id}`
}

export function PreloadPreviewLink({ item }) {
if (item.type != 'link')
return <link rel='prefetch' crossOrigin='use-credentials' href={getPreviewLink(item._id)} />
return null
}

export default function PageMyItemTabPreview({ item: { _id }, webViewRef }) {
//highlights
useWithWebView(webViewRef, _id)

Expand All @@ -27,7 +37,7 @@ export default function PageMyItemTabPreview({ item: { _id, type, link }, webVie
allow='fullscreen; clipboard-write'
loading='eager'
referrerPolicy='no-referrer'
src={`${API_ENDPOINT_URL}raindrop/preview/${_id}?type=${type}#solid-bg=false&theme=${font_color||theme.app}&font-family=${font_family}&font-size=${font_size}`}
src={`${getPreviewLink(_id)}#solid-bg=false&theme=${font_color||theme.app}&font-family=${font_family}&font-size=${font_size}`}
onLoad={onLoad} />

{loading && (
Expand Down

0 comments on commit 78fd120

Please sign in to comment.