We missed a couple directories with previous attempts to turn this on
globally: app/ and libtextsecure/
Not to mention files in places we didn't expect: ts files that weren't
in the ts directory!
This turns prettier on for every file we care about (js, ts, tsx, md)
everywhere in the project but for a few key parts.
Linux: deb (dropped zip)
Mac: zip (dropped dmg)
Windows: exe (dropped zip)
We can always re-add if people are relying on these things. But our
download links all point to these assets, so we'll generate and upload
only these for now.
Media Gallery showing all attachments in a given conversation (#2291, previous: #2236)
Quotes:
- Show 'You' in Android theme instead of your own contact name (#2312)
- Show thumbnails for quotes of messages with video attachments (#2293)
Video attachments: show first frame preview in composition area (#2293)
Increase speed of migration to move attachments to disk from database (#2314)
Dev:
- Add comments clarifying our mechanisms for stripping EXIF info (#2313)
- Move to prettierjs to format our code (#2303)
- Fix break in styleguide; make filesize/Signal.Util.GoogleChrome available (#2302)
- Remove duplicate entry from .gitignore (#2271)
Adopt Prettier code formatting for our entire project to reduce overhead of
formatting code. I considered adding a pre-commit hook but to make the change
more gradual, I recommend installing an editor plugin that runs Prettier on
save, e.g. `JsPrettier` for *Sublime Text*, or manually run `yarn format`.
Also: This PR makes no other changes to linting. ESLint is still opt-in as it
requires more changes than just formatting an can be done on a as-needed basis
when touching particular files (as we have done in the past.) On the other hand,
the ESLint required changes will now be smaller as they won’t involve large
formatting changes.
## Sublime Text Plugin
- Install **JsPrettier**: https://github.com/jonlabelle/SublimeJsPrettier
- Settings:
```
{
"prettier_cli_path": "./node_modules/.bin/prettier",
"auto_format_on_save": true,
"auto_format_on_save_requires_prettier_config": true,
}
```
## Changes
- [x] Disable conflicting ESLint rules
- [x] Exclude generated files and `libtextsecure`
- [x] Autoformat all JS and TS code (excluding CSS and JSON)
- [x] Apply isolated manual one-time fixes:
80bc06486e
- [x] Goodbye Vim modelines!
7b6e77d566
- [x] Ensure automated tests pass
- [x] Ensure app still works (smoke test)
- [x] Render list of document items
- [x] Add support for video in lightbox
- [x] Save attachments:
- [x] Port the following `AttachmentView` methods to support attachment file
saving in React:
- [x] `getFileType`
- [x] `suggestedName`
- [x] `saveFile`
- [x] Add click to save for document list entries
- [x] Add save button for media attachment in lightbox
- [x] Run background migration based on `schemaIndex` to populate media gallery
- [x] Implement navigation in media gallery
- [x] Previous and next buttons
- [x] Previous and next via keyboard
- [x] Empty state
- [x] Fix layout issue in iOS theme
- [x] Don’t run attachment migration for new users
- [x] Preprocess media before rendering in React