|
Lumpy posted:This is why I started learning Backbone the other day. How did a comparison between Angular and Ember spur you into learning Backbone? Just curious since I also started picking it up recently.
|
# ? Dec 7, 2013 16:55 |
|
|
# ? May 2, 2024 02:21 |
|
This has been bothering me for a long time and maybe you guys know the answer. Does anybody have advice on how to properly structure lazy fetching of resources in nested views with Backbone + LayoutManager? Say you have a tree of views, and the topmost view calls render() (that's how LayoutManager does it at least) on its children views, which recursively go ahead and call render() on their own children etc. This is all fine and well until you need to fetch() a collection or a model in order to be able to render one of the views in the tree, an asynchronous operation. Do you essentially call fetch() on initialization of each view and immediately render a spinner in place, then register a callback on whenever the collection is done and just replace the contents? I think this is the simple case, but I also think there's a situation where some views don't quite know what children views to initialize until an outstanding fetch is completed, in which case now calling render() recursively cannot work, and you have to manually setup logic that checks for the presence of data. The other hassle is that you need to account for two ways of fetching data: sometimes you already have it (a user lazily fetched it before, and never reloaded the app), you can render right away, and sometimes you don't, so you need to do an async operation. Really wish this crap was less convoluted
|
# ? Dec 8, 2013 06:25 |
|
enthe0s posted:How did a comparison between Angular and Ember spur you into learning Backbone? Just curious since I also started picking it up recently. Because after messing around with both a bit, i had this conversation with myself: "I like Ember more so I'll learn that, but it looks like angular is the runaway train, so maybe I should learn that, but Ember fits my way of thinking, so I'll go with that, but there's so much more angular stuff coming out so maybe....and what exactly am I trading off by picking one over the other anyway? gently caress it, Backbone does 95% of what I need and I can figure it all out in an afternoon. "
|
# ? Dec 8, 2013 08:48 |
|
DreadCthulhu posted:Does anybody have advice on how to properly structure lazy fetching of resources in nested views with Backbone + LayoutManager? ... Do you essentially call fetch() on initialization of each view and immediately render a spinner in place, then register a callback on whenever the collection is done and just replace the contents? I think this is the simple case, but I also think there's a situation where some views don't quite know what children views to initialize until an outstanding fetch is completed, in which case now calling render() recursively cannot work, and you have to manually setup logic that checks for the presence of data. Use event listeners. They are meant to get out of callback hell and situations like this. Usually I assign a model or a collection to each view (or multiple views to the same model/collection), then assign the view to render itself on model/collection sync. For example, inside each view's initialize function: code:
|
# ? Dec 9, 2013 15:47 |
|
Does anyone have any suggestions on organizing large projects and coming up with trackable and achievable goals to prevent being overwhelmed? I feel like I'm getting no where on this thing because I spend too much time researching ways to do things instead of just doing them due to a lack of organization and structure. Any tips would be appreciated.
|
# ? Dec 9, 2013 18:13 |
What project management tool are you using? I'm not a die hard agile fanboy but it can be helpful to organize your project into epics, features, sprints, bugfixes, release schedules etc. Look into kanban too if you like writing stuff on post it notes
|
|
# ? Dec 9, 2013 18:50 |
|
A MIRACLE posted:What project management tool are you using? I'm not a die hard agile fanboy but it can be helpful to organize your project into epics, features, sprints, bugfixes, release schedules etc. Look into kanban too if you like writing stuff on post it notes Right now all I have is Todoist set up to try to somewhat organize my ideas/goals to track against, but I'm not all that impressed with it.
|
# ? Dec 9, 2013 19:27 |
|
https://www.scrumy.com is really cool, and has all the features a scrum beginner might want. My company paid a ton for some 500 ton giant, when this website could have done the same job for only $5 a month for the pro version.
|
# ? Dec 9, 2013 22:16 |
|
In PHP, if I want to connect to a DB, I usually set the DB connection details in some config file, or even the page source itself, and this information is never revealed to the end-user. However, I cannot figure out how to hide these details in a JS only app, where everything is exposed to the browser. Is it possible to store confidential details, such as DB passwords, in a JS file or similar, but prevent them from being read by the user?
|
# ? Dec 10, 2013 16:09 |
|
Do you have the difference between your server-side (nodejs) code and client-side code confused?
|
# ? Dec 10, 2013 17:03 |
|
Yeah. I could be misunderstanding (I'm almost entirely a back-end guy), but I can't see that you would ever want to expose DB credentials to a web browser. Where are you calling out to your DB from?
|
# ? Dec 10, 2013 17:27 |
|
I was wondering if it was possible to replace the database with AJAX calls to a third party, but I can't see a way to store the credentials without exposing them to the end-user.
|
# ? Dec 10, 2013 17:34 |
|
Why not set up a server-side script that accepts predefined actions from POST actions, and leave the DB abstraction to that? You could make calls to that through AJAX and never expose the DB.
|
# ? Dec 10, 2013 17:44 |
|
G-Prime posted:Why not set up a server-side script that accepts predefined actions from POST actions, and leave the DB abstraction to that? You could make calls to that through AJAX and never expose the DB.
|
# ? Dec 10, 2013 17:46 |
|
Pseudo-God posted:In PHP, if I want to connect to a DB, I usually set the DB connection details in some config file, or even the page source itself, and this information is never revealed to the end-user. However, I cannot figure out how to hide these details in a JS only app, where everything is exposed to the browser. Is it possible to store confidential details, such as DB passwords, in a JS file or similar, but prevent them from being read by the user? 1. You need to build a server-side layer between your DB and your client-side apps that communicates in JSON or whatever. 2. It's not possible to hide the auth info to a DB or the layer mentioned in the last point from the end-user. You can require logged-in users and that's about it.
|
# ? Dec 10, 2013 17:46 |
|
Pseudo-God posted:I want to do it without a server-side script at all, but I guess the tech is not here yet. Keep in mind, even if you found an elegant way to have user-run javascript authenticate to your DB in a secure way that the user can't hijack the credentials from (which doesn't seem possible), you're still relying on that script to make direct SQL queries, which hoses your security entirely. That's why you need the abstraction. Instead of blindly accepting queries, you've got predefined queries that the abstraction layer provides based on criteria that the user submits via the javascript.
|
# ? Dec 10, 2013 17:50 |
|
Thermopyle posted:1. You need to build a server-side layer between your DB and your client-side apps that communicates in JSON or whatever.
|
# ? Dec 10, 2013 17:51 |
|
Pseudo-God posted:Like I said earlier, apparently it's not possible to do this entirely in front-end JS. However, it may be possible to have a tiny PHP/ASP/node/ruby etc script, which can hold authentication data, and act as a relay to the external DB. This is a perfect use-case for a micro framework. Pick whichever one matches your language of choice, wire up some simple routes, and you're done.
|
# ? Dec 10, 2013 17:55 |
|
I got this idea a couple of days ago when I was checking out neocities.org. I was wondering if it could be possible for them to actually have a database hosted by a third party, but without the public having direct access to the data. It's not possible according to you guys, but a tiny server-side script could be used, in whichever language, to store these credentials and contact the third-party database. I also never said that SQL would be used, but an abstracted one, where you write to a URL, and get a URL back to access this data.
|
# ? Dec 10, 2013 17:55 |
|
Parse (https://parse.com/) and Firebase (https://www.firebase.com/) are hosted backends for a "static files application". Perhaps you should give them a look.
|
# ? Dec 10, 2013 17:59 |
|
Stoph posted:Parse (https://parse.com/) and Firebase (https://www.firebase.com/) are hosted backends for a "static files application". Perhaps you should give them a look.
|
# ? Dec 10, 2013 18:01 |
|
Knyteguy posted:Also has anyone tried developing with either with a Microsoft stack like MVC and SQL Server? Our entire site is a MS stack and it works great. Using MVC.NET 4.
|
# ? Dec 10, 2013 19:29 |
|
Anyone have experience with Ext.js or Sencha Touch? I've avoided it like the plague but I keep getting recruited for jobs that require it.
|
# ? Dec 10, 2013 23:07 |
|
If you hate manually designing and laying out HTML and just want to get some widgets on screen it's great. I also find I rarely have to go outside the framework for anything (except for stuff designed for it). Ext apps definitely behave more like native desktop/mobile applications but it's great for things where you want to think more about the widgets and components than the actual HTML. That said, my background is desktop applications. If you're used to jQuery callback soup and sperging over templating engines you may find the learning curve to be more of a cliff.
|
# ? Dec 11, 2013 01:26 |
|
Trying to build an Ember app on top of an existing API and I am having the most absurd problem. I want to authenticate certain routes. I've managed to grab the authentication token from the server and now I want to place it in X request header for every subsequent ajax call. How the hell do I do this? I try to call Ember.$.ajaxPrefilter and use a global variable to pass it from the controller to the function call(since I can't access controller variables in the prefilter call. For some reason). Doesn't set a header. I try to add a field to the json request sent to the server. Doesn't seem to be possible? Every google search seems to send me to an Ember-auth tutorial. I really don't want to implement 5 million gems when the entire auth process should involve passing one bloody variable from a controller into a json pre formatter.
|
# ? Dec 11, 2013 13:51 |
|
Pseudo-God posted:I want to do it without a server-side script at all, but I guess the tech is not here yet. To clarify, the tech will never be here because what you are talking about is fundamentally a bad idea. The problem is generally solved by wrapping the database in an API of some kind and then having the client query against the API. The goal is to never allow the client to say "I want to run SQL", you let them say "I want data" or "I want to write data" instead.
|
# ? Dec 11, 2013 14:14 |
|
sim posted:Anyone have experience with Ext.js or Sencha Touch? I've avoided it like the plague but I keep getting recruited for jobs that require it.
|
# ? Dec 11, 2013 14:24 |
|
I remember a few years ago when people still couldn't decide between jquery, prototype, mootools, etc., Extjs was _the_ thing to wow middle-manager types. Look at all those widgets! And we can write them in Java!
|
# ? Dec 11, 2013 18:33 |
|
NovemberMike posted:To clarify, the tech will never be here because what you are talking about is fundamentally a bad idea. The problem is generally solved by wrapping the database in an API of some kind and then having the client query against the API. The goal is to never allow the client to say "I want to run SQL", you let them say "I want data" or "I want to write data" instead. Dude, data comes from the cloud now.
|
# ? Dec 11, 2013 18:36 |
|
Ember newbie question: I'm trying to change this master/detail example. I want to add a "users" route instead of using the application route. Here is my attempt. How can I get the links to work? Edit: figured it out Sedro fucked around with this message at 17:05 on Dec 12, 2013 |
# ? Dec 12, 2013 01:25 |
|
NovemberMike posted:To clarify, the tech will never be here because what you are talking about is fundamentally a bad idea. The problem is generally solved by wrapping the database in an API of some kind and then having the client query against the API. The goal is to never allow the client to say "I want to run SQL", you let them say "I want data" or "I want to write data" instead. [20 pages of that Super Meat Boy hi score mysql fiasco]
|
# ? Dec 12, 2013 01:46 |
|
xf86enodev posted:Dude, data comes from the cloud now. Firebase (a real time key-value store as a service) has an interesting solution for this: security rules that let you limit access to your data. It's very, very simple (and built mainly for keeping a single user's data private to only them), but Firebase is only meant for simple data storage anyways (the real-time aspects are far more interesting than the actual "database"). But just pick something that makes it easy to write a minimal backend or API and you're good to go. We're not quite in a backend-less future, except for very simple use cases (though it is pretty awesome to prototype something w/o a backend).
|
# ? Dec 12, 2013 02:08 |
|
A backend-less future could be simulated by having a minimal backend, which is only used for authentication and security. In principle, there will always be data which should not be exposed to the user. For everything else, a JS only app is perfectly suitable.
|
# ? Dec 12, 2013 09:29 |
|
"Data is your most valuable asset" and "never trust the client" are the 2 most important mantras for people who want to do stuff with computers and networks. Either you control the data or you don't. If you want to control the data, you need to own the data source. This is the so-called backend. Mashups are kind of an example for something that works without a backend already by solely relying on external data sources. But as soon as those sources stop providing data those apps lose all of their functionality. So if you want to build something that works and you want to guarantee that it keeps working you need a backend. Moustaches own btw, don't know about handlebars though.
|
# ? Dec 12, 2013 22:48 |
|
excidium posted:Does anyone have any suggestions on organizing large projects and coming up with trackable and achievable goals to prevent being overwhelmed? I feel like I'm getting no where on this thing because I spend too much time researching ways to do things instead of just doing them due to a lack of organization and structure. Any tips would be appreciated. A bit late, but I've started to use Team Foundation Service in the cloud for this. It's free for teams up to 5 people and I think you can have unlimited repositories either as TFS or Git. http://www.visualstudio.com/products/visual-studio-online-overview-vs I went from a todo-list in notepad, to a todo-list in evernote, to finally settling on the hosted TFS solution above. I do everything from a mac using the web interface which is just fantastic, so I can easily add "to do" items to my backlog from any internet device pretty much. The great thing is that it supports git, so I have all my source code in git and all my issues and stuff setup in TFS. All my code is node.js. I'm probably not using all of the abilities, but I basically just outline all of my major goals as features, and break those up as tasks and assign them to myself and give myself a rough time estimate. I've been a member since beta, but just started using it seriously for my first project for a month and just completed my first "sprint" and it's really helped me keep myself organized and on-task and to keep my git commit history clean. You can automatically tie git commits to items as well just by referencing the item number in the commit message, similar to GitHub.
|
# ? Dec 17, 2013 09:44 |
|
abraham linksys posted:Firebase (a real time key-value store as a service) has an interesting solution for this: security rules that let you limit access to your data. It's very, very simple (and built mainly for keeping a single user's data private to only them), but Firebase is only meant for simple data storage anyways (the real-time aspects are far more interesting than the actual "database"). The server is literally javascript on a page in another browser tab. Hopefully leaving it running like that for hours is not an issue? (how do I dev web I do not know things) Xom fucked around with this message at 19:07 on Dec 18, 2013 |
# ? Dec 18, 2013 18:37 |
|
excidium posted:Does anyone have any suggestions on organizing large projects and coming up with trackable and achievable goals to prevent being overwhelmed? I feel like I'm getting no where on this thing because I spend too much time researching ways to do things instead of just doing them due to a lack of organization and structure. Any tips would be appreciated. Is your project on GitHub? Maybe try using some of the issues and milestones features?
|
# ? Dec 18, 2013 18:42 |
|
I want to learn about testing, both unit and integration. Can anyone point me at a real low-level, in-depth introduction? Something like Todo MVC for Javascript testing. I get the idea, but I don't know where to start, or how to approach writing tests, or even how to integrate testing into my workflow. It would be nice to learn by example.
|
# ? Dec 18, 2013 19:01 |
|
a lovely poster posted:Is your project on GitHub? Maybe try using some of the issues and milestones features? You can use them with https://waffle.io to get a nice view.
|
# ? Dec 18, 2013 20:34 |
|
|
# ? May 2, 2024 02:21 |
|
Kobayashi posted:I want to learn about testing, both unit and integration. Can anyone point me at a real low-level, in-depth introduction? Something like Todo MVC for Javascript testing. I get the idea, but I don't know where to start, or how to approach writing tests, or even how to integrate testing into my workflow. It would be nice to learn by example. It might not be exactly what you are looking for, but I found the book Test Driven Development by Kent Beck a really read on the subject. TDD is a bit "heavy", but even if you don't adopt the methodology, I think it will get you thinking about testing "the right way" .
|
# ? Dec 19, 2013 14:50 |