Commit Graph

10249 Commits

Author SHA1 Message Date
Nathan Sobo
62a43c6fb9 Revise StyleManager API 2014-10-15 15:14:12 -06:00
Nathan Sobo
1fe1147901 Add group parameter to StyleManager::addStyleSheet
This can be used to sequence style elements at the correct location in
the cascade even if they are loaded later than elements in a subsequent
group.
2014-10-15 15:14:12 -06:00
Nathan Sobo
1c97dcd195 Add sourcePath parameter to StyleManager::addStyleSheet 2014-10-15 15:14:12 -06:00
Nathan Sobo
d3371dbcd2 Start on StyleManager
This will take over raw stylesheet management from the theme manager
now that it’s becoming more complex with the need to target specific
host elements. Instead of actually adding nodes to the head of the
document, it will instead simply manage a set of stylesheets we want to
apply and leave actual DOM manipulation to <atom-styles> custom elements
that can render the set of active stylesheets in the appropriate
locations.
2014-10-15 15:14:12 -06:00
Kevin Sawicki
e02af51a04 🐎 Extend range to memoize matched versions 2014-10-15 13:09:47 -07:00
Kevin Sawicki
d2c7a2caca Return early when cache to add is missing 2014-10-15 13:09:47 -07:00
Kevin Sawicki
88f0183352 Remove unneeded quotes 2014-10-15 13:09:47 -07:00
Kevin Sawicki
5052aaca95 Don't leave empty paths with a trailing slash 2014-10-15 13:09:46 -07:00
Kevin Sawicki
a0ae526017 Check candidates after ranges
This way builtins are checked for correctly when the
range isn’t found
2014-10-15 13:09:46 -07:00
Kevin Sawicki
6a6c7b1852 Calculate load time in index.js
Do it previously in window-bootstrap caused several things to not be
included such as requiring coffee script and atom shell modules.

Now it is a much more accurate representation of on load time.
2014-10-15 13:09:46 -07:00
Kevin Sawicki
42040f8a9d Return early when no candidates exist 2014-10-15 13:09:46 -07:00
Kevin Sawicki
9d1db0f3de Remove unneeded trailing slash check
Package names don’t have these anyway and file paths
won’t be ending with them.
2014-10-15 13:09:46 -07:00
Kevin Sawicki
f0b922f643 Use String::startsWith 2014-10-15 13:09:46 -07:00
Kevin Sawicki
bb92b8697d Add isCorePath helper 2014-10-15 13:09:46 -07:00
Kevin Sawicki
4c17c9eae6 fs-plust -> fs-plus 2014-10-15 13:09:46 -07:00
Kevin Sawicki
dfd7bcae7f Use process.resourcesPath to find Atom shell root 2014-10-15 13:09:46 -07:00
Kevin Sawicki
f4ddc05b9c Remove call to removed function 2014-10-15 13:09:45 -07:00
Kevin Sawicki
948f96dd6f Only load fs-plus when creating a cache 2014-10-15 13:09:45 -07:00
Kevin Sawicki
db627f5cde 🐎 Join paths manually
path.join calls path.normalize and with the number of paths
being pushed through the cache it is faster to require them
manually since they are already normalized
2014-10-15 13:09:45 -07:00
Kevin Sawicki
a6866656b7 Inline isAbsolute method
This allows fs-plus to be required through the cache
2014-10-15 13:09:45 -07:00
Kevin Sawicki
40c5289e2b Defer requires until the cache is populated 2014-10-15 13:09:45 -07:00
Kevin Sawicki
7dffc58c5b Use Module's filename instead of id 2014-10-15 13:09:45 -07:00
Kevin Sawicki
67d430d100 Add crash-reporter to cache 2014-10-15 13:09:45 -07:00
Kevin Sawicki
b9d89cbf5d Inline valid extensions to check for 2014-10-15 13:09:45 -07:00
Kevin Sawicki
06ac206707 Add clipboard to cache 2014-10-15 13:09:44 -07:00
Kevin Sawicki
6e1bdbbed7 Verify that file path is absolute or relative 2014-10-15 13:09:44 -07:00
Kevin Sawicki
3e3de50eb3 💄 2014-10-15 13:09:44 -07:00
Kevin Sawicki
d7a8dfb209 Add Atom Shell builtins to cache 2014-10-15 13:09:44 -07:00
Kevin Sawicki
b0aea54544 Check cache before atom require short-circuit 2014-10-15 13:09:44 -07:00
Kevin Sawicki
41598af2b2 Add pre-resolved path to require('atom') 2014-10-15 13:09:44 -07:00
Kevin Sawicki
f495db41e7 getCachedModulePath -> resolveModulePath 2014-10-15 13:09:44 -07:00
Kevin Sawicki
76187f176c Add core cache of pre-resolved paths
This reduces the number of calls to Module._findPath for
relative paths since they can be resolved without stating
2014-10-15 13:09:44 -07:00
Kevin Sawicki
d7cb1550bf Remove semicolon 2014-10-15 13:09:44 -07:00
Kevin Sawicki
086be13ac4 Add Module._findPath debug timing and count 2014-10-15 13:09:44 -07:00
Kevin Sawicki
f0cffcbd84 Add addPathToCache helper for apm to warm using 2014-10-15 13:09:44 -07:00
Kevin Sawicki
bdc0341eb3 undefined -> return 2014-10-15 13:09:43 -07:00
Kevin Sawicki
171411823f 🐎 Resolve uncached core dependencies
Trust modules under the resource path to be there without stat-ing and
verifying.
2014-10-15 13:09:43 -07:00
Kevin Sawicki
440866d79e Remove invalid range logging 2014-10-15 13:09:43 -07:00
Kevin Sawicki
d9c758b940 Remove no main module logging 2014-10-15 13:09:43 -07:00
Kevin Sawicki
827a8ba107 First dependency version added wins 2014-10-15 13:09:43 -07:00
Kevin Sawicki
65a1fafaf7 Ensure CoffeeScript is registered when caching
This ensures folders with .coffee files are includes in the
folders array
2014-10-15 13:09:43 -07:00
Kevin Sawicki
9bd6891ac2 Use realpath so path.relative works right 2014-10-15 13:09:43 -07:00
Kevin Sawicki
472a48092d Export cache for debugging purposes 2014-10-15 13:09:42 -07:00
Kevin Sawicki
0a297d7642 Load module cache in index.js 2014-10-15 13:09:42 -07:00
Kevin Sawicki
20f6489232 Disable debug mode 2014-10-15 13:09:42 -07:00
Kevin Sawicki
2c737b8927 Move debug property into cache object 2014-10-15 13:09:42 -07:00
Kevin Sawicki
0df5045edb Move registered property into cache object 2014-10-15 13:09:42 -07:00
Kevin Sawicki
b91c25186f Use hasOwnProperty 2014-10-15 13:09:42 -07:00
Kevin Sawicki
7b8a293f30 Inline path to listSync call 2014-10-15 13:09:42 -07:00
Kevin Sawicki
26df31aa1f 💄 Group exported methods 2014-10-15 13:09:42 -07:00