signal-desktop/js/modules
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
2018-04-06 08:13:00 -07:00
..
migrations Allow database name override in migrations 2018-04-03 11:45:10 -04:00
types Rename willHaveAttachmentsSavedOnFileSystemDuringUpgrade 2018-04-04 19:11:46 -04:00
views Remove type annotation 2018-03-26 16:56:37 -04:00
.eslintrc Auto-fixes: UX Improvements (#2077) 2018-03-02 15:54:15 -05:00
auto_orient_image.js Auto-orient image attachments based on EXIF metadata 2018-02-21 10:28:13 -05:00
backup.js Rename createImporter to createAttachmentDataWriter 2018-04-04 19:11:46 -04:00
crypto.js Encryption support for backup and restore 2018-03-20 11:53:54 -07:00
database.js Support database upgrades in Database.open 2018-04-03 11:44:50 -04:00
debug.js Use create* prefix to clarify curried functions 2018-04-03 15:25:24 -04:00
debuglogs.js Document workaround for got FormData bug 2018-03-08 16:21:27 -05:00
deferred_to_promise.js Extract deferredToPromise 2018-04-02 12:17:36 -04:00
global_errors.js Rename Errors to GlobalErrors for clarity 2018-03-08 16:22:38 -05:00
i18n.js Remove 'use strict' from i18n.js 2018-04-05 13:42:41 -07:00
idle_detector.js Replace startup with attachment background migration 2018-04-02 20:07:07 -04:00
logs.js Refactor: db tasks to database.js, log delete to modules/logs.js 2018-03-14 14:42:15 -07:00
messages_data_migrator.js Rename count to numMessagesPerBatch 2018-04-03 14:43:17 -04:00
os.js Add OS module 2018-03-05 10:29:11 -05:00
privacy.js Destructure Lodash requires 2018-04-02 15:12:04 -04:00
settings.js Add Signal.Startup module 2018-04-04 18:10:52 -04:00
sleep.js Add sleep module 2018-04-02 12:17:36 -04:00
startup.js Add Signal.Startup module 2018-04-04 18:10:52 -04:00
string_to_array_buffer.js Use double quotes for identifiers in error messages 2018-03-26 16:38:34 -04:00