Skip to content
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

Update safari extension #17494

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Update safari extension #17494

wants to merge 6 commits into from

Conversation

ChangeHow
Copy link
Contributor

@ChangeHow ChangeHow commented Mar 2, 2025

Description

Improvements:

Screencast

Checklist

- Merge branch \'contributions/merge-1740940927714\' into fix/over-export-size
- Pull contributions
- Merge branch \'contributions/merge-1740940863811\' into fix/over-export-size
- Pull contributions
- chore: fixed prettier issues
- chore: add prettier ignore file
- chore: update ignore list
- chore: add go parser to handle bookmarks
- fix(safari): optimize performance for enable pinyin
- Initial commit
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: safari Issues related to the safari extension OP is contributor The OP of the PR is a contributor of the extension labels Mar 2, 2025
@raycastbot
Copy link
Collaborator

raycastbot commented Mar 2, 2025

Thank you for your contribution! 🎉

🔔 @loris @thomaspaulmann @SKaplanOfficial @iwex @xilopaint @ridemountainpig @1weiho @xmok you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

Due to our current reduced availability, the initial review may take up to 10-15 business days

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR adds a Go-based bookmarks parser to the Safari extension to improve performance with large bookmark files.

  • Added Go implementation in /extensions/safari/src/go/ with a more efficient parser that solves "object size is too large" errors
  • Added new preference option parseBookmarksWithGo in package.json to toggle between Node-based and Go-based parsing methods
  • Implemented benchmark tests in src/tests/bookmark.bench.ts to compare performance between the two parsing methods
  • Replaced third-party LRUCache with Raycast's built-in Cache API for better integration
  • Improved Pinyin support performance by optimizing handler installation and adding performance monitoring

💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!

24 file(s) reviewed, 18 comment(s)
Edit PR Review Bot Settings | Greptile

@ChangeHow
Copy link
Contributor Author

@pernielsentikaer Hi, for asking help if you have time.

I just met a issue that I can't run my go exe file in extension even if I run build:go_parser script in build script. The extension keep warning that can't find tools/bookmarks-parser.
image
image

I have no idea how to solve this issue.

@ChangeHow
Copy link
Contributor Author

@pernielsentikaer Hi, for asking help if you have time.

I just met a issue that I can't run my go exe file in extension even if I run build:go_parser script in build script. The extension keep warning that can't find tools/bookmarks-parser.

image image

I have no idea how to solve this issue.

I just checked the development doc. It seems that I need to move my exe file to the asset folder. I'll try it later.

@ksandvik
Copy link

ksandvik commented Mar 2, 2025

Is there a need to use Go, why not Swift (or Objective-C) with a bridge as this is a Safari MacOSX only limit?

@ChangeHow
Copy link
Contributor Author

ChangeHow commented Mar 3, 2025

Is there a need to use Go, why not Swift (or Objective-C) with a bridge as this is a Safari MacOSX only limit?

The main reason is that I don't know other high performance language except Go😄.

If you are familiar with Swift or OC, feel free to edit this PR.

The other reason is that I try to handle data with WASM in the earlier version, and Go has good support for that.

@ChangeHow
Copy link
Contributor Author

ChangeHow commented Mar 3, 2025

Is there a need to use Go, why not Swift (or Objective-C) with a bridge as this is a Safari MacOSX only limit?

I have met a performance issue that the Go parser has a wrose performance than node. Especially in the first time running
image
image
It seems that go paresr need a time to load or warm up 🥲.

If you have time, please confirm it works well in your Mac. I can only assume that Go parser can provide the bigger size plist file support than node. @ksandvik

@pernielsentikaer pernielsentikaer self-assigned this Mar 3, 2025
@pernielsentikaer
Copy link
Collaborator

Let's not make it slower 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension fix / improvement Label for PRs with extension's fix improvements extension: safari Issues related to the safari extension OP is contributor The OP of the PR is a contributor of the extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants