Bike 2.0 (Preview 218)

  • Added bike.showAlert API
  • Added window.presentSheet (domScript permission) API
  • Added window.inspector.addItem (domScript permission) API
  • Added URL open method and other URL (openURL permission) API
  • Added type parameters to clipboard API
  • Improved zoom animations when filtering
  • Show selected rows at full scale when filtering
  • Moved bike provided extension code from @Startup to @Bike
  • Fixed console.log output to show in Safari inspector
  • Fixed sidebar clicks to work when multiple windows open

New release! Big effort this time around is giving extensions the ability to display their own UI in WebViews. Along the way I also managed to reorganize a bunch of things.

Download:

1 Like

Notes

Quite a few changes to extensions in this release. I don’t think that I’ve broken much (any?) API, but I have added a bunch of things and make some structure changes.

The big structure change is that now the @Bike folder (in the extensions folder) is itself an extension. So it contains both API type documentation and extension code that ships with Bike. It is always loaded first. The idea is that things such as “sidebar headings item” that I want in a default Bike install will be added to this folder. It gets replaced on each launch, so the number of default additions can grow over time.

To go with that change the default @Startup extension now does nothing. It’s where you can add your own experiments, but doesn’t contain default behavior.


The next big changes is that extensions can now define their own views using web APIs. There are two places where they can do this: 1) window.inspector.addItem and 2) window.presentSheet. In future I will probably add other places.

It’s a bit complex because Bike extensions run in a headless javascript context… not associated Webview or DOM/HTML. To display custom views your extension will need to load a specified Dom script into a web view hosted in Bike’s UI. That script and your main extension code can communicate with each other using on message and postMessage. See this example.


Please give these things a try and let me know what needs fixing.


If you go digging into the API I just remembered some api that I haven’t filled in yet: inspector.addItem currently ignores the tab parameter and ignores the item.ordering parameter.

1 Like

I forgot to mention, while I don’t think this release breaks much API extension structure has changed some. Most importantly extensions point to the @Bike extension for autocomplete types … and those locations have changed. And that means tsconfig.json files needed to change.

If you are playing with @Startup or your own extension your best bet to get everything working well might be:

  1. Move your customized @Startup extension to backup location.
  2. Launch Bike so that it will recreate @Startup with new structure
  3. Move your changes back into project

Open in VS Code and verify that autocomplete and type checking are working properly. Note that when editing files in src/dom you should get different autocomplete options… HTML/DOM API should be available, while most of Bike app API should not be available.