These are chat archives for reactioncommerce/reaction

11th
Dec 2018
Loan Laux
@loan-laux
Dec 11 2018 09:33

Hi all! I'm writing unit tests for a GraphQL mutation that calls Reaction.Email.send at some point. As part of my tests, I want to make sure the email is sent. Since my test file lives at the resolver level (in the no-meteor folder), I don't have access to meteor/practicalmeteor:sinon, which I would usually use to create a sandbox, stub Reaction.Email.send and expect it to be called.

Two questions: can I use sinon from a no-meteor test file? If I can't, then how can I make sure this mutation sends this email?

Loan Laux
@loan-laux
Dec 11 2018 09:59
@ishasaran First of all, I would advise against using Blaze templates to wrap your React components. Instead, you can simply register your RCHeader component with Reaction's registerComponent method. Give it the name levelKidsPDPSimple and remove the [plugin]/client/templates/ directory altogether. The React component will be directly rendered instead of being wrapped in a Blaze template. It's cleaner and less prone to errors popping up.
Second, make sure that your new product-detail-simple plugin takes over Reaction's default. Use the priority: 0 property in your registry entries (where your routes are defined).
Finally, you probably know this but the recommended way to build a project with Reaction is now using the GraphQL API and a detached storefront. The legacy Meteor front-end will be discontinued on January 1st 2019.
Loan Laux
@loan-laux
Dec 11 2018 10:06

Not only will you comply and get frequent updates, but your site's performance will improve by a lot (especially TTFP) and your developer experience will be much better. With Reaction 1.x, your workflow probably suffers from high rebuild times, which are basically gone for the front-end side on 2.x.

I would highly recommend switching if you're not far into development of this project.

