You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-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
7 years ago
..
migrations Allow database name override in migrations 7 years ago
types Rename `willHaveAttachmentsSavedOnFileSystemDuringUpgrade` 7 years ago
views Remove type annotation 7 years ago
.eslintrc Auto-fixes: UX Improvements (#2077) 7 years ago
auto_orient_image.js Auto-orient image attachments based on EXIF metadata 7 years ago
backup.js Rename `createImporter` to `createAttachmentDataWriter` 7 years ago
crypto.js Encryption support for backup and restore 7 years ago
database.js Support database upgrades in `Database.open` 7 years ago
debug.js Use `create*` prefix to clarify curried functions 7 years ago
debuglogs.js Document workaround for `got` `FormData` bug 7 years ago
deferred_to_promise.js Extract `deferredToPromise` 7 years ago
global_errors.js Rename `Errors` to `GlobalErrors` for clarity 7 years ago
i18n.js Remove 'use strict' from i18n.js 7 years ago
idle_detector.js Replace startup with attachment background migration 7 years ago
logs.js Refactor: db tasks to database.js, log delete to modules/logs.js 7 years ago
messages_data_migrator.js Rename `count` to `numMessagesPerBatch` 7 years ago
os.js Add `OS` module 7 years ago
privacy.js Destructure Lodash `require`s 7 years ago
settings.js Add `Signal.Startup` module 7 years ago
sleep.js Add `sleep` module 7 years ago
startup.js Add `Signal.Startup` module 7 years ago
string_to_array_buffer.js Use double quotes for identifiers in error messages 7 years ago