Commit Graph

3636 Commits (513d9a5d5c64db73cc5f6737c151aa306a7386cd)
 

Author SHA1 Message Date
Daniel Gasienica 513d9a5d5c Run Node.js tests early 7 years ago
Daniel Gasienica 7cb43c9f7f Add TSLint rules 7 years ago
Daniel Gasienica 6f4d0e1449 Use project for TSLint 7 years ago
Daniel Gasienica e052d1df7b Use generic array syntax for consistency
Always prefer `Array<T>` over `T[]` for primitive types only.
7 years ago
Daniel Gasienica 15d221ae0e Simplify testing and linting
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`).
7 years ago
Daniel Gasienica 80de7bbd5c Compile TypeScript files on Travis CI 7 years ago
Daniel Gasienica d6b40a3e94 Explicitly point to TSLint configuration
AppVeyor seems to ignore our configuration.
7 years ago
Daniel Gasienica b8bbed3ec9 Compile and lint TypeScript on AppVeyor 7 years ago
Daniel Gasienica d7b845326d ESLint auto-fix `link_text` 7 years ago
Daniel Gasienica 9d41b86162 Remove escaping from `linkText`
We leverage jQuery’s HTML escaping in `$.html(…)`.
7 years ago
Daniel Gasienica f04c65088b Fork `link-text` module 7 years ago
Daniel Gasienica d9381c543e Add `linkify-it` dependency 7 years ago
Daniel Gasienica ac50713f86 Improve auto-linking of URLs in messages
Fixes #598.
7 years ago
Daniel Gasienica 144cb58a47 Add `HTML` module for rendering messages 7 years ago
Daniel Gasienica 7d4ef9315b Add `yarn test-ts` 7 years ago
Daniel Gasienica f38370f40e Add custom type definition for `link-text` 7 years ago
Daniel Gasienica 6f8dee402d Add `@types/mocha` 7 years ago
Daniel Gasienica 7ac4bee959 Add `@types/chai` 7 years ago
Daniel Gasienica 78ba4eddc1 Add `@types/lodash` 7 years ago
Daniel Gasienica f5641fe6d6 Add `link-text` dependency
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.
7 years ago
Daniel Gasienica 9b22e0667a
Redact More Variants Of Paths In Stack Traces (#2229)
- [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`.
7 years ago
Daniel Gasienica 24f4ad53bc Use single quotes for identifiers 7 years ago
Daniel Gasienica 819671a23a Add ESLint `quotes` rule 7 years ago
Daniel Gasienica 432a6ebd7f Redact file paths with escaped slashes 7 years ago
Daniel Gasienica d41e3cd6fc Add test for regular `_redactPath` 7 years ago
Daniel Gasienica a8a7525609 Redact stack traces with forward and backslashes 7 years ago
Daniel Gasienica b0da7d965e Redact URL encoded file paths in stack traces 7 years ago
Daniel Gasienica f2c9ccae90 Prefer `is.*` over Lodash `is*` functions 7 years ago
Daniel Gasienica 2ee78ec556 Prefer `path` over `Path` 7 years ago
Scott Nonnenberg 8467352994
Rename file for Whisper.ReactWrapperView (#2232) 7 years ago
Scott Nonnenberg c6c3b65bbc
Introduce React, TypeScript, TSLint and React-StyleGuidist (#2219)
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
7 years ago
Scott Nonnenberg 96bd90a4e0
Simplify assignment; add warning to preload.js about Style Guide 7 years ago
Scott Nonnenberg 05303233fb
window.Signal.React -> window.Signal.Components 7 years ago
Scott Nonnenberg 23537546fe
Big refactor: ts/ directory for all typescript, including react
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.
7 years ago
Scott Nonnenberg 50d4dbaae7
Remove 'use strict' from i18n.js 7 years ago
Scott Nonnenberg 76be13552f
js/i18n.js -> js/modules/i18n.js 7 years ago
Scott Nonnenberg e5322e8261
Finish rename of MessageParents, re-add moment to page
(we were getting crashes in the initial setup of a backbone view)
7 years ago
Scott Nonnenberg cdd16c9780
Rename test-only MessageParents to ConversationContext 7 years ago
Scott Nonnenberg 61a7846149
Fix typo in index.ts 7 years ago
Scott Nonnenberg 2384092e9e
Use Array.isArray in i18n.js 7 years ago
Scott Nonnenberg bb73d470a5
Gruntfile: Sort lines in jshint/jscs config 7 years ago
Scott Nonnenberg 23293a3c00
New tslint rule: Interfaces must not start with I 7 years ago
Scott Nonnenberg 1052341d79
Fix tslint errors and add tslint to CI task in package.json 7 years ago
Scott Nonnenberg be91a89d68
Parse theme from querystring, put on util. Moment from require()
We also fully set up i18n and put it on util as well as making
it available on windows.i18n for Backbone views.
7 years ago
Scott Nonnenberg 887abd75dd
Add missing shim, fix typo 7 years ago
Scott Nonnenberg ed12e1b076
Add mp3 to project, make binary files available in rsg on util 7 years ago
Scott Nonnenberg 104a1ca5d4
Remove i18n.js from jshint run, fix missing semicolon 7 years ago
Scott Nonnenberg ef6a0c1162
v1.7.0-beta.3
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)
7 years ago
Scott Nonnenberg 3899eb8d0b
Add 'use strict' to i18n.js 7 years ago
Daniel Gasienica e329c23aa0
Support Attachments On File System During Export + Import (#2212)
- [x] Load attachments into memory before export.
- [x] Save attachments to correct place in user profile upon import.
- [x] Upgrade message schema upon import.
- [x] Support both encrypted imports as well as unencrypted Chrome imports.

**Tests**

- [x] Export / import small database (25 messages) with some attachments already
      on disk (`schemaVersion >= 3`) and some not (`schemaVersion < 3`).
- [x] Import Chrome web app import (found and fixed issue with missing
      `schemaVersion`).
- [x] Export / import of real-world Signal Beta data (before: `IndexedDB`
      ~372MB / after: `IndexedDB` ~5.7MB / `attachments.noindex` ~234MB)
 
**Test commands:**

```javascript
// Export
let key = new Uint8Array([1, 3, 4, 5, 6, 7, 8, 11, 23, 34, 1, 34, 3, 5, 45, 45, 1, 3, 4, 5, 6, 7, 8, 11, 23, 34, 1, 34, 3, 5, 45, 45]);
Signal.Backup.exportToDirectory('/Users/<user>/Desktop/Signal-import-export-test', {key});

// Import
let key = new Uint8Array([1, 3, 4, 5, 6, 7, 8, 11, 23, 34, 1, 34, 3, 5, 45, 45, 1, 3, 4, 5, 6, 7, 8, 11, 23, 34, 1, 34, 3, 5, 45, 45]);
Signal.Backup.importFromDirectory('/Users/<user>/Desktop/Signal-import-export-test', {key});

// Import from Chrome
Signal.Backup.importFromDirectory('/Users/<user>/Desktop/Signal Export 2018 Apr 3 at 11.00.54 pm');
```
7 years ago