44 Commits

Author SHA1 Message Date
Max Brunsfeld
327cf6997b Remember which packages use atom APIs at main module load time
Signed-off-by: Nathan Sobo <nathan@github.com>
2015-11-23 17:35:38 -08:00
Max Brunsfeld
91b651e86c Make model constructor argument to addViewProvider optional 2015-11-19 15:54:47 -08:00
Nathan Sobo
1aa4b7e06a Clear nextUpdatePromise immediately when an animation frame fires 2015-11-09 00:35:33 -07:00
Nathan Sobo
54a9012796 Clear next update promise when resetting ViewRegistry 2015-11-09 00:35:33 -07:00
Nathan Sobo
b9528dcb39 Cancel ViewRegistry animation frames between specs 2015-11-09 00:35:33 -07:00
Nathan Sobo
e9dfc080a3 Convert text-editor-component-spec to Babel for async/await
It's much easier to reason about async/await than Jasmine's
built-in queuing system, and using them made it easier to
debug flaky async tests.
2015-11-09 00:35:32 -07:00
Nathan Sobo
1aefb22789 Add ViewRegistry.prototype.getNextUpdatePromise
Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
2015-11-09 00:35:18 -07:00
Nathan Sobo
b7d6dd5e8c Reset view registry in AtomEnvironment::reset 2015-10-07 15:25:02 -05:00
Antonio Scandurra
e9cda3ea5c Don't use atom.views global in PanelElement 2015-10-07 15:25:00 -05:00
Thomas Johansen
c16f252ab7 📝 Rephrase view resolution docs 2015-08-19 20:54:39 +02:00
Thomas Johansen
675e9be262 🔥 Remove mention of semi-deprecated view resolution step 2015-08-19 20:46:24 +02:00
Thomas Johansen
66d0e7c752 📝 Attempt to document view resolution algorithm 2015-08-19 15:44:16 +02:00
Thomas Johansen
22ca33a3b1 Extend ViewRegistry with support for objects with an element property
By adding this extension to ViewRegistry::getView we're paving the way for
Etch-like view frameworks which promotes the usage of plain objects and
classes with an element property which is an instance of HTMLElement.
2015-08-18 21:38:00 +02:00
Nathan Sobo
ee3989720b Fix ViewRegistry::addViewProvider documentation 2015-07-31 12:00:02 -06:00
Nathan Sobo
fb9d15e03e Throttle document polling 2015-07-23 12:02:53 -06:00
Nathan Sobo
b2fb7e6e7a Remove unused prototype properties 2015-07-23 10:51:11 -06:00
Jessica Lord
96874d68d8 Run polling functions when windows resizes 2015-07-23 10:51:11 -06:00
Jessica Lord
558eb1bb8c Use mutation observer for document changes 2015-07-23 10:51:10 -06:00
Nathan Sobo
76a919f8b4 Perform document updates in same frame when requested from reads
A common pattern is to put something on the DOM, measure it, then update
the DOM again based on that measurement. This change ensures that any
updates requested as a result of reading from the DOM get scheduled for
the end of the current frame. If you want to read *again* after these
follow-on updates, you will need to wait for the next frame. But at
least this way we ensure instant feedback with minimal thrashing
(1 reflow) when we have no choice but to read the DOM before updating.

/cc @benogle
2015-04-20 22:01:36 -06:00
Antonio Scandurra
3c47cc7964 Stop polling document when clearing document requests 2015-04-15 12:15:51 +02:00
Ben Ogle
32572c0106 Add ViewRegistry::pollAfterNextUpdate
Closes #6196
2015-04-01 17:41:00 -07:00
Nathan Sobo
55f80f33e6 Avoid allocating an array on every poll
@jashkenas Love CoffeeScript but I wish I could opt out of loops being
list comprehensions.
2015-02-20 15:28:02 -07:00
Nathan Sobo
32d393d26f Pause polling when updates are requested, but don’t start polling over
The blinking cursor was ensuring that we never polled in certain cases.
We need to allow the interval to continue polling at a normal pace, but
just avoid doing any work that could delay the next animation frame.
2015-02-20 09:51:11 -07:00
Nathan Sobo
1d84d74e50 Centralize text editor DOM interaction through atom.views
This ensures that DOM writing, reading, and polling properly interleaves
with DOM interactions from other text editors and any other code that
coordinates via atom.views. Not sure about the location of it though.
2015-02-19 17:14:58 -07:00
Nathan Sobo
de4d995190 Add document coordination methods to ViewRegistry
These will assist in updating and reading the DOM in a non-blocking
manner across components.
2015-02-19 17:14:57 -07:00
Cheng Zhao
93181d8a54 Array::find is undefined in Chrome 40 2015-01-28 14:06:14 -08:00
Kevin Sawicki
a606fc516b 💄 2015-01-06 20:26:45 -08:00
Nathan Sobo
e192922f0e Don’t add __spacePenView property to jQuery objects in ViewRegistry
This property is added as needed in our legacy SpacePen views, and is
now used to trigger a deprecation warning. We don’t want to add it to
new SpacePen views because they shouldn’t trigger deprecation warnings.
2015-01-02 12:58:49 -07:00
Max Brunsfeld
a7a9b3707f Merge pull request #4365 from atom/ns-view-registry-cleanup
Clean up view registry API
2014-12-02 08:55:00 -08:00
Nathan Sobo
9a9347e3a5 Simplify ViewRegistry::addViewProvider API
It now takes two arguments, a model constructor and a create view
callback that is passed the model.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-12-01 17:53:03 -08:00
Max Brunsfeld
e4bcb96dcc Change ::setModel to ::initialize on all element classes 2014-12-01 17:52:19 -08:00
Kevin Sawicki
db17a6cba4 📝 Remove stray to 2014-12-01 17:42:14 -08:00
Ben Ogle
421c64347e View -> Element in docs 2014-11-19 17:46:33 -08:00
Nathan Sobo
07505ea82a Support any instance of jQuery in view registry logic 2014-11-05 09:33:31 -07:00
Kevin Sawicki
25922872f0 Remove trailing whitespace 2014-10-30 14:00:53 -07:00
Ben Ogle
fcca61c2b2 📝 Update docs 2014-10-30 13:56:03 -07:00
Ben Ogle
ee4116536d Move the ViewRegistry to atom.views 2014-10-30 13:42:27 -07:00
Ben Ogle
0067e44681 Do not access space-pen view when no elements 2014-10-08 13:48:50 -07:00
Nathan Sobo
d344adc21e Allow view providers to specify a createView factory method
If present, it will be called with the model object instead of
instantiating the view constructor directly and assigning a model on it.
This gives users more flexibility when constructing views.
2014-09-19 16:24:13 -06:00
Nathan Sobo
74d772f069 Rename view/modelClass to view/modelConstructor in view provider specs
It’s a more technically correct term. You use a class keyword to declare
these things, but the actual objects you pass around to talk about them
are constructor functions.
2014-09-19 16:24:13 -06:00
Nathan Sobo
e2e804483f Return disposable from ViewRegistry::addViewProvider 2014-09-19 16:24:13 -06:00
Nathan Sobo
b5499247b3 Use view providers to build views if a matching provider is available 2014-09-19 16:24:13 -06:00
Nathan Sobo
20e08323c1 Use the ViewRegistry to construct pane item views 2014-09-19 16:24:12 -06:00
Nathan Sobo
2b86297a0b Extract a ViewRegistry that can be shared amongst Workspace objects 2014-09-19 16:24:12 -06:00