Isha Saran
@ishasaran
Dec 11 2018 10:13
@loan-laux Firstly, thank you for listening! :) Correct me if I understand you correctly, you're advising to switch to 2.x of reaction.
Ummm I am on reaction 2.x at the moment, began with the same. Before even reaching the point of using GraphQL APIs, I wanted to play around with just a "hello world" customization to the existing product details page, which is what I was trying to achieve in the above 1-5 steps (as explained in the documentation for 2.x).
Loan Laux
@loan-laux
Dec 11 2018 10:17
My bad, I was saying that you should use the Next.js storefront and not the Meteor one. Even in 2.x, this Meteor storefront will not receive any further updates and all of the development efforts are currently focused on the detached storefront.
Isha Saran
@ishasaran
Dec 11 2018 10:17
aaahhh the reaction-next-starterkit
Loan Laux
@loan-laux
Dec 11 2018 10:17
Working your way from the Meteor storefront to the Next.js one will probably only bring confusion. I would jump straight to Next.js + GraphQL. Save time and headaches. :)
Isha Saran
@ishasaran
Dec 11 2018 10:18
Ohhhh okay! Lemme quickly do that :)
Thanks a ton Loan!
Isha Saran
@ishasaran
Dec 11 2018 10:34
While getting the docker compose up @babel/plugin-proposal-json-strings cannot be found
Is this an existing issue?
Loan Laux
@loan-laux
Dec 11 2018 10:36
That's weird. Never came accross that. Did you try using https://github.com/reactioncommerce/reaction-platform though? I personally don't bother running docker-compose unless for specific situations.
Isha Saran
@ishasaran
Dec 11 2018 10:37
so when I am inside the reaction-next-startkit, I just need to run reaction after running a make in the parent folder reaction-platform?
Loan Laux
@loan-laux
Dec 11 2018 10:37
reaction should start by itself when you use the make command. Doesn't it?
Isha Saran
@ishasaran
Dec 11 2018 10:38
uhhh no
Loan Laux
@loan-laux
Dec 11 2018 10:38
Ah, if it disappears after a while in your docker ps I know what is causing this. Did you change your memory allocation in Docker's control panel?
Isha Saran
@ishasaran
Dec 11 2018 10:39
therefore, according to their documentation I was running the make command and then running reaction --port 9001 command with a different port. but this then uses the reaction and not the Next+GraphQL reaction-next-starterkit
Loan Laux
@loan-laux
Dec 11 2018 10:40
The make command is supposed to launch all the services. You shouldn't have to launch reaction manually. But if you haven't allocated more memory to Docker, it's highly probable that reaction fails during the build phase. Hence my question — did you change your Docker memory allocation settings?
Isha Saran
@ishasaran
Dec 11 2018 10:41
nope, didn't touch anything as such.
Loan Laux
@loan-laux
Dec 11 2018 10:41
Good, then that's probably your problem. Which OS are you running on?
Isha Saran
@ishasaran
Dec 11 2018 10:45
Mac OS sierra 10.13
I changed the Docker memory settings as mentioned - 3gb & 1.5gb
Loan Laux
@loan-laux
Dec 11 2018 10:46
I have mine set to 6GB just in case
I'd say 3 is a minimum, but I've seen cases where it needed more. Depends on what your machine has available of course but go for the maximum.
Isha Saran
@ishasaran
Dec 11 2018 10:48
okay done waiting for docker to be uo
up*
re-running make
Loan Laux
@loan-laux
Dec 11 2018 10:48
:+1:
Isha Saran
@ishasaran
Dec 11 2018 10:50
but shouldn't there be an error when running make that it couldn't get the FE app up?
Loan Laux
@loan-laux
Dec 11 2018 10:54
I think you're right. That should probably be reported on the reaction-platform repo.
Isha Saran
@ishasaran
Dec 11 2018 10:55
So I have figured the reaction-next-starterkit_web service is not getting up
I am trying for a make init-... for the same
Also I'll get an issue up in their repo for reaction-platform
Loan Laux
@loan-laux
Dec 11 2018 10:57
Do a docker ps right after your make init-[...] and docker logs -f [container_id] to see what's going on behind the scenes.
Usually the answer is in the logs.
Isha Saran
@ishasaran
Dec 11 2018 10:57
yes, it gives me the same issue again @babel/plugin-proposal-json-strings cannot be found
Loan Laux
@loan-laux
Dec 11 2018 11:04
Let's try and wipe your volumes if that's okay for you. This shouldn't be happening, but once we get it up and running you'll be all set up. Run make clean and start over.
Isha Saran
@ishasaran
Dec 11 2018 11:05
okay
lemme try that :)
Loan Laux
@loan-laux
Dec 11 2018 11:05
I think that the first attempt at doing yarn install wasn't entirely successful and it kept running for some reason, leaving you with an incomplete node_modules directory.
Isha Saran
@ishasaran
Dec 11 2018 11:06
I feel so too.
I see this when make is still in progress
yarn install v1.12.3
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.4: The platform "linux" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > react-tracking@5.2.1" has unmet peer dependency "babel-runtime@^6.20.0".
warning " > react-tracking@5.2.1" has incorrect peer dependency "react@^15.0.0".
and then
[4/4] Building fresh packages...
warning Ignored scripts due to flag.
Isha Saran
@ishasaran
Dec 11 2018 11:12
I think it's up now
I can finally access it on 4000
Loan Laux
@loan-laux
Dec 11 2018 11:13
Awesome! And is your backend working on 3000?
Isha Saran
@ishasaran
Dec 11 2018 11:14
It surely is Mr. Loan!!!!
After days of running round in circles
Loan Laux
@loan-laux
Dec 11 2018 11:14
Well, looks like you're all set. Enjoy. :+1:
Isha Saran
@ishasaran
Dec 11 2018 11:14
I had quit on the next kit
THank you so much! CHeres!~
Alice Barker
@puppycodes
Dec 11 2018 19:13
Looks like the link under "Developers -> Customize" is 404
on the homepage
Janne Rantala
@janne-rantala
Dec 11 2018 20:37
Hi, I'm looking for a platform to our new web store. The link to the demo shop in the website is broken (https://swag.getreaction.io/) --> can anybody point me a shop created wit Reaction Commerce?
Loan Laux
@loan-laux
Dec 11 2018 21:00
S Tunji Turner
@stunjiturner
Dec 11 2018 21:32
@loanlaux what version of reaction is pressedjuicery using?
Loan Laux
@loan-laux
Dec 11 2018 21:45
@stunjiturner It's using the Meteor storefront, so it could get better in terms of performance although it is the best example I have on hand in that regard. No idea what version of the backend they're using though.
However they've definitely implemented server-side rendering, which is part of why their TTFP is extremely low for a Reaction store.