These are chat archives for reactioncommerce/reaction

5th
Oct 2016
Hai Nguyen
@nguphoha
Oct 05 2016 03:06
@zenweasel Can RC response a json string like a RESTful API
Brent Hoover
@zenweasel
Oct 05 2016 03:07
When you say “response a json string” what sort of response are you talking about? An HTTP response?
Jeremy Shimko
@jshimko
Oct 05 2016 03:08
and are you sure you don’t already have access to whatever data you want with a publication that already exists?
Hai Nguyen
@nguphoha
Oct 05 2016 03:08
Yes, an http response. I will call RC'core API from ajax and get the response to process
Jeremy Shimko
@jshimko
Oct 05 2016 03:09
Nope. Reaction is almost entirely websockets. No ajax needed
Brent Hoover
@zenweasel
Oct 05 2016 03:09
why would you want to do that?
Brent Hoover
@zenweasel
Oct 05 2016 03:11
there are ways to get RC to return JSON but generally it’s running counter to the main design philosphy of Meteor
If you need to interface with an external system you may want to do that, but it should not be how you client talks to the server.
Hai Nguyen
@nguphoha
Oct 05 2016 03:14
I have two approach with our project. one is build RC plugin and another is use html page, which has been designed, and user ajax (angular) to call RC's core API.
Brent Hoover
@zenweasel
Oct 05 2016 03:15
trying to use AJAX with a Meteor project is putting a square peg in a round hole
While theoretically it will work, it’s going to cause you a lot of grief
You can use Angular with Meteor however: https://www.angular-meteor.com/
Hai Nguyen
@nguphoha
Oct 05 2016 03:16
Can I install RC core in that ??
Brent Hoover
@zenweasel
Oct 05 2016 03:17
well, understand that you would need to build an entirely new front-end from scratch
but yes you can use RC with angular.
a lot of RC’s strength is in it’s reactive nature which is powered by DDP. So to go backwards to using AJAX would be throwing a lot of what RC gives you out the window
this is the future of web development (using websockets rather than HTTP)
Brent Hoover
@zenweasel
Oct 05 2016 03:23
using RC for AJAX would be like driving from Paris to Hamburg in 2nd gear. It’s possible, but a terrible idea.
Hai Nguyen
@nguphoha
Oct 05 2016 03:24
ok. Thanks for your supporting. I'm researching two approach and compare them to get the best solutions for the project
Brent Hoover
@zenweasel
Oct 05 2016 03:24
Ok. You might want to give a quick read to the links that @jshimko sent
just to understand how Meteor works with data
Hai Nguyen
@nguphoha
Oct 05 2016 03:32
I see that, RC'client used Blaze template and I can't use other template like angularjs
Brent Hoover
@zenweasel
Oct 05 2016 03:33
well, you could use Angular to replace parts of front-end
for example, if you only want to replace product grid, product detail, etc. but leave the admin as-is
Hai Nguyen
@nguphoha
Oct 05 2016 03:50
In my html page (front-end), there are some javascripts, How can I make javascript run smoothly when using RC
Brent Hoover
@zenweasel
Oct 05 2016 03:53
if you are talking about some typical animations, etc they should work fine without any modification
Hai Nguyen
@nguphoha
Oct 05 2016 03:56
And how can I add tag <script src=""/> into my pages
Brent Hoover
@zenweasel
Oct 05 2016 03:57
what are you trying to include?
Hai Nguyen
@nguphoha
Oct 05 2016 04:02

I'm trying to include like that:
Template.coreLayoutBeesknees.onRendered(function(){
// console.log("==========core layout rendered==========");

$("footer").append("<script type='text/javascript' src='js/jquery-2.1.4.min.js'/>");
$("footer").append("<script type='text/javascript' src='js/smooth-scroll.min.js'/>");
$("footer").append("<script type='text/javascript' src='js/scrollreveal.min.js'/>");
$("footer").append("<script type='text/javascript' src='js/parallax.js'/>");
$("footer").append("<script type='text/javascript' src='js/owl.carousel.min.js'/>");
$("footer").append("<script type='text/javascript' src='js/scripts.js'/>");

$.getScript("js/scripts.js", function() {
console.log("==========get scripts==========");
});
});

Brent Hoover
@zenweasel
Oct 05 2016 04:04
no you want to include things so they can be built by Meteor
jQuery for example is already included, you wouldn’t want to include it twice
Hai Nguyen
@nguphoha
Oct 05 2016 04:06
I will remove including jQuery, does the way I include correct ?
Brent Hoover
@zenweasel
Oct 05 2016 04:06
generally no
you would want to install the packages and then just import them where you need them
Hai Nguyen
@nguphoha
Oct 05 2016 04:09
I have to find meteor package corresponding with each js and install them into project
Brent Hoover
@zenweasel
Oct 05 2016 04:10
not Meteor packages, npm packages
there is very little in the Javascript world that is not available as an NPM package
You may want to look at package.json to see what is already installed
Hai Nguyen
@nguphoha
Oct 05 2016 04:11
yes, I found these package in the meteor packages and some package does not work well as I aspect
Brent Hoover
@zenweasel
Oct 05 2016 04:11
no, not Meteor packages
Meteor packages have been deprecated
Meteor is moving towards using NPM for everything
which is also what the rest of the JS world uses
are you familiar with NPM?
Hai Nguyen
@nguphoha
Oct 05 2016 04:13
I can find these packages herre https://www.npmjs.com/ ??
Brent Hoover
@zenweasel
Oct 05 2016 04:14
Correct
Hai Nguyen
@nguphoha
Oct 05 2016 04:15
and use commandnpm install --save which-packages-i-want to install the packages into my project
Brent Hoover
@zenweasel
Oct 05 2016 04:15
exactly
you probably want to do meteor npm install
Hai Nguyen
@nguphoha
Oct 05 2016 04:16
without --save option ?
Brent Hoover
@zenweasel
Oct 05 2016 04:17
no, you had the correct command, just prefix with meteor
Hai Nguyen
@nguphoha
Oct 05 2016 04:19
thanks so much, Brent
Brent Hoover
@zenweasel
Oct 05 2016 04:20
:+1:
Michael Jenny
@prinzdezibel
Oct 05 2016 16:36
Hi guys, a customer wants me to develop a meteor application that is going to be auto-depoyed to AWS via Go.CD (phoenix server is a requirement). Now I'm wondering if Launchdock could be of use for me (I don't know anything about it), and if its license is compatible with the proprietary environment of my customer.
if it's relevant: it's not a shop but a monitoring service that is going to be created with meteor.
Aaron Judd
@aaronjudd
Oct 05 2016 17:38
you might want to check out docker cloud or AWS container services, you can do auto-deploy fairly easy with those tools. It's true that LD can manage that process, but if you're talking about a production/staging/single app kind of deployment, LD might be overkill (but LD will work with any containers, not just Meteor)
Michael Jenny
@prinzdezibel
Oct 05 2016 18:04
Thank you @aaronjudd! Can you tell me, if there's a canonical meteor-react-app base image on dockerhub? I've found some, but judging on the stars alone, it doesn't seem they are the "de facto" images that everybody else uses.
sorry for being OT.
Jeremy Shimko
@jshimko
Oct 05 2016 21:53