fix(drafts): Various improvements and fixes to drafts, draft state management
Summary:
This diff contains a few major changes:
1. Scribe is no longer used for the text editor. It's just a plain contenteditable region. The toolbar items (bold, italic, underline) still work. Scribe was causing React inconcistency issues in the following scenario:
- View thread with draft, edit draft
- Move to another thread
- Move back to thread with draft
- Move to another thread. Notice that one or more messages from thread with draft are still there.
There may be a way to fix this, but I tried for hours and there are Github Issues open on it's repository asking for React compatibility, so it may be fixed soon. For now contenteditable is working great.
2. Action.saveDraft() is no longer debounced in the DraftStore. Instead, firing that action causes the save to happen immediately, and the DraftStoreProxy has a new "DraftChangeSet" class which is responsbile for batching saves as the user interacts with the ComposerView. There are a couple big wins here:
- In the future, we may want to be able to call Action.saveDraft() in other situations and it should behave like a normal action. We may also want to expose the DraftStoreProxy as an easy way of backing interactive draft UI.
- Previously, when you added a contact to To/CC/BCC, this happened:
<input> -> Action.saveDraft -> (delay!!) -> Database -> DraftStore -> DraftStoreProxy -> View Updates
Increasing the delay to something reasonable like 200msec meant there was 200msec of lag before you saw the new view state.
To fix this, I created a new class called DraftChangeSet which is responsible for accumulating changes as they're made and firing Action.saveDraft. "Adding" a change to the change set also causes the Draft provided by the DraftStoreProxy to change immediately (the changes are a temporary layer on top of the database object). This means no delay while changes are being applied. There's a better explanation in the source!
This diff includes a few minor fixes as well:
1. Draft.state is gone—use Message.object = draft instead
2. String model attributes should never be null
3. Pre-send checks that can cancel draft send
4. Put the entire curl history and task queue into feedback reports
5. Cache localIds for extra speed
6. Move us up to latest React
Test Plan: No new tests - once we lock down this new design I'll write tests for the DraftChangeSet
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1125
2015-02-04 08:24:31 +08:00
|
|
|
{
|
2017-09-06 04:37:40 +08:00
|
|
|
"name": "mailspring-root",
|
2017-02-17 06:53:20 +08:00
|
|
|
"version": "0.0.1",
|
2017-09-06 04:37:40 +08:00
|
|
|
"description": "Packages required to develop and build Mailspring",
|
|
|
|
"author": "Mailspring",
|
2017-08-12 02:38:25 +08:00
|
|
|
"license": "GPL-3.0",
|
|
|
|
"repository": {
|
|
|
|
"type": "git",
|
2017-09-06 04:37:40 +08:00
|
|
|
"url": "git+https://github.com/Foundry376/Mailspring.git"
|
2017-08-12 02:38:25 +08:00
|
|
|
},
|
|
|
|
"engines": {
|
2019-06-11 14:00:12 +08:00
|
|
|
"node": "11.x"
|
2017-08-12 02:38:25 +08:00
|
|
|
},
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
"devDependencies": {
|
2019-03-05 03:03:12 +08:00
|
|
|
"@types/better-sqlite3": "^5.2.2",
|
|
|
|
"@types/classnames": "^2.2.7",
|
|
|
|
"@types/debug": "^4.1.2",
|
|
|
|
"@types/deep-extend": "^0.4.31",
|
|
|
|
"@types/electron-spellchecker": "^1.1.1",
|
|
|
|
"@types/enzyme": "^3.9.0",
|
|
|
|
"@types/enzyme-adapter-react-16": "^1.0.5",
|
|
|
|
"@types/event-kit": "^2.4.0",
|
|
|
|
"@types/fs-plus": "^3.0.1",
|
|
|
|
"@types/graceful-fs": "^4.1.3",
|
|
|
|
"@types/jasmine": "^1.3.1",
|
|
|
|
"@types/keytar": "^4.0.1",
|
|
|
|
"@types/lru-cache": "^5.1.0",
|
|
|
|
"@types/mkdirp": "^0.5.2",
|
|
|
|
"@types/moment-round": "^1.0.3",
|
|
|
|
"@types/moment-timezone": "^0.5.10",
|
|
|
|
"@types/mousetrap": "^1.6.1",
|
|
|
|
"@types/node-emoji": "^1.8.1",
|
|
|
|
"@types/optimist": "^0.0.29",
|
|
|
|
"@types/proxyquire": "^1.3.28",
|
|
|
|
"@types/raven": "^2.5.3",
|
|
|
|
"@types/react": "^16.8.5",
|
|
|
|
"@types/react-color": "^2.14.1",
|
|
|
|
"@types/react-dom": "^16.8.2",
|
|
|
|
"@types/react-test-renderer": "^16.8.1",
|
|
|
|
"@types/react-transition-group": "^1.1.6",
|
|
|
|
"@types/reflux": "^6.4.2",
|
|
|
|
"@types/rimraf": "^2.0.2",
|
|
|
|
"@types/rx-lite": "^4.0.6",
|
2019-06-11 08:15:07 +08:00
|
|
|
"@types/slate": "^0.44.10",
|
2019-03-05 03:03:12 +08:00
|
|
|
"@types/slate-base64-serializer": "^0.2.2",
|
|
|
|
"@types/slate-html-serializer": "^0.6.3",
|
|
|
|
"@types/slate-plain-serializer": "^0.6.1",
|
2019-06-11 08:15:07 +08:00
|
|
|
"@types/slate-react": "^0.22.1",
|
2019-03-05 03:03:12 +08:00
|
|
|
"@types/source-map-support": "^0.4.2",
|
|
|
|
"@types/temp": "^0.8.33",
|
|
|
|
"@types/underscore": "^1.8.9",
|
|
|
|
"@types/underscore.string": "^0.0.33",
|
|
|
|
"@types/uuid": "^3.4.4",
|
2021-01-19 14:39:32 +08:00
|
|
|
"@typescript-eslint/eslint-plugin": "^4.7.0",
|
|
|
|
"@typescript-eslint/parser": "^4.7.0",
|
2017-02-18 02:47:01 +08:00
|
|
|
"chalk": "1.x.x",
|
2017-07-11 02:37:26 +08:00
|
|
|
"devtron": "^1.4.0",
|
2020-08-17 06:32:13 +08:00
|
|
|
"electron": "4.2.12",
|
2017-02-18 02:47:01 +08:00
|
|
|
"electron-installer-dmg": "0.2.x",
|
2020-02-25 08:29:38 +08:00
|
|
|
"electron-packager": "14.2.x",
|
2017-03-14 06:48:45 +08:00
|
|
|
"electron-winstaller": "2.x.x",
|
2021-01-19 14:39:32 +08:00
|
|
|
"eslint": "7.13.0",
|
|
|
|
"eslint-config-prettier": "7.2.0",
|
|
|
|
"eslint-plugin-react": "7.22.0",
|
2017-02-22 03:33:00 +08:00
|
|
|
"fs-extra": "2.x.x",
|
|
|
|
"fs-plus": "2.x.x",
|
2017-08-12 02:38:25 +08:00
|
|
|
"gitbook-cli": "^2.3.2",
|
|
|
|
"gitbook-plugin-anchors": "^0.7.1",
|
|
|
|
"gitbook-plugin-editlink": "^1.0.2",
|
|
|
|
"gitbook-plugin-favicon": "0.0.2",
|
|
|
|
"gitbook-plugin-github": "^2.0.0",
|
|
|
|
"gitbook-plugin-theme-api": "^1.1.2",
|
2017-02-22 03:33:00 +08:00
|
|
|
"glob": "7.x.x",
|
2017-02-17 06:53:20 +08:00
|
|
|
"grunt": "0.4.x",
|
|
|
|
"grunt-cli": "0.1.x",
|
|
|
|
"grunt-contrib-csslint": "0.5.x",
|
|
|
|
"grunt-contrib-less": "0.8.x",
|
|
|
|
"grunt-lesslint": "0.13.x",
|
2020-02-20 13:25:02 +08:00
|
|
|
"handlebars": "^4.7.3",
|
2017-03-04 06:17:18 +08:00
|
|
|
"jasmine": "2.x.x",
|
2017-08-12 02:38:25 +08:00
|
|
|
"joanna": "0.0.9",
|
2019-01-01 09:40:47 +08:00
|
|
|
"license-extractor": "^1.0.4",
|
2019-02-05 13:54:38 +08:00
|
|
|
"load-grunt-parent-tasks": "^0.1.2",
|
2017-08-12 02:38:25 +08:00
|
|
|
"meta-marked": "^0.4.2",
|
2020-08-17 21:30:44 +08:00
|
|
|
"node-gyp": "^7.1.0",
|
2017-03-07 16:24:07 +08:00
|
|
|
"mkdirp": "^0.5.1",
|
2018-01-25 06:13:08 +08:00
|
|
|
"prettier": "^1.10.0",
|
2019-02-05 13:54:38 +08:00
|
|
|
"request": "^2.88.0",
|
2017-08-12 02:38:25 +08:00
|
|
|
"rimraf": "^2.6.1",
|
2017-10-24 01:51:32 +08:00
|
|
|
"targz": "^1.0.1",
|
2017-02-22 03:33:00 +08:00
|
|
|
"temp": "0.8.x",
|
2021-01-19 14:39:32 +08:00
|
|
|
"typescript": "3.9.7",
|
2017-02-22 03:33:00 +08:00
|
|
|
"underscore": "1.8.x"
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
},
|
fix(drafts): Various improvements and fixes to drafts, draft state management
Summary:
This diff contains a few major changes:
1. Scribe is no longer used for the text editor. It's just a plain contenteditable region. The toolbar items (bold, italic, underline) still work. Scribe was causing React inconcistency issues in the following scenario:
- View thread with draft, edit draft
- Move to another thread
- Move back to thread with draft
- Move to another thread. Notice that one or more messages from thread with draft are still there.
There may be a way to fix this, but I tried for hours and there are Github Issues open on it's repository asking for React compatibility, so it may be fixed soon. For now contenteditable is working great.
2. Action.saveDraft() is no longer debounced in the DraftStore. Instead, firing that action causes the save to happen immediately, and the DraftStoreProxy has a new "DraftChangeSet" class which is responsbile for batching saves as the user interacts with the ComposerView. There are a couple big wins here:
- In the future, we may want to be able to call Action.saveDraft() in other situations and it should behave like a normal action. We may also want to expose the DraftStoreProxy as an easy way of backing interactive draft UI.
- Previously, when you added a contact to To/CC/BCC, this happened:
<input> -> Action.saveDraft -> (delay!!) -> Database -> DraftStore -> DraftStoreProxy -> View Updates
Increasing the delay to something reasonable like 200msec meant there was 200msec of lag before you saw the new view state.
To fix this, I created a new class called DraftChangeSet which is responsible for accumulating changes as they're made and firing Action.saveDraft. "Adding" a change to the change set also causes the Draft provided by the DraftStoreProxy to change immediately (the changes are a temporary layer on top of the database object). This means no delay while changes are being applied. There's a better explanation in the source!
This diff includes a few minor fixes as well:
1. Draft.state is gone—use Message.object = draft instead
2. String model attributes should never be null
3. Pre-send checks that can cancel draft send
4. Put the entire curl history and task queue into feedback reports
5. Cache localIds for extra speed
6. Move us up to latest React
Test Plan: No new tests - once we lock down this new design I'll write tests for the DraftChangeSet
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1125
2015-02-04 08:24:31 +08:00
|
|
|
"scripts": {
|
2017-08-12 02:38:25 +08:00
|
|
|
"postinstall": "node scripts/postinstall.js",
|
2017-09-02 14:22:35 +08:00
|
|
|
"start": "node_modules/.bin/electron ./app --enable-logging --dev",
|
2017-08-12 02:38:25 +08:00
|
|
|
"lint": "grunt lint --gruntfile=app/build/Gruntfile.js --base=./",
|
2017-09-02 14:22:35 +08:00
|
|
|
"test": "node_modules/.bin/electron ./app --enable-logging --test",
|
|
|
|
"test-window": "node_modules/.bin/electron ./app --enable-logging --test=window",
|
2017-08-11 10:23:40 +08:00
|
|
|
"build": "grunt build-client --gruntfile=app/build/Gruntfile.js --base=./",
|
2017-09-01 03:27:07 +08:00
|
|
|
"build-docs": "grunt docs --gruntfile=app/build/Gruntfile.js --base=./ && mkdir -p app/dist-docs && cp README.md ./app/build/docs_src/README.md && gitbook --gitbook=latest build . ./app/dist-docs --log=debug --debug && rm ./app/build/docs_src/README.md && rm -rf ./app/build/docs_src/classes",
|
2019-01-01 09:40:47 +08:00
|
|
|
"build-licenses-file": "cat ./app/static/all_licenses_preamble.html | ./node_modules/.bin/marked > ./app/static/all_licenses.html && licext --source ./app --mode output | ./node_modules/.bin/marked >> ./app/static/all_licenses.html",
|
2017-09-01 03:27:07 +08:00
|
|
|
"ci-setup-mac-keychain": "grunt setup-mac-keychain --gruntfile=app/build/Gruntfile.js --base=./"
|
fix(drafts): Various improvements and fixes to drafts, draft state management
Summary:
This diff contains a few major changes:
1. Scribe is no longer used for the text editor. It's just a plain contenteditable region. The toolbar items (bold, italic, underline) still work. Scribe was causing React inconcistency issues in the following scenario:
- View thread with draft, edit draft
- Move to another thread
- Move back to thread with draft
- Move to another thread. Notice that one or more messages from thread with draft are still there.
There may be a way to fix this, but I tried for hours and there are Github Issues open on it's repository asking for React compatibility, so it may be fixed soon. For now contenteditable is working great.
2. Action.saveDraft() is no longer debounced in the DraftStore. Instead, firing that action causes the save to happen immediately, and the DraftStoreProxy has a new "DraftChangeSet" class which is responsbile for batching saves as the user interacts with the ComposerView. There are a couple big wins here:
- In the future, we may want to be able to call Action.saveDraft() in other situations and it should behave like a normal action. We may also want to expose the DraftStoreProxy as an easy way of backing interactive draft UI.
- Previously, when you added a contact to To/CC/BCC, this happened:
<input> -> Action.saveDraft -> (delay!!) -> Database -> DraftStore -> DraftStoreProxy -> View Updates
Increasing the delay to something reasonable like 200msec meant there was 200msec of lag before you saw the new view state.
To fix this, I created a new class called DraftChangeSet which is responsible for accumulating changes as they're made and firing Action.saveDraft. "Adding" a change to the change set also causes the Draft provided by the DraftStoreProxy to change immediately (the changes are a temporary layer on top of the database object). This means no delay while changes are being applied. There's a better explanation in the source!
This diff includes a few minor fixes as well:
1. Draft.state is gone—use Message.object = draft instead
2. String model attributes should never be null
3. Pre-send checks that can cancel draft send
4. Put the entire curl history and task queue into feedback reports
5. Cache localIds for extra speed
6. Move us up to latest React
Test Plan: No new tests - once we lock down this new design I'll write tests for the DraftChangeSet
Reviewers: evan
Reviewed By: evan
Differential Revision: https://review.inboxapp.com/D1125
2015-02-04 08:24:31 +08:00
|
|
|
}
|
|
|
|
}
|