-
Notifications
You must be signed in to change notification settings - Fork 13
Create a developer mode command to ease development #295
Conversation
Unfortunately, the approach above doesn't work due to mozilla/web-ext#2122 |
@Dexterp37 I just closed mozilla/web-ext#2122, but only because it was a duplicate of mozilla/web-ext#2104, it is a valid issue and (as we agreed in our triage meeting today) supporting |
This adds `npm run watch` to allow developers running a single command, build the ui and the addon and automatically watch for changes (and live reload it in the browser).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that this is printed on the console:
Your application is ready~! 🚀
- Local: http://localhost:5000
- Network: Add `--host` to expose
However that link doesn't work since this page is not in moz-extension://
, so the polyfill library throws:
Uncaught Error: This script should only be loaded in a browser extension.
Related is that Svelte does not auto-reload the UI when loaded in moz-extension://
, presumably because the livereloadscript
thing it injects into the bundle doesn't work here.
So I'd ask that we suppress that message about the localhost
server being ready, because that will just confuse new developers.
I think that it might be possible to make livereload actually work in extension context, but this feels unimportant compared to the overall greatness of this change :) Something to look into in the future maybe.
Ah yeah this happens when it tries in
|
Hm, are you certain this is the cause? If it were that bug, I'd think that the options page would close out from under you. I think the add-on being loaded as temporary by However as I said in the review comment I am totally down with deferring all of this until later :) |
Yep, I'm aware that isn't working. If it weren't for the bug mentioned in the PR description, it would still work: web-ext reloads the extension, but Firefox is not closing the option window and re-opening it (it should do that). |
Would you mind splitting this out to a separate issue? It needn't block this one :) (edit: I think you are right about the fix for that Firefox bug helping us if the fix is to reload the options page automatically, I was confusing it with this bug) |
Filed #498 |
This introduces a 'watch' command. The command uses rollup to watch for UI and addon changes, updates the packed files, and makes sure web-ext picks up the changes. This fixes #3.
Unfortunately, if the rally control panel (addon options page) is open, that specific page does not get refreshed. User must refresh it manually or close/reopen that tab. That's due to a bug in Firefox.
Checklist for reviewer:
CHANGELOG.md
entry for any non-test change.