Comments (14)
I'm also having an issue where nested subviews cause it to render twice. Apparently subviews are simply broken. How is it nobody has discovered this. I crashed into this bug immediately upon trying to build a real program.
[edit] subviews work for me but just not two levels deep in declarative definition.
from ampersand-view.
Can one of you get a requirebin going so we can look at it together?
from ampersand-view.
too complex for requirebin but i can add you to my private repo, if you'd like. it is a discrete project.
from ampersand-view.
I am going to try overloading the _parseSubview
method to get it to do what I want. I really don't have time to setup a test case. I'm guessing that it is something like pastebin?
If you could point me to a skeleton setup of Ampersand on requirebin then I could get to it soon.
from ampersand-view.
@cdaringe Maybe the problem is that many people are using waitFor
with a relevant condition and so they are not noticing this bug?
from ampersand-view.
I have RootView -> ViewSwitcher -> HeaderView -> subview -> subview.
from ampersand-view.
declarative subviews get rendered on on change:el
, I believe. i'm pretty swapped at work ATM, but you could slap a debugger;
perhaps in the parseSubviews fn and try and sniff a trace back on that second dubious render. perhaps if you're binding to the root element in both subviews this would occur. in the src there's a local fn called action
that you can hook into for debugging purposes
from ampersand-view.
@cdaringe @orenmizr I think that I have a work around as I am now getting a proper display without a double render.
I set autoRender: false
on my base view and then I just need to manually call render on my RootView - which is fine since I can now control it better in my base Application class (if I need to). I use two ViewSwitcher objects for my content and body area and this automatically calls render on the HeaderView and BodyView, which then works its way through all of the nested subviews with no problem.
So perhaps follow the autoRender code paths to find an issue?
from ampersand-view.
@dschissler: the p.o.c i did with ampersand (as i recall) did rely heavily on waitFor for the nested views (all by the way - declarative subviews). even though they all waited for the same model.
from ampersand-view.
@orenmizr We both had this issue and I'm not yet using waitFor like you were. Perhaps it is tied to the fate of autoRender?
from ampersand-view.
i am not using autoRender a lot BUT the problematic view does have it defined autoRender: true.
to be honest, after seeing how deserted the trello roadmap, gitter and github activity. i simply decided (even though i think it has great ideas) that i can't really use in production. so i haven't touched ampersand since. waiting for a sea change.
from ampersand-view.
I'm refactoring an existing Backbone application and Ampersand looks to be of a better design than Backbone+Marionette. I'm expecting to need to change all of my view code into a new framework in 2-3 years when many libraries will be using IE11 or MS Edge as a base line. A lot of the rewrite is moving everything to ES7/Babel and PostCSS and I'll be able to recycle much of that work. I just think that its a bad time to be investing into a new JS framework and so I'm going with something that is basically the same.
from ampersand-view.
i am completely sold on ampersand. the ideas, design and the backbone-ish parts. i am too from a backbone + marionette. so i know how easy it was to adopt ampersand. but without active development, a big community to push forward and squash bugs with you - it's a bit risky. think, it has been a month since i opened this thread.
from ampersand-view.
@orenmizr, did you figure out what was up?
from ampersand-view.
Related Issues (20)
- List cdaringe as lead maintainer and add him to core team HOT 6
- Possible fix to template engines that attempt to copy the getter-laden context from going crazy HOT 3
- $('.className') vs this.queryByHook('hookName') HOT 2
- The ability to extend the declarative style of the subviews is very limited HOT 6
- Using deprecated version of ampersand-state HOT 1
- get-object-path issues + proposal HOT 6
- reset() throwing errors since I build from ES6 HOT 4
- Release ampersand-*-view HOT 1
- Release new version HOT 1
- Make bindings extensible HOT 11
- Enhance docu about _upsertBindings() HOT 4
- _downsertBindings needs to clear the _subviews array
- renderSubview expects subview render method to return subview instance HOT 3
- Possible bug with the auto-generated prepareView() ? HOT 4
- Enchancement bubble subview events
- Enhancement to provide single declarative place for event listeners
- Looking to become maintainer HOT 6
- package-lock.json HOT 1
- NPM Audit HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ampersand-view.