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": {
|
2023-11-15 04:40:51 +08:00
|
|
|
"node": "^16.17",
|
2021-12-01 06:31:56 +08:00
|
|
|
"npm": ">=8"
|
2017-08-12 02:38:25 +08:00
|
|
|
},
|
2021-04-08 14:52:52 +08:00
|
|
|
"dependencies": {
|
2023-11-15 04:40:51 +08:00
|
|
|
"@types/better-sqlite3": "^7.6.3",
|
2021-12-02 01:01:15 +08:00
|
|
|
"@types/debug": "^4.1.2",
|
|
|
|
"@types/deep-extend": "^0.4.31",
|
|
|
|
"@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/lru-cache": "^5.1.0",
|
2019-03-05 03:03:12 +08:00
|
|
|
"@types/mkdirp": "^0.5.2",
|
|
|
|
"@types/moment-round": "^1.0.3",
|
2021-12-02 01:01:15 +08:00
|
|
|
"@types/mousetrap": "^1.6.1",
|
2019-03-05 03:03:12 +08:00
|
|
|
"@types/node-emoji": "^1.8.1",
|
2021-12-02 01:01:15 +08:00
|
|
|
"@types/optimist": "^0.0.29",
|
2019-03-05 03:03:12 +08:00
|
|
|
"@types/proxyquire": "^1.3.28",
|
2021-12-02 01:01:15 +08:00
|
|
|
"@types/raven": "^2.5.3",
|
|
|
|
"@types/react": "^16.8.5",
|
2019-03-05 03:03:12 +08:00
|
|
|
"@types/react-color": "^2.14.1",
|
2021-12-02 01:01:15 +08:00
|
|
|
"@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",
|
2019-03-05 03:03:12 +08:00
|
|
|
"@types/rx-lite": "^4.0.6",
|
2021-12-02 01:01:15 +08:00
|
|
|
"@types/slate": "^0.44.10",
|
2019-03-05 03:03:12 +08:00
|
|
|
"@types/slate-base64-serializer": "^0.2.2",
|
2021-12-02 01:01:15 +08:00
|
|
|
"@types/slate-html-serializer": "^0.6.3",
|
2019-03-05 03:03:12 +08:00
|
|
|
"@types/slate-plain-serializer": "^0.6.1",
|
2021-12-02 01:01:15 +08:00
|
|
|
"@types/slate-react": "^0.22.1",
|
2019-03-05 03:03:12 +08:00
|
|
|
"@types/source-map-support": "^0.4.2",
|
2021-12-02 01:01:15 +08:00
|
|
|
"@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",
|
2024-06-02 13:13:02 +08:00
|
|
|
"electron": "30.0.9",
|
2024-06-02 22:29:16 +08:00
|
|
|
"@electron/packager": "18.3.2",
|
2023-11-15 04:40:51 +08:00
|
|
|
"electron-winstaller": "5.1.x",
|
2021-12-01 04:11:12 +08:00
|
|
|
"eslint": "^7.32.0",
|
2021-01-19 14:39:32 +08:00
|
|
|
"eslint-config-prettier": "7.2.0",
|
2021-01-20 00:28:44 +08:00
|
|
|
"eslint-plugin-import": "^2.22.1",
|
|
|
|
"eslint-plugin-jsx-a11y": "^6.4.1",
|
2021-02-15 05:58:22 +08:00
|
|
|
"eslint-plugin-react": "7.22.0",
|
2017-02-22 03:33:00 +08:00
|
|
|
"fs-extra": "2.x.x",
|
|
|
|
"fs-plus": "2.x.x",
|
2021-12-01 04:11:12 +08:00
|
|
|
"gitbook-cli": "^0.1.0",
|
2017-08-12 02:38:25 +08:00
|
|
|
"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",
|
2021-12-01 04:11:12 +08:00
|
|
|
"grunt": "^1.4.1",
|
|
|
|
"grunt-cli": "^1.4.3",
|
2021-12-02 01:01:15 +08:00
|
|
|
"handlebars": "^4.7.6",
|
2017-03-04 06:17:18 +08:00
|
|
|
"jasmine": "2.x.x",
|
2021-12-02 01:01:15 +08:00
|
|
|
"joanna": "^0.0.8",
|
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",
|
2021-12-02 01:01:15 +08:00
|
|
|
"meta-marked": "^0.4.2",
|
|
|
|
"mkdirp": "^0.5.1",
|
2023-11-15 21:31:00 +08:00
|
|
|
"node-gyp": "^10.0.1",
|
2021-02-15 07:14:39 +08:00
|
|
|
"npm": ">=7",
|
2021-12-02 01:01:15 +08:00
|
|
|
"prettier": "^1.10.0",
|
2019-02-05 13:54:38 +08:00
|
|
|
"request": "^2.88.0",
|
2021-12-02 01:01:15 +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-12-02 01:01:15 +08:00
|
|
|
"typescript": "3.9.7",
|
2021-12-01 04:11:12 +08:00
|
|
|
"underscore": "^1.13.1"
|
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",
|
2022-08-09 06:58:54 +08:00
|
|
|
"start": "electron ./app --enable-logging --dev",
|
2017-08-12 02:38:25 +08:00
|
|
|
"lint": "grunt lint --gruntfile=app/build/Gruntfile.js --base=./",
|
2022-08-09 06:58:54 +08:00
|
|
|
"test": "electron ./app --enable-logging --test",
|
|
|
|
"test-window": "electron ./app --enable-logging --test=window",
|
|
|
|
"tsc-watch": "tsc -w -p ./app --noEmit",
|
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
|
|
|
}
|
|
|
|
}
|