JavaScript ES6 project and jQuery - javascript

I have been asked to work on a project and to use ES6 when coding the JavaScript on the project.
The project also needs to use React.
I've been searching for the answer to the following question on google but I haven't been able for get it answered so I hope I am allowed to ask this question here.
My question is ... If I need to use ES6 and React on this project, does that mean that I cannot use jQuery?

You can use jQuery along with React and ES6. At the end of the day, it's all JavaScript. However, if you structure your code correctly with React components, you should not need to use jQuery selectors to make any changes to the DOM.

Related

Multiple Javascript Framework on a single application

I have a project handling in which already built most of its features and uses laravel and knockout js. But I want to use Vuejs on this one because I dont know yet about knockout and I like vuejs. My concern is, is it possible that I can use both witout conflicting, or im thinking to use vue for specific part of the applicaiton like, live web alerts.
please let me know the pros and cons about this, thank you.

angular2-material2 using ES6:

is there any way to start with angular2 material2 using ES6?
I have tried to find the way but Failed.
Also checked the git repo where found that all code exist for now with TS
so does it mean we can't able to use it with ES6
is there atlernative to overcome it?
Yes, with Angular you can use vanilla JavaScript - either es5 or es6 - your choice. You can also use Typescript or Dart. Many of the tutorials you see use Typescript, because it works so well with Angular, and because the Angular team use it as their default. But you're certainly not tied to having to use that. If you prefer to use vanilla JS you certainly can -- because, remember, it all gets compiled down to JS, regardless of what you use for your coding.
Also, you can use Material2 regardless of what language and language version you're using to code with in your Angular app.
More info here: https://angular.io/docs/js/latest/quickstart.html
And to use Material in your Angular app, see this: https://material.angular.io/guide/getting-started

How to add d3 GWT wrapper to vaadin?

I tried adding the d3 gtw wrapper found here to Vaadin. But since I am newby to Vaadin/GWT I am a bit confused as to how exactly I can add and use the wrapper.
I tried adding the wrapper to the project as per manual using maven but I kept getting javax.servlet.ServletException: com.vaadin.server.ServiceException: java.lang.NoClassDefFoundError: com/github/gwtd3/api/D3. I get no warning in eclipse and I can see the documentaton for the classes when coding.
Thanks!
If you want to use d3.js library you have 3 options.
Add d3.js using #JavaScript annotation. This option is explained in details on Vaadin website.
Better approach (more clean, and easier to maintain in longterm) would be to write custom Vaadin component based on GWT. You can add and use your d3.js file while producing new GWT component. After that export it to the jar, recompile widgetsets and you can use it your Vaadin app. This approach is explained in details here.
Check out already developed addon for Vaadin Freecode Charts and D3 Wrapper . Maybe functionality provided in this one will be just enough for you.

AngularJS and jQuery... What's wrong with using both?

I saw a few blog articles saying that AngularJS and jQuery could be used together in one app. That seems good as jQuery has some functionalities Angular doesn't have and Angular allows us to make a greatly structured logic for a web app.
The fact is, as I'm french I also take a look at french blog articles about that, and french tends to say that we should never use jQuery and Angular together. I asked why on a forum and people said that it's probably because beginners usually use jQuery and Angular for the same things : adding elements dynamically, use ajax requests, etc... But I'd like to use jQuery for some things Angular does not do and to allow bootstrap js to work on my app.
What do you think, are jQuery and Angular bad at working together in one single app? Or does it just depend on how we make them work together?
AngularJS uses JQuery itself, the major reason not to mix and match is just what you described of them stepping on each other's toes.
While I was learning Angular a lot of the time I would end up using JQuery alongside it because I didn't understand Angular or know it's full capabilities. After learning it better my code has continuously less JQuery in it, but if I can't figure it out in angular, I'll make sure it works with JQuery until I can get it.
I guess it depends on what you're aiming for. If you want to develop an Angular app, then Angular already includes a version of jQuery called jQlite, but you can still use jQuery in your Angular app if you want to.
You can actually "wrap" jQuery code into custom Angular directives, which is pretty sweet.
In an Angular app it's safe to include jQuery if you want to implement some Bootstrap functionality. Currently, I'm doing that to implement Bootstrap's collapse component. I have only just begun developing in Angular, so I am not an expert as to all the ins-and-outs of using jQuery with Angular.

reactJS with jQuery or JS

I'm pretty new to ReactJS and a bit confused on how to use it. I understand the basics but when I want to build more complex things, I tend to start thinking in jQuery or JavaScript. For instance if I want to build a web app that print letters from a string on page load, I know how to do it in jQuery but I have no idea how to create it with React. And the tutorials covers only the basics. So my question is, how can I learn to use React in more complex ways? Is it possible to use jQuery or JS in React?
Basic js is easy obviously, but plugin use is documented here: https://facebook.github.io/react/docs/working-with-the-browser.html

Categories