There's no global exports set and "the bundle is just going to be run directly by the browser" is correct, so I renamed the file to .js.
Additionaly I'm bringing back the Service-Worker-Allowed header because (now that I understand it better) this service worker should have all tabs in scope and needs to be able to claim them all (for example to focus on them after clicking the notification). It's not like it handles only some part of the website.
- Queries
- All Stories
- Search
- Advanced Search
- Transactions
- Transaction Logs
Advanced Search
Feb 20 2023
- Changed suffix from .cjs to .js
- Added babel config to strip flow types
Feb 17 2023
Moved the code to the push/providers.js and use importJSON. I'm no longer caching the config myself because importJSON does the caching. Added logging and invariant.
I'm a bit confused here. commonjs2 isn't an option for target [...]
Sorry, I shouldn't have used the word "target", I meant this option: output.module. In the generated file I can see some webpack boilerplate that defines properties on the exports object so the file should be cjs.
Feb 15 2023
- Changed formatting, remove Service-Worker-Allowed header (it's actually not needed if we don't specify a custom scope during registration)
- Tested on prod mode and amended the test plan
- Hot-reloading was already discussed in D6715
- From what I understand the default target for webpack is CommonJS so .cjs should be correct.
Feb 14 2023
Answers to questions:
- How will this WebWorker code be loaded, and when will it be re-downloaded from the server? Does it redownload only when all tabs are closed?
The service worker will be downloaded during every page load with navigator.serviceWorker.register('<url to this file>'). If it's different (by comparing bytes) than the previously active service worker (from the same url) it will replace it when all of the tabs are closed (so there's always only one active service worker for all tabs), although this can be overridden.
Rename sw.js -> service-worker.js, change color, use env.prod.
Changed formatting, updated the test plan
Keep the error text
Feb 13 2023
Rebase
Feb 10 2023
Currently, the scroll applies to the whole community picker and not just to the community drawer:
So settings aren't immediately visible and you have to scroll to them. Was it decided somewhere that it should work like this?
Feb 9 2023
Feb 8 2023
Feb 7 2023
The change in theme.css also changed the color of some of the other buttons. For example:
the "Create new chat" now has a different color and doesn't match the settings cog.
Feb 6 2023
Looks good to me (although the code comment now feels a little bit unnecessary).
Feb 3 2023
Feb 1 2023
Move flow-mono to root
Revert accidental formatting changes.
Add native to the dockerfile, because the postinstall.sh requires native to work.
Jan 31 2023
Changed the name to reflect that it's ms. We can't simplify the calls because these methods need to be binded to the autoUpdater object.
After more testing it seems that autoUpdater methods have to be binded to the object so I've changed the typings from type to class.
Fix keyserver dockerfile
Try moving postinstall from native to root.
Jan 30 2023
Ok, I'm not sure why that fixed CI. Not sure if this is the best solution, but I was just trying things. Here are some failed builds from previous revisions: buildkite1, buildkite2, buildkite3.
Add newlines, remove --production.
Change auto updating logic.
Marked props available only on macOS as optional, thanks for catching that. I've also added a few additional events, because I will be using some of them in the next diffs.
Jan 26 2023
I think I've figured out why it's working. The values in the workspaces in the root package.json can be glob patterns. So you can do something like this:
"workspaces": [ "packages/*" ]
So if we just have for example "keyserver" in there it's treated as a glob pattern and it just doesn't match anything.
Now we copy all files from the folder. Additionally, in the previous diff I changed the directory to be a yarn workspace member so now this dockerfile has to be build in the context of the root folder. I've added docker-compose.yml to make that explicit. Note that I don't copy package.json's from all of the workspace members to make the build faster. yarn seems to handle it fine and just ignore the non-existant workspace members. But we can do it more like the keyserver dockerfile and build the whole monorepo if that's prefered.
Is this a hypothetical scenario, or were you able to observe it?
I wasn't able to observe it because native takes much longer than electron-update-server to install but I've tested it by making a small repo with this structure:
- workspace
- workspace member A, that has one dependency depA
- workspace member B, that has one dependency depB
(Neither depA not depB are members of the workspace).
I was able to get this order of postinstall scripts:
- depB
- B
- depA
- A
- workspace
So postinstall scripts run as soon as all dependencies were installed.
Jan 25 2023
Can you clarify this scenario a bit more?
Something like this:
- yarn cleaninstall is run and everything is cleaned
- All native dependencies are installed
- postinstall in native is called (-> hazel is not patched because it doesn't exist in the node_modules yet)
- All electron-update-server dependencies are installed
In the end hazel is installed but isn't patched
Updated the test plan, added flow to lint-staged (desktop is already added, I just forgot about this file), added flow typed for express to electron-update-server instead on relying on types in keyserver.
Jan 24 2023
Fix unnecessary dockerfile formatting
Move the patch to the root level.
Make it a proper workspace, use flow and ESM.
Jan 23 2023
Add comment
Add comment
Whoops, yeah, I updated the description :)
Jan 20 2023
Jan 13 2023
Jan 11 2023
Change types of objects described as "modules" in the electron documentation, from class to type. This matches their behaviour better (their methods aren't binded).
Jan 9 2023
Responding to @ashoat questions:
Keep comments for flow-typed generated stub
Add lib dependency.
Add flow-typed dep, add newlines, add to GitHub and Buildkite CI.
Jan 5 2023
Additionally, in a few places, we could use margin and padding shorthand properties instead of margin-top etc. But I'm not that experienced in css so I'm not sure which is preferred.
Jan 4 2023
Is there a reason why we don't just have a disabled property in props?
Remove pull_request trigger
Fix issues with postinstall.sh
Jan 3 2023
Will the push trigger run after pr merge?
Dec 30 2022
Moved code a bit.
Dec 29 2022
Rebased. Changed link to the icon hosted on aws.