Commit graph

286 commits

Author SHA1 Message Date
Evan Morikawa 14b70b1e9d feat(babel6): 2,398 linter errors 2016-05-06 11:55:43 -07:00
Evan Morikawa 5eab36756e feat(babel6): 88,888 lint errors 2016-05-06 11:55:40 -07:00
Evan Morikawa ed3f062a6a feat(babel6): 90,798 lint problems
Fix eslint-task. Grunt doesn't recognize es6 files
2016-05-06 11:55:38 -07:00
Evan Morikawa e559c8f69a feat(babel6): Add test for spec describe 2016-05-06 11:55:18 -07:00
Evan Morikawa 47c064617d feat(babel6): Fix destructuring default from exports and update linter 2016-05-06 11:55:14 -07:00
Evan Morikawa d2ba35a749 feat(babel6): Use absolute paths for linter and dont call default on coffee 2016-05-06 11:54:58 -07:00
Evan Morikawa ff7f909317 feat(babel6): Detect when packages don't have a default export 2016-05-06 11:54:57 -07:00
Evan Morikawa 7f50074c0d feat(babel6): Convert to use new es6 require syntax 2016-05-06 11:54:55 -07:00
Evan Morikawa 427a23bbe6 feat(babel6): Add babel presets and lint for require.default 2016-05-06 11:54:52 -07:00
Evan Morikawa e2f9104766 feat(babel6): Initial babel conversion 2016-05-06 11:54:38 -07:00
Ben Gotow a7f65217bf bump(asar): Re-create ordering hint 2016-05-03 16:25:52 -07:00
Ben Gotow 581787e50c fix(send-later): Simplify logic, use changes.addPluginMetadata 2016-05-03 14:01:06 -07:00
Ben Gotow 05be74ec04 fix(read-receipts): Remove tracking pixels when composing drafts 2016-04-28 17:08:54 -07:00
Akshar Patel 2088e27199 Show under Internet Category in Linux (#2083)
* Update title for system tray

Using only Menu Bar confuses Linux users because ''Menu Bar'' word is only used withing Mac OS. So, also use "System Tray" word.

* Show under Internet Category in Linux

Right now, N1 is showing under Programming Category. "Network" should be added to show under Internet Category.
2016-04-28 10:28:41 -07:00
Ben Gotow 7c557c0c8f cleanup(specs): Remove space-pen. Goodbye, jQuery! 2016-04-26 13:14:07 -07:00
Ben Gotow 1b62e09f71 cleanup(config): Remove unused features, dependencies 2016-04-26 13:14:06 -07:00
Evan Morikawa cc124be849 fix(build): fix lstatSync throwing 2016-04-25 16:18:23 -07:00
Evan Morikawa 60d2c24693 feat(package): fix build-resources-task and move submodule 2016-04-25 16:01:56 -07:00
Evan Morikawa 2472e0556b feat(package): require 'engines': {'nylas': '*'} in package.json 2016-04-25 15:06:37 -07:00
Ben Gotow 43b65ca36c cson(cleanup): Remove imports, only used for config.cson now 2016-04-24 20:33:34 -05:00
Ben Gotow 16dd26c29e fix(build): CSON => JSON no longer necessary for /keymaps, /menus 2016-04-24 20:27:29 -05:00
Ben Gotow 9dd9cd81a3 fix(build): Run eslint on files inside submodule 2016-04-24 19:32:37 -05:00
Ben Gotow e63ea0f163 fix(*): spec failures related to moment-round again 2016-04-24 15:21:29 -05:00
Ben Gotow ddba5415ad mv(packages): move plugins that are incompatible with open source sync engine 2016-04-24 14:53:12 -05:00
Ben Gotow a48ddd51f8 refactor(menus): Major prune of keymaps/commands, real conditional menus
Summary:
Keymaps & menus CSON => JSON, remove AtomKeymaps, CommandRegistry use of CSS selectors, use Mousetrap instead

Important Notes:

- The `application:` prefix is reserved for commands which are handled in the application process. Don't use it for other things. You will not receive the events in the window.

- Maintaining dynamic menus seems to come with quite an overhead, because Electron updates the entire menu every time. In the future, we'll need https://github.com/electron/electron/issues/528 to really make things nice. I will be tracking this upstream.

- The format for keyboard shortcuts has changed. `cmd-X` is now `command+shift+x`

Test Plan: Run tests

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2917
2016-04-24 12:16:25 -05:00
Evan Morikawa 78112563a6 feat(win): faster popout windows
Summary:
This diff is designed to dramatically speed up new window load time for
all window types and reduce memory consumption of our hot windows.

Before this diff, windows loaded in ~3 seconds. They now boot in a couple
hundred milliseconds without requiring to keep hot windows around for
each and every type of popout window we want to load quickly.

One of the largest bottlenecks was the `require`ing and initializing of
everything in `NylasExports`.

I changed `NylasExports` to be entirely lazily-loaded. Drafts and tasks
now register their constructors with a `StoreRegistry` and the
`TaskRegistry`. This lets us explicitly choose a time to activate these
stores in the window initalization instead of whenever nylas-exports
happens to be required first.

Before, NylasExports was required first when components were first
rendering. This made initial render extremely slow and made the proposed
time picker popout slow.

By moving require into the very initial window boot, we can create a new
scheme of hot windows that are "half loaded". All of the expensive
require-ing and store initialization is done. All we need to do is
activate the packages for just the one window.

This means that the hot window scheme needs to fundamentally change from
have fully pre-loaded windows, to having half-loaded empty hot windows
that can get their window props overridden again.

This led to a major refactor of the WindowManager to support this new
window scheme.

Along the way the API of WindowManager was significantly simplifed.
Instead of a bunch of special-cased windows, there are now consistent
interfaces to get and `ensure` windows are created and displayed. This
DRYed up a lot of repeated logic around showing or creating core windows.

This also allowed the consolidation of the core window configurations into
one place for much easier reasoning about what's getting booted up.

When a hot window goes "live" and gets populated, we simply change the
`windowType`. This now re-triggers the loading of all of the packages for
the window. All of the loading time is now just for the packages that
window requires since core Nylas is there thanks to the hot window
mechanism.

Unfortunately loading all of the packages for the composer was still
unnaceptably slow. The major issue was that all of the composer plugins
were taking a long time to process and initialize. The solution was to
have the main composer load first, then trigger another window load
settings change to change the `windowType` that loads in all of the
plugins.

Another major bottleneck was the `RetinaImg` name lookup on disk. This
requires traversing the entire static folder synchronously on boot. This
is now done once when the main window loads and saved in a cache in the
browser process. Any secondary windows simply ask the backend for this
cache and save the filesystem access time.

The Paper Doc below is the current set of manual tests I'm doing to make
sure no window interactions (there are a lot of them!) regressed.

Test Plan: https://paper.dropbox.com/doc/Window-Refactor-UYsgvjgdXgVlTw8nXTr9h

Reviewers: juan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2916
2016-04-22 13:30:42 -07:00
Ben Gotow 9a35a3e336 bump(resources): Updates to submodule 2016-04-22 10:53:11 -07:00
Ben Gotow 33225f56b0 rename(drafts) DraftStoreProxy => DraftEditingSession 2016-04-19 16:08:58 -07:00
Ben Gotow d1211ab7de bump(electron): 0.36.7 => 0.37.5 2016-04-12 18:42:57 -07:00
Ben Gotow 394d85cecf fix(drafts): Use the appropriate account and alias 2016-03-24 19:35:24 -07:00
Ben Gotow 380d0a9e76 fix(mixpanel): Consolidate reply / replyAll actions 2016-03-23 16:02:30 -07:00
Ben Gotow a791ae76e0 fix(tray): Use total count, not unread count, for tray icon 2016-03-21 17:36:18 -07:00
Ben Gotow d58a1aeaf3 feat(dock-icon): Drop files to attach them to new msg
Summary:
Fix specs

Fix responding to mailto, files at launch

It's super important that `window:loaded` is /not/ sent from index.js because `loadSettings.bootstrapScript` is async and nothing is actually loaded yet. This was causing the app to dispatch the mailto:// links into the main window before a DraftStore existed.

I think this was necessary at one point because we had NylasWindows not using a bootstrapScript? Should not be here anymore...

Test Plan: Run a few new tests

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2737
2016-03-17 13:14:55 -07:00
Ben Gotow 38b8d03cf2 fix(icon): update assets to fix #1747 2016-03-15 12:46:03 -07:00
Ben Gotow 8e9d7ff73e fix(signatures): Adds default signature, convert to ES6 2016-03-14 17:05:49 -07:00
Juan Tejada 812b64edec fix(snooze): Correctly query and create snooze categories per account
Summary:
- Was not properly updating the references to snoozed categories when
  accounts were added or removed
- Update whenCategoriesReady to make sure we listen until category syncing has concluded (Move inside CategoryStore)
- #1676, #1658

Test Plan: - TODO

Reviewers: evan, drew, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2723
2016-03-14 15:36:39 -07:00
Ben Gotow 4593d0a9b1 fix(config): Move account tokens to system keychain
Summary:
This diff also adds an account version number to the config so that the AccountStore can tell whether it should reload accounts (depending on whether it was the instance making tthe changes.)

This diff also fixes a tiny issue where un-opened composers threw an exception if you changed accounts.

Test Plan: New tests

Reviewers: evan, drew, juan

Reviewed By: juan

Subscribers: juan

Differential Revision: https://phab.nylas.com/D2726
2016-03-14 15:14:08 -07:00
Ben Gotow c76582194a rm(autolinker): Use our own very simple autolinker
Summary:
Autolinker is a great open source project but it attempts to parse HTML with regexp, is quite slow, and hangs on specific emails https://github.com/nylas/N1/issues/1540

This is super bad, and also super unnecessary. I think this should do the trick.

Note: I changed the urlRegex in our Utils to be much more liberal. It now matches anything that looks like a URL, not just things with the http:// and https:// prefixes. It's used in the LinkEditor and onboarding screen (detecting auth errors with urls) and I think it should be ok?

Test Plan: Need to write some tests

Reviewers: evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D2725
2016-03-14 12:30:54 -07:00
Ben Gotow 9af46bd834 bump(asar): 0.10, use ordering feature we PR'd [TEST CI] 2016-03-08 15:21:28 -08:00
Juan Tejada f18a800448 bump(submodule): Add eslint to arc 2016-03-06 14:47:49 -08:00
Ben Gotow e7b07a556f build(32-bit): Move a few docker files out of root of repo 2016-03-03 17:03:14 -08:00
Ben Gotow 10ec524d90 Merge pull request #1342 from mbilker/linux-32bit-docker
[RFC] Linux 32-bit Docker build
2016-03-03 14:10:41 -08:00
Juan Tejada f46502ad3e test(plugins): Add snooze and send later specs
Summary:
- Also refactors the code a bit for testability and maintainability
- Fixes #1515

Test Plan: - Unit tests

Reviewers: evan, drew, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2651
2016-03-03 12:38:42 -08:00
mbilker b32dc0d7fc fix(startup): remove beta references 2016-03-02 17:47:47 -08:00
mbilker 887db8d8ea fix(launch): convert Atom's launch script for N1
Addresses #411

The `N1.sh` launch script fails to account for running from
`/usr/{local/}bin/nylas` where it would throw an error saying
it couldn't find the electron binary.

The Atom launch script works just fine and takes that into account.
The installed launch script here is a reflactored Atom launch script
that properly accounts for running the `nylas` executable and locates
the actual binary accordingly.
2016-03-02 17:47:47 -08:00
Ben Gotow f5ee557e2e feat(hidden-messages): Filter trash/spam messages. Fixes #1135
Summary:
By default, the messages in a thread are now filtered to exclude
ones moved to trash or spam. You can choose to view those messages by clicking
the new bar in the message list.

When you view your spam or trash, we only show the messages on those threads
that have been marked as spam/trash.

Test Plan: Run a couple new tests

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2662
2016-03-02 10:05:17 -08:00
Ben Gotow 94badcda15 es6(*): convert 20+ source files used in example packages to ES2016
There could be a few lurking bugs. Please test!
2016-02-29 18:47:22 -08:00
Ben Gotow 114a7b2740 bump(submodule): theme and plugin installation reporting fixes 2016-02-26 13:28:42 -08:00
Evan Morikawa 4c9a02d9e6 fix(analytics): clean up events 2016-02-25 13:32:09 -08:00
Ben Gotow 21b1cd4e19 fix(build): Don't delete plugin package.json files, restore ellipsis (@sdw consulted HIG!) 2016-02-24 18:15:55 -08:00
Ben Gotow 5e78a9b2c6 💄(plugins): Updated assets and a bit of error handling 2016-02-23 17:51:10 -08:00
Ben Gotow 40274cfc77 fix(composer): Redo toolbar styling with theme variables + minor fixes 2016-02-23 15:40:44 -08:00
Ben Gotow 34da43c42a 💄(icon): A delightful seafoam green icon 2016-02-23 10:35:08 -08:00
Ben Gotow 825d2ef8be 💄: Experimental app icon, fix for merge conflict 2016-02-19 18:52:49 -08:00
Juan Tejada 76bda1dbe4 feat(snooze/send-later): Add snooze and send later plugins
Summary:
- Add initial version of snooze and send later plugins
- Tests are missing since this will probably heavily change before we are done with them

Test Plan: - TODO

Reviewers: drew, bengotow, evan

Reviewed By: bengotow, evan

Differential Revision: https://phab.nylas.com/D2578
2016-02-18 10:06:21 -08:00
mbilker 4203da2143 fix(publish-nylas-build): return undefined to prevent grunt interpreting as failed build 2016-02-15 21:12:17 -05:00
mbilker 50ae5e4293 fix(build): use special docker build file to run appropriate build tasks 2016-02-15 19:41:13 -05:00
Evan Morikawa 3f38c35d98 fix(analytics): no longer track tasks 2016-02-12 13:52:06 -08:00
Evan Morikawa cc540fef6e fix(composer): allow link paste without tooltip
Also fix style issues with link text.

Fix cmd+k link editing when nothing is selected.

Make confirm button only appear when there are changes to be made
2016-02-12 13:50:20 -08:00
Evan Morikawa 0f9475cc91 fix(analytics): add onboarding welcome event 2016-02-12 10:25:28 -08:00
Evan Morikawa 8e6e5e9d57 fix(win): add windows-shortcuts to asar exclude 2016-02-11 13:52:53 -08:00
Evan Morikawa 8e78d8ffce fix(updater): update to Squirrel.Windows 1.2.3
grunt-electron-installer 1.2.1 includes a bump to squirrel 1.2.3
2016-02-09 12:03:43 -08:00
Evan Morikawa 2c70083a43 fix(win): fix typo in nylas-win-bootup 2016-02-09 11:43:30 -08:00
Evan Morikawa d4db0737cf feat(error): improve error reporting. Now NylasEnv.reportError
Summary:
The goal is to let us see what plugins are throwing errors on Sentry.

We are using a Sentry `tag` to identify and group plugins and their
errors.

Along the way, I cleaned up the error catching and reporting system. There
was a lot of duplicate error logic (that wasn't always right) and some
legacy Atom error handling.

Now, if you catch an error that we should report (like when handling
extensions), call `NylasEnv.reportError`. This used to be called
`emitError` but I changed it to `reportError` to be consistent with the
ErrorReporter and be a bit more indicative of what it does.

In the production version, the `ErrorLogger` will forward the request to
the `nylas-private-error-reporter` which will report to Sentry.

The `reportError` function also now inspects the stack to determine which
plugin(s) it came from. These are passed along to Sentry.

I also cleaned up the `console.log` and `console.error` code. We were
logging errors multiple times making the console confusing to read. Worse
is that we were logging the `error` object, which would print not the
stack of the actual error, but rather the stack of where the console.error
was logged from. Printing `error.stack` instead shows much more accurate
stack traces.

See changes in the Edgehill repo here: 8c4a86eb7e

Test Plan: Manual

Reviewers: juan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2509
2016-02-03 18:06:52 -05:00
Ben Gotow cbfe310521 fix(eslint): Avoid eslint/eslint/issues/5125 by specifying escope version 2016-02-01 11:08:15 -08:00
mbilker 9458df3a9c bump(grunt-contrib-csslint): update to ~0.5.0 2016-02-01 10:10:12 -05:00
Evan Morikawa 983dc77ef0 fix(resources): update build resources link 2016-01-28 12:03:23 -08:00
Evan Morikawa 8bcb0a2184 fix(resources): update build resources link 2016-01-28 12:02:27 -08:00
Evan Morikawa 55aedef697 feat(startup): new option to launch on system start
Summary:
adds new option to launch on system start

Also adds the `--background` flag to launch N1 in the background (aka not
show the main window).

Test Plan: Manual

Reviewers: bengotow, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D2474
2016-01-28 12:02:08 -08:00
Juan Tejada 7e368a74d2 update(analytics): Add missing action: removeAttachment 2016-01-28 11:02:27 -08:00
Ben Gotow 7ef187e882 Update analytics to remove references to deleted Actions 2016-01-28 10:38:02 -08:00
Ben Gotow 205ec50b98 Fix AccountStore.current() references in private packages 2016-01-25 18:02:56 -08:00
Ben Gotow e2234bf58e Merge branch 'master' into unified-inbox
# Conflicts:
#	internal_packages/feedback/lib/feedback-button.cjsx
#	internal_packages/thread-list/lib/thread-list.cjsx
#	src/flux/stores/draft-store.coffee
2016-01-25 17:28:29 -08:00
Evan Morikawa 6695de4187 feat(tasks): add Create, Update, Destroy tasks plus spec & lint fixes
Summary:
1. **Generic CUD Tasks**: There is now a generic `CreateModelTask`,
`UpdateModelTask`, and `DestroyModelTask`. These can either be used as-is
or trivially overridden to easily update simple objects. Hopefully all of
the boilerplate rollback, error handling, and undo logic won't have to be
re-duplicated on every task. There are also tests for these tasks. We use
them to perform mutating actions on `Metadata` objects.

1. **Failing on Promise Rejects**: Turns out that if a Promise rejected
due to an error or `Promise.reject` we were ignoring it and letting tests
pass. Now, tests will Fail if any unhandled promise rejects. This
uncovered a variety of errors throughout the test suite that had to be
fixed. The most significant one was during the `theme-manager` tests when
all packages (and their stores with async DB requests) was loaded. Long
after the `theme-manager` specs finished, those DB requests were
(somtimes) silently failing.

1. **Globally stub `DatabaseStore._query`**: All tests shouldn't actually
make queries on the database. Furthremore, the `inTransaction` block
doesn't resolve at all unless `_query` is stubbed. Instead of manually
remembering to do this in every test that touches the DB, it's now mocked
in `spec_helper`. This broke a handful of tests that needed to be manually
fixed.

1. **ESLint Fixes**: Some minor fixes to the linter config to prevent
yelling about minor ES6 things and ensuring we have the correct parser.

Test Plan: new tests

Reviewers: bengotow, juan, drew

Differential Revision: https://phab.nylas.com/D2419

Remove cloudState and N1-Send-Later
2016-01-15 15:16:21 -05:00
Ben Gotow 3a8a38b8bc Merge branch 'master' into unified-inbox
# Conflicts:
#	spec/stores/file-download-store-spec.coffee
2016-01-13 17:20:34 -08:00
Ben Gotow 8cd3176574 build(linux): Ensure that target files are not group writable
Should fix #710. Will move all 0775 => 0755 and 0664 => 0644
2016-01-13 16:09:53 -08:00
Karim Hamidou 4ba827fc48 set the ContentType when uploading packages to S3. 2016-01-13 11:12:39 -08:00
Ben Gotow 728375d9f9 Bump submodule reference 2016-01-11 16:21:05 -08:00
Ben Gotow 9acdb3923f Merge branch 'bengotow/consolidate-plugins' 2016-01-07 14:57:34 -08:00
Ben Gotow 460a715e4d fix(examples): examples => packages, move away from installing them 2016-01-07 14:56:34 -08:00
Evan Morikawa 6db0d8bc46 Add 'default' tasks 2016-01-06 15:55:14 -08:00
Ben Gotow 1ba8f5277f fix(rpm): Treat-deb and-rpm as separate platforms on N1Server 2016-01-05 17:51:02 -08:00
Ben Gotow 41d1c551a5 fix(rpm): Upload RPM builds following naming convention 2016-01-05 17:32:11 -08:00
mbilker 8182f2ef89 fix(grunt): replace shareDir with linuxShareDir to reflect global changes
The `install` task would fail since `linuxShareDir` was undefined for the
template `.desktop` file.
2016-01-04 22:08:20 -05:00
Evan Morikawa 3cd42303ae fix(build): debian packages use different share dir 2016-01-04 16:39:43 -08:00
Evan Morikawa 9530a84877 feat(build): new rpm builds
Summary: Now builds RPM on Travis

Test Plan: manual

Reviewers: juan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2391
2016-01-04 09:56:14 -08:00
Evan Morikawa 616821d09e fix(date): copyright year auto-updates 2016-01-04 09:41:28 -08:00
Juan Tejada 6315bc9d80 fix(extension-adapter): Update adapter to support all versions of extension api we've used
Summary:
- Rewrites composer extension adpater to support all versions of the
  ComposerExtension API we've ever declared. This will allow old plugins (or
  plugins that haven't been reinstalled after update) to keep functioning
  without breaking N1
- Adds specs

Test Plan: - Unit tests

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2399
2015-12-30 15:11:37 -05:00
Dave Perdue 848fb0d688 Fix broken GNOME dock icon
This addresses an issue mentioned in Issue #465 regarding a missing icon.
2015-12-16 12:14:26 -08:00
Dave Perdue 2fc66a42fa Remove redundant path in .desktop for Linux
The install-task has two instructions that add an extra "resources" to the iconName directory and thus the icon doesn't work. The resulting nylus.desktop has an invalid path for the icon.
2015-12-16 11:59:01 -08:00
Ben Gotow 159bb51a10 fix(locales): Copy lproj files to ensure navigator.language works
See https://github.com/atom/electron/issues/2484
2015-12-15 11:34:56 -08:00
Evan Morikawa 267a339250 fix(bootstrap): split commands 2015-12-14 15:22:47 -08:00
Juan Tejada 5a8ca1ef51 add(integration-test): Adds test for onboarding flow with Exchange
Summary:
- Make sure user can log in using exchange
- Adds some test helpers for the test
- Updates eslint.json and cleans up lint errors

Test Plan: - Integration Tests

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2346
2015-12-14 15:14:58 -08:00
Ben Gotow 8ea8df8efc fix(ci): stable instead of release/* branches 2015-12-11 17:13:42 -08:00
Ben Gotow 0f67438c9f fix(ci): Publish appveyor release branch builds 2015-12-11 15:11:13 -08:00
Ben Gotow 922a9e80ec fix(ci): Publish builds on release branches 2015-12-11 14:44:53 -08:00
Ben Gotow 0e4e736607 Merge pull request #628 from mbilker/task-helper-undefined-process-env
Replace function accessor with property accessor in Grunt's task-helper script
2015-12-09 16:02:09 -08:00
Evan Morikawa a2c8145a75 bump(internal): update submodule reference 2015-12-09 18:14:01 -05:00
Evan Morikawa aef0c8a681 fix(spellcheck): check for existing languages and add tests 2015-12-09 18:10:55 -05:00
Ben Gotow 8ecf3bba3f fix(auth): Log first account creation 2015-12-08 17:05:59 -08:00