Previously if the --dev flag was used and no resource was
specified or found in ~/github/atom then the app would
crash trying to add a null resource path to the node paths
list.
Now the bundle resource path is the fallback whenever the
dev resource path cannot be found or does not exist.
Previously isDevMode was returning true when it was called
before the resource path was initially set forcing Atom to
always run in dev mode.
Now we just use the new isDevFlagSpecified() method to check
where the bundle resource path should be used.
Previously CefShutdown() was called after closing the windows
which would prevent them from running their beforeunload callbacks
and saving state properly when cmd-Q the application.
Now the number of open browsers is tracked and the message loop
is quit and the windows are autoreleased only after the browser
is ready to be closed.
Closes#493
Node uses the location of index as a starting point when looking for
node_modules. Previously, we always loaded index.html out of the app
bundle, which caused us to always load node_modules from the app
bundle as well, which is not what we want in dev mode. Since we no
longer depend on a compiled require.js, it's just as easy to load
index.html from the repository path when in dev mode.
stringByStandardizingPath has an interesting quirk that causes it to
remove `/private` from the path if the result still indicates an
existing file or directory
All our native code now gets built into Atom.framework. Atom.app and
Atom Helper.app both link against this framework. All resources other
than a couple of main-bundle-only ones (e.g., atom.icns) go into
Atom.framework.
Note that this means that there's no compile- or link-time separation
between main process code and helper process code. We could introduce a
compile-time separation by building main process and helper process code
into separate static libraries with mutually exclusive include paths, if
we want.
Atom.framework exports a single symbol: AtomMain(). Atom.app and Atom
Helper.app contain a single source file: main.cpp. main() just calls
AtomMain().
All frameworks are placed in Atom.app/Contents/Frameworks. We now link
against all frameworks using @rpath-based install names, which allows
Atom.app and Atom Helper.app to find them automatically based on their
own LD_RUNPATH_SEARCH_PATH settings. We use install_name_tool at build
time on each of our three binaries (Atom.app, Atom Helper.app,
Atom.framework) to set the install names.
By reducing duplication of code and resources between Atom.app and Atom
Helper.app (and the EH/NP copies of Atom Helper.app), this reduces the
size of the total installed Atom.app bundle from 145MB to 82MB. By
compiling .coffee and .cson files only once, clean build time drops from
114 seconds to 79 seconds on my MacBook Pro.
Previously this was done during `rake install`.
Also default to `~/github/atom` as the default resource path
when no `--resource-path` argument is specified. This argument
will now be required when running in dev mode if the repository
is not at the default location.
Closes#300
This adds support for accessing native extensions in web workers, though it may
not work quite how we need it to just yet. Figured we'd bank an upgrade anyway.
This appears to be handled by stringByAddingPercentEscapesUsingEncoding
and so explicitly doing it causes a space to be encoded to %2520 instead
of %20