These are chat archives for reactioncommerce/reaction

20th
Oct 2015
newsiberian
@newsiberian
Oct 20 2015 11:33

Hello, @aaronjudd. If you remember I asked you about routing and other strange things some time ago. I have a small question about subscriptions. I turned off Iron router. My first goal is to move all subscription into a components (react). I'm not pretty familiar with Iron router, but you have something like this:

Router.waitOn(function () {
      this.subscribe("Shops");
      return this.subscribe("Packages");
});

and then

waitOn: function () {
     return this.subscribe("Products", Session.get("productScrollLimit"));
 }

Is there some significant subscribing order here?

Can I subscribe to this three like here:

this.subscribe("Shops");
this.subscribe("Packages");
this.subscribe("Products", Session.get("productScrollLimit"));

or I need to keep loading order like here:

this.subscribe("Shops");
Shops sub is Ready?
this.subscribe("Packages");
Packages sub is Ready?
this.subscribe("Products", Session.get("productScrollLimit"));
Aaron Judd
@aaronjudd
Oct 20 2015 14:41
@newsiberian you could just move all the subscriptions into the subscriptions.js, what's going on here is that we're waiting to subscribe until you actually need the data, otherwise you're loading all data up front, before you actually need it. It's mostly about performance, and timing .
newsiberian
@newsiberian
Oct 20 2015 14:43
@aaronjudd , thank you.
@aaronjudd I have another small question, if you don't mind. What is a benefit from putting images in span and using them from background in "product-grid-item-images" class?
Aaron Judd
@aaronjudd
Oct 20 2015 14:52
don’t really remember :worried: @mikemurray?
probably won’t remember until we start to change it ;-) then I’ll remember, lol
newsiberian
@newsiberian
Oct 20 2015 15:14
There is a bug then item has a few images and you (not logged in as admin) trying to move mouseover one of these small images and hold on on one of them. Images are starting to change many times. Firefox and Opera has same effect. Reaction was updated few days ago...
Michael Jenny
@prinzdezibel
Oct 20 2015 17:46
@aaronjudd What is the weightedClass thing in the product-list template?
Mike Murray
@mikemurray
Oct 20 2015 18:02
@newsiberian becuase internet explorer 11 / edge does not yet support object-fit. which allows us to do css cover / contain on elements, not just background images.
And the polyfill i found was too slow and crashed the browser :(
The <span> is not ideal, and I want to come up with a better solution
@prinzdezibel Products can have a weight class, which is just an artibary priority. It can be used to position products in the grid differently than others based on that value. Current the core-theme uses it to increase the size of the product and its content making it appear bigger in the grid.
However, you can change that behavior thought css / template overrides
Spencer Norman
@spencern
Oct 20 2015 20:06
Anyone else seeing errors when trying to start the checkout process?
Specifically seeing this: Exception in template helper: TypeError: Cannot read property 'collection' of undefined on a fresh clone with local packages
Paul Grever
@paulgrever
Oct 20 2015 20:11
I just took a fresh copy and am getting that error and insert failed: Access denied. No allow validators set on restricted collection for method 'insert’.
Mike Murray
@mikemurray
Oct 20 2015 20:12
@spencern is there a file/line?
Spencer Norman
@spencern
Oct 20 2015 20:14
yeah, got it figured out
core/client/helpers/layout.js
Line 23 ish
This message was deleted
Mike Murray
@mikemurray
Oct 20 2015 20:16
think I've seen this before while dealing with the order workflow
Spencer Norman
@spencern
Oct 20 2015 20:17

Changing this:

  // potentially we can make the default a workflow collection
  let layoutConfigCollection = layout.collection || "Cart”;

to this:

  let layoutConfigCollection;
  // potentially we can make the default a workflow collection
  if (layout) {
    layoutConfigCollection = layout.collection || "Cart";
  } else {
    layoutConfigCollection = "Cart";
  }
fixed it for me
not sure why it just started popping up
Mike Murray
@mikemurray
Oct 20 2015 20:19
it has something to do with how the workflows are created.
namely the mongo collection not being set properly
Spencer Norman
@spencern
Oct 20 2015 20:24
Is that something on my end, or an issue in core?
we should still do the check like you did there though
but it should probably fail if layout isn't defined
Spencer Norman
@spencern
Oct 20 2015 20:28
:+1:
Spencer Norman
@spencern
Oct 20 2015 21:03
Sent a PR