Separate linting from testing as follows:
- `yarn jscs`: Run JSCS.
- `yarn jshint`: Run JSHint.
- `yarn lint`: Run all linters, i.e. ESLint, TSLint, JSHint, and JSHint.
- `yarn test-node`: Run Mocha tests in Node.js environment.
- `yarn test-electron`: Run tests in Electron environment via Grunt.
- `yarn test`: Run all tests.
CI
- Align Travis and AppVeyor scripts as much as possible.
- Run linting before tests to fail fast.
- Run Node.js (headless and fast) tests first.
- Run Electron tests last (Travis seems to require custom setup in `travis.sh`).
It only has the minimum required dependencies:
- `linkify-it`: Best-in-class link detection library with support for
Unicode/IDN.
- `escape-html`: Standalone dependency for escaping HTML.
- `uc.micro`: Standalone dependency of Unicode data files.
- [x] Redact stack traces with both forward and backslashes.
- [x] Redact paths with escaped forward slashes.
- [x] Redact URL-encoded paths.
- [x] Minor: Use `is` vs Lodash `is*` for type checking.
- [x] Minor: Rename `Path` to `path`, etc.
- [x] Add ESLint `quotes` rule to allow double quotes to avoid escaping single quotes.
- [x] Consistently use single quotes to denote identifiers in error messages,
e.g. `'foo' is required`.
Quite a bit of change here.
First, the basics:
- New dependencies were added: react, typescript, tslint, and react-styleguidist
- A new npm script: transpile. It uses typescript to process .tsx files in js/react, putting .js files next to the original file. It's part of the watch functionality of grunt dev as well as the default task run with just grunt (used to build the app prior to release). A lighter-weight to get watch behavior when just working on React components is to run yarn transpile --watch.
- yarn run clean-transpile will remove generated .js files
Style guide via react-styleguidist. Example site: https://react-styleguidist.js.org/examples/basic/
- Start with yarn styleguide
- Component.md files right next to the .tsx file
- jsdoc-style comments are picked up and added to the generated part of the styleguide - the overall summary and a table listing methods and properties of the component
- It has hot-reloading!
- It uses webpack, which means that our app now pulls in webpack though we don't use it to generate anything for the production app.
- I did a bunch of work to enable the use of Backbone views in this context, which will allow us to move smoothly from the old world to the new. First, add all the permutations in the old way, and then slowly start to re-render those same views with React.
A bit of dependency cleanup to enable use in React components:
- moment was moved from our Bower dependencies to our npm dependencies, so it can be used in React components not running in a browser window.
- i18n was moved into the new commonjs format, so it can be used in React components even if window is not available.
Lastly, a bit of Gruntfile cleanup:
- Removal of Chrome App-era modifications of background.js
- Make jshint/jscs watch more targeted, since more and more we'll be using other tools
Split out test-specific and general utility react components too.
And moved our test/legacy* files for the Style Guide into a styleguide/
subdirectory of test/.
I think we'll be able to live in this directory structure for a while.
Update to electron 1.8.4 (#2186)
Migrate all attachments from IndexedDB to file system in the background (#2208, #2193, #2165, #2162, #2129)
Save attachments to disk when importing Chrome app export (#2212)
Fixed: Read receipts setting would not be synchronized along with re-link (#2218)
Fixed: Clicking conversation in left pane when already selected would remove focus on message composition field - thanks
@colefranz! (#2032)
Fixed: Searching for the phone number of an existing contact, then selecting 'start conversation' would erase contact details (#2191)
Fixed: Selecting Settings menu option multiple times would open multiple instances of settings view - thanks @navdeepsinghkhalsa (#2167)
Dev:
- Relax Node.js version requirements (#2203)
- Fix a few typos in documentation - thanks @Vinnl (#2171)
- Update issue template to mention that translation should be via Transifex (#2157)
This helps running a Signal Desktop instance from a backup (copy of profile
folder) when testing functionality such as database migrations, import/export,
etc.
Usage:
```
BACKUP=development-backup-2018-04-04 PROFILE=development ./scripts/start-backup
```
WARNING: This deletes the original profile and overwrites it with backup.
Due to a number of hacks, the style guide can be used to show Backbone
views. This will allow a smooth path from the old way of doing things to
the new.