hypothesis / hypothesis/product-backlog

Make it easy to create & host custom builds of the Hypothesis client

Open
#357 1 comment 0 reactions 0 assignees View on GitHub
OAuth
Dominant language
No language data
Stars
122
Forks
7
PR merge metrics
No merged PRs in 30d

Description

Now that we have implemented OAuth, it is possible to create customized versions of the Hypothesis client which are not hosted on the hypothes.is domain, but which do use the production h service. This should enable people to customize the client for niches outside the domains we focus on, prototype features, or just hack on a cool idea they have.

The workflow I envision for devs wanting to host customized versions of the client is something like this:

1. Register an OAuth client with an associated origin / redirect URL where the client will be hosted
2. Hack on client
3. Run `gulp build`, using env vars to set the OAuth client ID
4. Upload the contents of the `build/` directory to the location registered in (1)
5. Add a reference to the `boot.js` script to pages where the dev wants to embed their customized client

There are some obstacles which make creating a custom build harder than it needs to be:

1. The sidebar's HTML page is part of the h service, not the client. We should now be able to build a basic "app.html" file as part of the client build.
2. The contents of the "build/" directory cannot just be uploaded somewhere because the full URL where the client and sidebar app HTML are hosted need to be baked into the code. With some tweaks to how the `assetRoot` and `sidebarAppUrl` URLs are discovered and how resource paths for scripts/styles are generated, we can make this much easier.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the client build invoked by `gulp build`, then trace how `build/`, `boot.js`, `assetRoot`, and `sidebarAppUrl` are generated or discovered. Determine how a basic `app.html` should be included and how hosted resource URLs should be formed. Done means the documented workflow can upload a custom build and embed it from a registered origin using the OAuth client ID.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
authentication, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.