zadam / trilium-web-clipper

Save web clippings to Trilium Notes.
GNU General Public License v3.0
258 stars 53 forks source link

Local extension development issues #22

Open siralmat opened 4 years ago

siralmat commented 4 years ago

I forked the repo to make a few changes (e.g. adding keyboard shortcuts) and ran into some teething problems while getting a local build up and running. I got there in the end, but wanted to share my experiences and suggest adding a short development section to the readme to help others get started.

  1. The April commit 338f01be0199ee0c229a51996ddfcdcae2de1380 replaced browser-polyfill.js with its npm package; previously the compiled library was included. I assumed this was unintentional and just dropped in the updated library.
  2. When running in a dev environment, the extension uses a different port range to connect to the desktop client. I fixed this by specifying the port in the extension options, but I think a note in the readme would be helpful. A couple of related points:
    • Viewing the current port from inside the client (MacOS) is a little non-obvious. I found it by opening the backend log and scrolling back to the server startup message. I can't see a way to change the port within the UI either.
    • It seems that the port scan will trigger every 60s indefinitely, which seems unnecessary when Trilium will likely remain available on the same port. After finding a client, shouldn't the extension persist the port for the session and only trigger a new scan if a connection fails? Can local scans be disabled for cases where the user only has a server instance?
  3. The release scripts depend on sponge, jq, and the GNU date utility (the iso-8601 option is not supported on MacOS). Of course, not an issue for anyone other than the project owner anyway... just including for the sake of completeness 😜

Thanks for all your hard work on Trilium and this extension! I have keyboard shortcuts working (shockingly simple to implement) and am planning to submit a PR if that's OK, though the default shortcuts need testing to make sure they're valid for other platforms.

zadam commented 4 years ago

Hi, I haven't looked at the web clipper project in a while. What you're writing makes sense, if you feel like fixing some of those issues, then feel free to drop some PR.

I will be also eagerly awaiting the PR for keyboard shortcuts :-)