These are chat archives for reactioncommerce/reaction

21st
Apr 2017
zhan ishzhanov
@janat08
Apr 21 2017 00:13
its package conflict
anyone else getting buggy behaviour on the whole from react commerce where tags/pictures don't work
Chandler Freeman
@Stat1c14
Apr 21 2017 01:36
Just a quick question for you guys: If I wanted to add a few custom pages to the site, where would I start?
Brent Hoover
@zenweasel
Apr 21 2017 01:41
You’d create a plugin with your custom template and then a route to it: https://docs.reactioncommerce.com/reaction-docs/master/plugin-routes-6
Aaron Judd
@aaronjudd
Apr 21 2017 05:30
@tobias-istvan that react error has to do with the way we’re rendering the ssr vs the client and is a warning that can be ignored. The url looks like maybe it’s wrong or changed.. maybe it should be this one: https://docs.reactioncommerce.com/reaction-docs/master/plugin-creating-2
Janus Reith
@janus-reith
Apr 21 2017 07:57
Still no luck in making the Footer appear on the PDP...whatever I tried, the page has an empty layoutFooter var
Janus Reith
@janus-reith
Apr 21 2017 10:40
how to use Docker with an own, customized version of Docker?
The docs just show a way where the latest image is pulled,
and if I try to use the local file "docker-compose.yml" with docker compose up, it also pulls the image instead of building it.
I don't get the point of that
*version of Reaction
Janus Reith
@janus-reith
Apr 21 2017 10:49
nevermind, a simple docker build did the trick...
Janus Reith
@janus-reith
Apr 21 2017 11:20
okay that didnt do it. if I run docker build ., and then start my image, it will run on 3000. I guess thhis means that it still is on develop mode?
Spencer Norman
@spencern
Apr 21 2017 16:13
@janus-reith - @jshimko would be able to answer this best, but I’m pretty sure the docker application runs on port 3000 by default as well. You can use a reverse proxy such as nginx to expose the application to port 80
Jeremy Shimko
@jshimko
Apr 21 2017 16:17
@janus-reith It is a production build. The Node process runs on port 3000 because non-root users can’t run processes on port 80. So as @spencern said, you can put a reverse proxy like Nginx in front of it.
you can obviously skip the Docker Machine part if you already have a host set up.
Janus Reith
@janus-reith
Apr 21 2017 17:05
Ah, thanks, ok.
I ended up modyfing the docker-compose file and replaced the reaction latest part with a customname, then ran dicker build -t customname ., followed by docker-compose up
Not sure if this is the right way to work with docker, but it works now
Jeremy Shimko
@jshimko
Apr 21 2017 17:07
:thumbsup:
Janus Reith
@janus-reith
Apr 21 2017 17:07
*dicker
Damnit, *docker
:D
3000 is now routed to 80 as expected
Boy Persoon
@BoyPersoon
Apr 21 2017 17:10

Okay guess same question again as it is really not working! My homepage is showing "Oeps, Page not found". within mongo I see the following entry: { "_id" : "yARfqnzDZiaH39BmD", "name" : "beesknees", "shopId" : "J8Bhq3uTtdgwZx3rz", "icon" : "fa fa-vine", "enabled" : true, "settings" : null, "registry" : [ ], "layout" : [ { "layout" : "coreLayoutBeesknees", "workflow" : "coreProductWorkflow", "collection" : "Products", "theme" : "default", "enabled" : true, "structure" : { "template" : "coreLayoutBeesknees" }, "priority" : 1, "position" : 1 } ] }

{ "_id" : "DJtaKp6zrZhKjHu3v", "name" : "beesknees", "shopId" : "ddzuN2YPvgvx7rJS5", "icon" : "fa fa-vine", "enabled" : true, "settings" : null, "registry" : [ ], "layout" : [ { "layout" : "coreLayoutBeesknees", "workflow" : "coreProductWorkflow", "collection" : "Products", "theme" : "default", "enabled" : true, "structure" : { "template" : "coreLayoutBeesknees" }, "priority" : 1, "position" : 1 } ] }

Boy Persoon
@BoyPersoon
Apr 21 2017 17:20

directory layout: plugin/custom/beesknees with register.js client/ and server/ . within the client I have defaults with the following entries

import { Session } from "meteor/session";

Session.set("DEFAULT_LAYOUT", "coreLayoutBeesknees");
Session.set("DEFAULT_WORKFLOW", "coreWorkflow");
Session.set("INDEX_OPTIONS", {template: "coreLayoutBeesknees" });

and within client/templates/layouts/core.html with the template

<template name="coreLayoutBeesknees">
<p> Hello World </p>
</template>

Everything is loaded and is popping up in the console.log() correctly including

console.log( Session.get("DEFAULT_LAYOUT") );
console.log( Session.get('INDEX_OPTIONS') );

Package seems registered in the db, everything is loaded, DEFAULT_LAYOUT and INDEX_OPTIONS are set to the core.html template's name. no console errors. Everything is loaded according to my console.log() functions. What am I missing? I really can't get started with this custom plugin!!

finseth
@finseth
Apr 21 2017 17:21
Can reaction run on a read only filesystem?
Jeremy Shimko
@jshimko
Apr 21 2017 17:46
Assuming it’s already built, yes, that should be fine.
finseth
@finseth
Apr 21 2017 17:49
Ok, so that means I probably need to configure S3/GCS for image uploads right?
Jeremy Shimko
@jshimko
Apr 21 2017 17:50
No, they go into the database
finseth
@finseth
Apr 21 2017 17:50
sweet
Jeremy Shimko
@jshimko
Apr 21 2017 17:50
you need to have a remote Mongo db set up
that’s the only persistent data
finseth
@finseth
Apr 21 2017 17:51
thanks @jshimko
Mike Murray
@mikemurray
Apr 21 2017 17:51
@BoyPersoon try index options with the name of the workflow. Think of workflow as an id for a set of layout requirements that you define in a registry entry.
layout: [{
    layout: "coreLayout",
    workflow: "coreProductWorkflow", // <--------------------
    collection: "Products",
    theme: "default",
    enabled: true,
    structure: {
      template: "productDetail",
      layoutHeader: "layoutHeader",
      layoutFooter: "",
      notFound: "productNotFound",
      dashboardHeader: "productDetailSimpleToolbar",
      dashboardControls: "productDetailDashboardControls",
      dashboardHeaderControls: "",
      adminControlsFooter: "adminControlsFooter"
    }
  }
const INDEX_OPTIONS = {
  workflow: "coreProductWorkflow" // <--------------------
};
Boy Persoon
@BoyPersoon
Apr 21 2017 19:16
Thank you a lot Mike Murray!!! This solved it! I am going to do some research on 'Workflow'!
Chandler Freeman
@Stat1c14
Apr 21 2017 19:24
Hey all, quick question. I plan on running a Reaction instance in production containing some custom plugins I've written. What's the easiest way to do this?
Mike Murray
@mikemurray
Apr 21 2017 20:34
@Stat1c14 you could try just checking them out individually into the imports/plugins/custom, using git submodules, or git subtree.
Mike Murray
@mikemurray
Apr 21 2017 20:40

Personally I love monorepos for ease of dealing with cross dependencies so I would do something like:

contents custom plugin

/imports/plugins/custom/myPluginMonoRepo
  myplugin1
  myplugin2
  myplugin3
  client
    - index.js
  server
    - index.js

client/index.js

import "./myplugin1/client/index.js";
import "./myplugin2/client/index.js";
import "./myplugin3/client/index.js";

server/index.js

import "./myplugin1/server/index.js";
import "./myplugin2/server/index.js";
import "./myplugin3/server/index.js";
then you’d only have to checkout one repo into the custom dir
Chandler Freeman
@Stat1c14
Apr 21 2017 20:44
That's the way I'm currently doing it
How can I do deployments with custom plugins using Docker? I understand there are two containers, one containing Reaction and the other containing Mongo, correct?
Mike Murray
@mikemurray
Apr 21 2017 20:50
you could do that. You’d have to setup that mongo container yourself and point your reaction instance to it. You could also use something like compose.io
I’m no docker expert, but I believe you’d run docker build with the local files, or a fork of reaction with your custom plugins
Chandler Freeman
@Stat1c14
Apr 21 2017 20:53
Ok, that's what I was guessing. Where would I run docker build? Just trying to run it in the root directory of Reaction throws an error for me. Does it need to be built in a specific folder?
Still odd it won't build for me, though. I'll keep testing, and if it fails on a fresh build than I'll create an issue. Thanks for your help!