1.1.0: Broader JS API and self-hosting support #138
Replies: 5 comments 2 replies
-
I think |
Beta Was this translation helpful? Give feedback.
-
Hi - this is the release candidate build of Stork's JS and WASM that includes the new Javascript API methods. The indexer will be updated at another time. To use this, upload these files to your web server and include them with a If you have any feedback, please provide it here. Thank you! Download
|
Beta Was this translation helpful? Give feedback.
-
Thank you! On my todo list to set this up. |
Beta Was this translation helpful? Give feedback.
-
Thank you! On my todo list to set this up.
Same here!
|
Beta Was this translation helpful? Give feedback.
-
A final update: I've publicly released 1.1.0 with the API described above! Please use the released version instead of the release candidate. Thank you! |
Beta Was this translation helpful? Give feedback.
-
Update: Download the new files in the comment below.
1.1.0 is coming soon and, in a departure from the published roadmap, will feature two features heavily requested by users: self-hosting and increased control over the Javascript runtime. All other changes will be bug fixes.
I will be publishing a release candidate shortly, and will update here when I do.Edit: I have added the new build artifacts in a comment in this discussion. I am calling on you to validate that the new API is usable and works as expected.Usage
Right now, the
stork
Javascript object only has one method --stork.register(name, url, options)
, which handles everything. The WASM is fetched on page load, andregister()
loads the index and harnesses the DOM as soon as it is called. The new version of Stork will add four new methods:stork.initialize(url)
, which will load the WASM blob and otherwise set up Stork.stork.downloadIndex(name, url, options)
, which will download the index file and register it with the WASM container.stork.attach(name)
, which will find DOM elements and make them work dynamically as a search index.Notably,
stork.attach()
will be able to be called multiple times, so if your page dynamically creates or hides DOM elements (like every React site does, for example), you will be able to callstork.attach()
every time you are routed to a new page and the search interface will reload without re-downloading your WASM or your index. This was not possible before.[0]The last method,
stork.search(name, query)
, will let you programmatically search from Javascript. This is meant to be used in scenarios when you don't want to use Stork's DOM management at all. I don't expect many people to use this.Self-hosting
This release of Stork will allow for self-hosting, so you don't have to load Stork from
files.stork-search.net
anymore. The Javascript and WASM files will be attached to the release, and you will be able to download and serve them from your own web host.The only thing preventing you from self-hosting Stork was that the WASM url was hardcoded into the Javascript library. In this release, the url parameter in
stork.initialize(url)
will be an optional parameter that lets you define the URL of the Stork WASM. You will be able to point to the location where you're hosting the WASM file.Please respond here if you have any questions.
Tagging people who have expressed interest in self-hosted Stork:
@styfle @fauno @reese @kozi @itamarst
[0]: This also happened to be the reason the demo on the project's home page was flaky.
Beta Was this translation helpful? Give feedback.
All reactions