Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Startup sequence feels muddled, misleading #1951

@peterflynn

Description

@peterflynn

The sequence of operations during Brackets startup is a little confusing. It's poorly documented and feels somewhat error prone... and in at least a few cases, there may already be issues as a result:

  • The last stage of project loading (restoring the working set) happens in parallel with loading extensions, which seems somewhat fragile.
  • APP_READY usually fires after the working set is fully restored, but is not guaranteed to. But because in most cases it does happen later, people often rely on it despite being not guaranteed (e.g. AppInit.appReady fires before document is loaded #1526 was closed despite not being truly fixed; pull Simplified LiveDevelopment/main.js #1880 relies on it always being fixed).
  • Our "Application Startup" performance metric stops timing before any extensions have been loaded (including core, aka default extensions).

It seems like some of the weirdness is due to loading extensions after (mostly) opening the initial project. It would be cleaner if we load all extensions first, then load the initial project. But that runs afoul of #968 -- a problem loading extensions would prevent Brackets from loading the initial project, which at least in the past left it pretty much hosed. However, there are some ways we could address that: catch exception errors more robustly (see early work and later suggestions); or add a timeout (#1029) to ensure the next phase of startup always runs; or make Brackets robust to launching with no initially-open project.

Another thing we could do to help here is improve documentation, both on the wiki and in brackets.js, to more clearly describe the order of events during startup.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions