-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[API Feature Request] Installing native node add-ons using node-gyp #135
Comments
|
This uses the WASM compiled version of sqlite since [native modules are not supported](raycast#135). The query for matching is a rudimenary `title LIKE '%query%'` where clause. I intend to make this a bit more sophisticated to handle multiple terms. It is only using the native throttle support to debounce access to the database. It's possible that this will need more tuning or better resource management. It also does not yet support choosing a specific profile for history. This would be possible by setting that string in preferences. For now it defaults to "Default".
FWIW I was able to use the WASM-based sql.js in #172 |
Hey guys, I'm flagging this as "feature" instead of bug because this is more like a known JS bundler limitation (in our case esbuild) and something that could be argued is "missing" rather than being buggy. For now, there a workarounds such as marking certain modules as external via package.json and using other alternatives such as the mentioned wasm-based package above. |
* Support for searching Google Chrome history This uses the WASM compiled version of sqlite since [native modules are not supported](#135). The query for matching is a rudimenary `title LIKE '%query%'` where clause. I intend to make this a bit more sophisticated to handle multiple terms. It is only using the native throttle support to debounce access to the database. It's possible that this will need more tuning or better resource management. It also does not yet support choosing a specific profile for history. This would be possible by setting that string in preferences. For now it defaults to "Default". * Fix missing type annotation * Fix command titles It should use the name of the app as the Subtitle * Add title to OpenInBrowserAction * Move bromanko to contributors * Improve database lifecycle management This improves the database lifecycle management. Now, the db is loaded once when the component is mounted and disposed when the component is unmounted. Note that I have not been able to see the disposal logic get called. I suspect that this is either due to the way that Raycast handles extension component lifecycles or the dev environment operating differently. * Change copy to clipboard shortcut CMD+C is reserved for global use * Share the favicon code between commands * Always stringify the error message * Improve search query This commit changes the search from comparing the entire string as a single pattern to tokenizing the words and matching each independently. All terms must be found for it to match. * Load the last visit date from database Chrome stores dates as the number of microseconds since 01/01/1601. * Group entries by date
* Support for searching Google Chrome history This uses the WASM compiled version of sqlite since [native modules are not supported](raycast#135). The query for matching is a rudimenary `title LIKE '%query%'` where clause. I intend to make this a bit more sophisticated to handle multiple terms. It is only using the native throttle support to debounce access to the database. It's possible that this will need more tuning or better resource management. It also does not yet support choosing a specific profile for history. This would be possible by setting that string in preferences. For now it defaults to "Default". * Fix missing type annotation * Fix command titles It should use the name of the app as the Subtitle * Add title to OpenInBrowserAction * Move bromanko to contributors * Improve database lifecycle management This improves the database lifecycle management. Now, the db is loaded once when the component is mounted and disposed when the component is unmounted. Note that I have not been able to see the disposal logic get called. I suspect that this is either due to the way that Raycast handles extension component lifecycles or the dev environment operating differently. * Change copy to clipboard shortcut CMD+C is reserved for global use * Share the favicon code between commands * Always stringify the error message * Improve search query This commit changes the search from comparing the entire string as a single pattern to tokenizing the words and matching each independently. All terms must be found for it to match. * Load the last visit date from database Chrome stores dates as the number of microseconds since 01/01/1601. * Group entries by date
👋 Hey, based on this issue: evanw/esbuild#1051 is there still anything that can't be done here? My understanding is that esbuild simply grabs all the .node files and bundles them along? Though sqlite3 fails for weird reasons, better-sqlite3 looks like it could work with this native node modules plugin approach? I get a list of errors like:
|
@fe9lix How to make it as external via package.json? Can you give an example? |
Description
Right now, it looks like we cannot use any native node add-ons which are built using node-gyp. For instance, I tried various npm package to access sqlite database but failed:
sqlite
,sqlite3
,better-sqlite3
, etcSteps To Reproduce
npm install
and try to import in your extension any package relying onnode-gyp
(for instance: https://github.com/JoshuaWise/better-sqlite3)The current behavior
You will get a nodejs error (such as
Error: Could not find module root given file: "node:internal/modules/cjs/loader". Do you have a
package.jsonfile?
)The expected behavior
No error
The text was updated successfully, but these errors were encountered: