These are chat archives for reactioncommerce/reaction

13th
Sep 2017
Josh Cox
@joshuacox
Sep 13 2017 02:49
@zenweasel mysql and mongodb are not even the same thing so this is understandable, Postgres on the other hand has had hstore for quite awhile, and even does JSON these days at perfomances that are competitive to Mongo, has anyone thought about abstracting the database to use either one?
Brent Hoover
@zenweasel
Sep 13 2017 02:50
Right, I’m aware. Most of my experience is with Postgres, however you still need to simulate the Oplog
and still you would need to touch every place in the app where we touch a collection
Josh Cox
@joshuacox
Sep 13 2017 02:51
ya does not sound fun
Brent Hoover
@zenweasel
Sep 13 2017 02:52
I had assumed the question was could you database: Mongo to database: MySQL
I think the idea is that Apollo/GraphQL is the road to being database-agnostic
if there was some wrapper around Postgres that made it behave like Mongo, maybe?
there’s a lot of stuff out there for Postgres so I wouldn’t be shocked
it would also need to be compatible with entire API, not just Collection.find()
Josh Cox
@joshuacox
Sep 13 2017 02:57
an interesting path indeed, Mongo is looking stable these days, but database independence can bring about more mass appeal, it would be interesting to see a performance showdown between the two running RC, I've seen some tests where PG outperforms mongo
Brent Hoover
@zenweasel
Sep 13 2017 02:58
I know from my days working with Django that even abstracting out data stores between two SQL databases was not simple
much less two data-stores with completely different API's
Josh Cox
@joshuacox
Sep 13 2017 02:59
ya I'm sure it can be a mess
Brent Hoover
@zenweasel
Sep 13 2017 03:00
I never found the hstore API to be very intuitive either
Josh Cox
@joshuacox
Sep 13 2017 03:00
Seems like priority around here should (and rightly so) is to get the react stuff down pat, who is working on the tutorial? is there a branch for that?
react*
Brent Hoover
@zenweasel
Sep 13 2017 03:01
tbh that should probably be me, but I am heads-down on marketplace stuff as we speak
Josh Cox
@joshuacox
Sep 13 2017 03:02
get back to it, I am going to go back through the tutorial and I'll identify any problems, and verify some of the stuff in here
Brent Hoover
@zenweasel
Sep 13 2017 03:03
the main thing that is broken is the parts about replacing/orderriding templates. It needs to replaced with a chapter covering the new Components API
Hopefully Erik and Mike should have some insights soon
shahid belal
@ConnectBelal_twitter
Sep 13 2017 07:02
how can i install reaction commerce on ubuntu
basically you need to install the CLI
Akarshit Wal
@Akarshit
Sep 13 2017 07:07
I had a doubt. https://github.com/reactioncommerce/reaction/blob/master/server/methods/catalog.js#L824-L825
^ Why are we making a JSON ourselves and then parsing it?
Brent Hoover
@zenweasel
Sep 13 2017 07:08
we are not. You see it’s using that value in a string/value pair
as to why it’s doing that, I don’t know
because we want to parse the whole thing at once
Akarshit Wal
@Akarshit
Sep 13 2017 07:24
// Let field = 'name' and value = 'jon doe'
const stringValue = EJSON.stringify(value); // stringValue = "jon doe"
update = EJSON.parse("{\"" + field + "\":" + stringValue + "}"); // update = EJSON.parse("{ "name": "jon doe" }") => { name: 'jon doe' }
Couldn't this have been achieved by using update = { [field]: value } ?
I am asking because I am adding similar lines here and wanted to know if there would be some case I might miss(because of not making and parsing JSON).
Brent Hoover
@zenweasel
Sep 13 2017 07:29
yeah, reasonable question. A comment there would be helpful
but I don’t know
Akarshit Wal
@Akarshit
Sep 13 2017 07:36
Cool!
Patrick Tavares
@patrick-tavares
Sep 13 2017 11:52
Anyone else seeing a failure to install react-addons-shallow-compare (required dep of react-avatar) after a reaction reset or a fresh clone (npm WARN react-avatar@2.4.0 requires a peer of react-addons-shallow-compare@^0.14.0 || ^15.0.0 || ^16.0.0 but none was installed.)?
A manual install (meteor npm install --save react-addons-shallow-compare) fixes this... just curious why the auto dependency resolution isn't catching this
Brent Hoover
@zenweasel
Sep 13 2017 12:08
yeah, that’s a thing
apparently some change to react-avatar
phenomenon01
@phenomenon01
Sep 13 2017 12:37
How to set Discount rates?
Docs about Discout codes is given , but discount rate is not given ?
Brent Hoover
@zenweasel
Sep 13 2017 12:49
Discount rates have not been implemented yet
Daniel Honig
@dhonig
Sep 13 2017 16:17
@spencern @aaronjudd
Largely abstracted from Aaron's post way back in 2015
reactioncommerce/reaction#330
I'm trying to think of the membership scenarios mentioned and understand how important they are
Aaron Judd
@aaronjudd
Sep 13 2017 16:47
I don’t even remember creating that issue, but still looks pretty accurate
Spencer Norman
@spencern
Sep 13 2017 16:48
Back when you had time to write super detailed specs, I remember those days
Daniel Honig
@dhonig
Sep 13 2017 16:48
The stuff about membership etc. I'm trying to figure out if that's even important
Let's say I fill out a subscription for my Son who needs the basics shipped to him at college
Aaron Judd
@aaronjudd
Sep 13 2017 16:48
really that’s just a role I’d say..
Daniel Honig
@dhonig
Sep 13 2017 16:48
Ok
what was your idead about how roles apply?
Aaron Judd
@aaronjudd
Sep 13 2017 16:53
the use case I was thinking of (apparently) is where you pay, and get a “subscriber” role, that lets you access whatever content that is subscriber-only. just a step in the flow/experience, but not necessarily related to the actual payment/subscription/or product
Daniel Honig
@dhonig
Sep 13 2017 16:54
yeah thats all I can think of it as
So lets say we had a screen to edit the variants in a subscription
that would be unlocked to the user
Daniel Honig
@dhonig
Sep 13 2017 17:34
The other thing that has to be said is that the gateways such as Stripe/Braintree have really done a better job of building out this functionality than at any point in the past. So we really just need to record the users choices, synch them with the gateway and then listen for events in the gateway via webhook. We don't need to use a users payment token and run the payment ourselves as we would have had to do previously
Daniel Honig
@dhonig
Sep 13 2017 18:04
I think its better now than ever to use windows for development
@joshuacox things like Chocolatey and cmmder help out alot
Josh Cox
@joshuacox
Sep 13 2017 18:11
@dhonig judging from the support requests in this chat room, and from my own experiences helping others and with my own occasional experiences booting into windows and trying things there. I would not suggest that anyone ever develop in windows. I would ask that you start supporting those that choose to do so if you are going to advocate it, or write up some documentation for it, as it is something that does not seem to go very well.
Daniel Honig
@dhonig
Sep 13 2017 18:12
@joshuacox well as I write to you from my manjaro/linux build, I'm an unlikely candidate to lead support. Still it seems wrong that, 'Use vagrant, install linux, install cygwin' is our support strategy for a node.js project :)
I think what might be a good compromise is if we had a dockerfile for windows development and instructions on how to develop in docker
Josh Cox
@joshuacox
Sep 13 2017 18:15
@dhonig ;) I completely understand, and use cygwin in windows, and personally I'd rather you work on the subscription stuff :P Which I want working as well, my dev environment works great (most of the time, and when it doesn't I have a dockerized version )
Daniel Honig
@dhonig
Sep 13 2017 18:15
yeah subscriptions are my focus for the next coupla weeks
Maybe if someone emerges thats strong and wants to lead the windows camp we can support them
Josh Cox
@joshuacox
Sep 13 2017 18:16
do you have a branch somewhere where we can follow along? I'll even pitch in if I can
Daniel Honig
@dhonig
Sep 13 2017 18:17
Not yet
just put up the requirements in a Wiki
and now I'm banging out the "SimpleSchema"
maybe I'll do a drawing on the domain model for i
t
we'll see
I want to TDD'it the entire way along then put on the interface later
Josh Cox
@joshuacox
Sep 13 2017 18:18
very nice on that, and let us know when you do get something up, like I said I'll pitch in if I can, I'm going back through the tutorial right now trying to wrap my head around plugin dev
Daniel Honig
@dhonig
Sep 13 2017 18:20
its just this for now:
I need to break this down into individual issues
and features and work on it feature by feature
Josh Cox
@joshuacox
Sep 13 2017 18:21
starred and watching
Daniel Honig
@dhonig
Sep 13 2017 18:21
but I needed to think about the domain model a bit
to think about how it works
Josh Cox
@joshuacox
Sep 13 2017 18:23
my needs are very similar to what @aaronjudd had said earlier, I want to be able to give access to another section of the site, a control panel to be able to spin up other services from rancher
Daniel Honig
@dhonig
Sep 13 2017 18:23
From a domain model perspective
I am thinking that we have an enumeration
that defines the period
Daily
or whatever
and then we calculate the 'next_subscription_date'
from the enumeration
so subscription has a start_date
and a next_payment_date
but next_payment_date is based on a configurable period
Josh Cox
@joshuacox
Sep 13 2017 18:24
in my case, it would be nice if the customer gets to choose the interval, and they just get charged a per transaction fee, this way if they want fewer transaction fees they choose longer intervals
Daniel Honig
@dhonig
Sep 13 2017 18:25
Right so Subscription/Plan are the same object
you would choose the interval
and then the next_payment_date is set upon save based on the interval type
blob
This makes it easy to map to Stripe
Josh Cox
@joshuacox
Sep 13 2017 18:28
I think it all sounds good to me, I can always just iterate out other product types for different intervals (which would most likely get better rates etc )
Daniel Honig
@dhonig
Sep 13 2017 18:28
yeah I want to design it so we can swap out stripe for braintree/chargify
without too much craziness
but I don't want to have a ton of abstraction to get there either
Josh Cox
@joshuacox
Sep 13 2017 18:29
^thinking towards abstraction of the payment providers seems like a very sane top priority
Daniel Honig
@dhonig
Sep 13 2017 18:29
80/20 as with everything
There are some business models that won't be addressable by the plugin
thats a given....but those folks will know and it will be a custom job, but we can provide the starting point and some useful design
Josh Cox
@joshuacox
Sep 13 2017 18:30
cheap, fast, good <--- pick two (another engineering adage I've found to be universal)
Josh Cox
@joshuacox
Sep 13 2017 18:42
not sure I caught the 80/20 thing as the Pareto Principle, I've heard various adages like "You can do 80 percent of the work in 20% of the time, but that last 20% of work will take you 80% of the time".
Daniel Honig
@dhonig
Sep 13 2017 18:59
@joshuacox thats a good. one. Let' just get some recurring payments going through stripe for one or more reaction products/variants and then we can figure out some conference to meet up at, wear our smoking jackets and philosophize :)
blob
Looks like the metadata of the subscription changes based on the provider
so perhaps we have some kind of flexibility or provider specific metadata class
to capture that
Josh Cox
@joshuacox
Sep 13 2017 19:27
@dhonig all sounds great with me, I've got your code in a dev instance now looking around at it.
Daniel Honig
@dhonig
Sep 13 2017 19:28
You mean lack of code
:worried: :)
Josh Cox
@joshuacox
Sep 13 2017 19:28
yep
Daniel Honig
@dhonig
Sep 13 2017 19:28
Yeah I'll be working on it everyday
so it should grow quickly. Feedback/advise is very welcome
Josh Cox
@joshuacox
Sep 13 2017 19:28
I'll be following along, feel free to stub out work as issues, perhaps I'll tackle some of it in a feature branch etc
Daniel Honig
@dhonig
Sep 13 2017 19:29
I've got to break in a few minutes
but by tomorrow mid-day I should have some basic tests going and then I can tag you on a feature/test here or there
this is something that benefits from many eyes
Josh Cox
@joshuacox
Sep 13 2017 19:30
same here, I've got a kayaking run this afternoon, I'll look forward to pulling any changes you make tomorrow
Daniel Honig
@dhonig
Sep 13 2017 19:30
Jealous here!
enjoy the kayaking!
Josh Cox
@joshuacox
Sep 13 2017 19:30
you enjoy your break as well!
machiko
@machikoyasuda
Sep 13 2017 19:39
shout out to @spencern for an excellent explanation of how to document private and public functions w/ jsdoc in reaction: https://github.com/reactioncommerce/reaction-docs/issues/275#issuecomment-329253641
Spencer Norman
@spencern
Sep 13 2017 19:43
Note: I consider that explanation to be the start of a good discussion on how we can best document our code and not necessarily the canon on how exactly to do it
Would love feedback (positive, negative, or neutral) and other ideas as well. I’m pretty new to jsdoc and definitely don’t have it all figured out
Daniel Honig
@dhonig
Sep 13 2017 19:46
Thanks for taking the plunge. Will have a chance to do so with the subscriptions
Ok so the subscription billing party has started https://github.com/boomerdigital/reaction-subscription-billing/
I'll be working on breaking down the features into specific issues tomorrow morning and will continue the implementation after through a TDD approach
I'm off for now...
Spencer Norman
@spencern
Sep 13 2017 19:48
✌️
machiko
@machikoyasuda
Sep 13 2017 19:51
Thanks for updating us on that @dhonig !
machiko
@machikoyasuda
Sep 13 2017 20:05
What are you excited most for in Meteor 1.6? https://blog.meteor.com/whats-coming-in-meteor-1-6-2f892cee18