@bytebrahma
Programmer | Node.js | Learner| Doer
Nothing here yet.
Nothing here yet.
No blogs yet.
Hi, I figured out the way. npm install --save d3 ( this will include d3 in your package.json ) add the 'd3' as plugin in the webpack config js plugins :[ new webpack.ProvidePlugin({ d3: "d3" }) ] Ref: http://stackoverflow.com/questions/28969861/managing-jquery-plugin-dependency-in-webpack http://forum.vuejs.org/topic/882/newb-how-to-use-jquery-with-vue/6
Hi Shankar, I can think of using "Promises". https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise http://spion.github.io/promise-nuggets/ http://bluebirdjs.com/docs/getting-started.html The code would look like. call1() .then( val => { return call2(); }) .then(val => { return call 3 (); }) .then(val => { //the end })
Hi Robert, I was in a similar situation and I can understand how ugly the callbacks can get in JS (referred to callback hell/Pyramid of Doom). I found using "Promises", a new concept introduced recently in Javascript, made the code much readable. Check out bluebirdjs.com library which further abstracts the Promises' boilerplate code. It would also convert the traditional code with callbacks into a Promise. You may want to read the below: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise ( excellent article to start with! ) http://spion.github.io/promise-nuggets/
Thanks Mike. Webpack was already running in hot mode, I did not realize :) For point 4, here is what I need. Suppose there is a use case of listing employees(who are stored in an Oracle Db sever). Model and Views can be created in Vue.js. But a query should be run against the Oracle DB and transform it into a JSON and send it back to the Model. For this I think we need a middleware JS which accepts a POST request from Model object and respond with a JSON result object. {{ Model/View - Client JS }} < ---> {{ app.js GET/POST Server JS }} < ---> {{ Oracle DB }} Webpack has a built-in express app. How can we do this with Webpack?
I too agree with this thought. However along with REST-services, the backend Node.js server has to also serve pages and do routing for navigation between pages. Any library you would recommend for that?