Earlier quoted context omitted.
It's sad that your colleagues' lack of open-mindedness about adopting a framework is forcing you to create a less-well-specified, less-documented, implicit framework.
I think its more surprising that his/her collegues are down with ES6 through babel but are yet scared of something like React..
Boiling React Down to Few Lines in JQuery
31–35 of 35 posts
Re: Boiling React Down to Few Lines in JQuery
#32I use something a little similar where I work. No one would be on board with something like React but I've documented a way to write our code that does something similar to this post. We use js "classes" (Both Function.prototype and now js classes with babel) and lo-dash templates to make it a little nicer. Example: function MyComponent(element) { var instance = this; instance.element = element; instance.history = []…
It's sad that your colleagues' lack of open-mindedness about adopting a framework is forcing you to create a less-well-specified, less-documented, implicit framework.
Re: Boiling React Down to Few Lines in JQuery
#33I use something a little similar where I work. No one would be on board with something like React but I've documented a way to write our code that does something similar to this post. We use js "classes" (Both Function.prototype and now js classes with babel) and lo-dash templates to make it a little nicer. Example: function MyComponent(element) { var instance = this; instance.element = element; instance.history = []…
You're example is the perfect example of what not to do and why React, Angular and such exist: STATES. You want your view to be data driven.It means that your component should be STATELESS. There are other issues such as event delegation,cleaning up event listeners,... that will make your solution hard to scale past simple widgets.And before you know it,you'll be writing your own complicated framework that does less…
I am fully aware of this issue, again, this is a stop-gap between the jQuery mess we had and proper framework. This is not being used to run the whole front-end, it's only being used for components that are loaded on a page. And in fact the one page that we have that does a full re-draw on every change is actually extremely fast, you don't even notice it. Again, this is not to say it's the end goal, just a step on the staircase to a JS framework. Just getting away from building a component in PHP then modifying it in JS has been a huge win. My rule of thumb is logic should only be implemented in 1 language and so if you need to update/modify anything on the client side (which we almost always need to do, this is a Web App and not a website with some JS sprinkled in, even if that's how it started) you need to do it all in JS or else you get into a case all too easily where you edit the JS or PHP and not the other. Not to mention that if we wanted in the future we can alway render the first load on the server (using JS) and then subsequent renders could happen on the client with the same code.
Re: Boiling React Down to Few Lines in JQuery
#34Earlier quoted context omitted.
What's the biggest "program" you've written using solely jQuery? I recently completed something in the range of 3k lines using only jQuery and prototypical inheritance and realized later it probably could have very easily benefitted from picking up Backbone, at the very least to hold state better than sticking it in an object on the base class in various ways.
about 5k. Funny I thought about the same thing but in the end I considered the amount of work that would be required vs.something that is already working well, easy to understand, skillset being very low if someone needs to pick it up (just jQuery, not even weird object orientated bull crap). Yup, just one single .js file written in jQuery. I am however, curious about React.js, and want to experiment with new compone…
* Is it an application (google docs?), if not, you may not need a framework.
* How large is the team? For a solo project, a framework offers less of a consistency benefit. In a group, having people implement the same way can be important, and a framework helps a lot.
* Are you managing a lot of application state in javascript?
I'm out of time, but those are some of the big ones. I've used frameworks in the past, but we're currently doing a classic wizard-style application, and the frameworks don't offer us a lot. If it was less site & more application, I would be pushing for one of the popular frameworks to help manage complexity. Frameworks bring additional complexity, and they need to mitigate a certain amount of complexity to be worth it.
Re: Boiling React Down to Few Lines in JQuery
#35Earlier quoted context omitted.
about 5k. Funny I thought about the same thing but in the end I considered the amount of work that would be required vs.something that is already working well, easy to understand, skillset being very low if someone needs to pick it up (just jQuery, not even weird object orientated bull crap). Yup, just one single .js file written in jQuery. I am however, curious about React.js, and want to experiment with new compone…
There are a lot of factors that make a framework either worth it or not. Here are some that lean towards framework. * Is it an application (google docs?), if not, you may not need a framework. * How large is the team? For a solo project, a framework offers less of a consistency benefit. In a group, having people implement the same way can be important, and a framework helps a lot. * Are you managing a lot of applicat…