Bike
Bike 2 (Preview)
Bike 2 (Preview)
  • Bike 2 (Preview)
  • Using Bike 2
    • Outline Editing
    • Using Selection
    • Using Extensions
    • Using Outline Paths
    • Using Outline Filtering
  • Customizing Bike
    • Creating Extensions
    • Extensions Tutorial
      • App Context Tutorial
      • DOM Context Tutorial
      • Style Context Tutorial
  • Known Bugs
Powered by GitBook
On this page
  • Create Extension
  • Build/Install Extension
  • Debug Extension
  • Next Steps
  1. Customizing Bike

Extensions Tutorial

Follow through this tutorial to get a good overview of what extensions can do.

The finished tutorial is included with the extension kit. If you get stuck and something doesn't work, check the finished tutorial to see what is different.

Create Extension

To create a new extension run the command:

npm run new

You are prompted for a name, and then the new extension is created for you in src.

Build/Install Extension

To build your extension run the command:

npm run build

New extension are set to install automatically. If you have Bike running then after building your new extension is loaded into Bike.

Debug Extension

There are two important sources for debugging your extension.

Logging

First use the Bike's logs explorer to see logging.

To view the log explorer:

  • Select the menu Bike > Window > Logs Explorer

Do that now and you should see logs that your extension is installed and activated. You will also see a notice originating from your extensions call to console.log in the activate function.

Safari Debugger

For more complex debugging tasks use Safari's debugger. This allows you to step line by line over your extension code and inspect variables.

To enable Safari's debugger:

  • Go to Safari > Settings > Advanced and check "Show features for web developers".

  • Go to Safari > Develop > Inspect Apps and Devices to see active contexts

  • Start Bike 2 and it should show in the Safari window from previous step.

In that window it will show all of Bike's Javascript contexts. Click on a context to open the debugger for that context. Then you can set breakpoints, examine variables, etc.

Next Steps

Follow these tutorials to learn how to use each context:

Last updated 1 day ago

App Context Tutorial
DOM Context Tutorial
Style Context Tutorial