Skip to content

Commit

Permalink
Merge branch 'release-1.14.0' into refactor-zenweasel-remove-paypal
Browse files Browse the repository at this point in the history
  • Loading branch information
kieckhafer committed Jul 2, 2018
2 parents 64c13f2 + 730d12a commit cba4ead
Show file tree
Hide file tree
Showing 374 changed files with 4,802 additions and 3,542 deletions.
29 changes: 28 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ jobs:
key: v1-node-modules-{{ .Branch }}-{{ epoch }}
paths:
- node_modules
# mongodb-memory-server installs Mongo binary on npm install, which we need
# later when we run Jest integration tests
- save_cache:
name: Saving mongodb-memory-server MongoDB cache
key: mongodb-memory-server
paths:
- ~/.mongodb-binaries

docker-build:
<<: *defaults
Expand Down Expand Up @@ -177,7 +184,7 @@ jobs:
name: Load App Plugins
command: reaction plugins load
- run:
name: Run Integration Tests
name: Run Meteor Integration Tests
command: .circleci/tests.sh

test-unit:
Expand All @@ -193,6 +200,22 @@ jobs:
name: Run Unit Tests
command: npm run test:unit

test-integration:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- v1-node-modules-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}
- v1-node-modules-{{ .Branch }}
- v1-node-modules-master
- restore_cache:
name: Restoring mongodb-memory-server MongoDB cache
key: mongodb-memory-server
- run:
name: Run Integration Tests
command: npm run test:integration

dockerfile-lint:
<<: *defaults
docker:
Expand Down Expand Up @@ -250,6 +273,10 @@ workflows:
- test-unit:
requires:
- build
# TODO uncomment and figure out why they always fail on CI
# - test-integration:
# requires:
# - build
- eslint:
requires:
- build
Expand Down
16 changes: 7 additions & 9 deletions .reaction/devserver/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import express from "express";
import mongodb, { MongoClient } from "mongodb";
import createApolloServer from "../../imports/plugins/core/graphql/server/createApolloServer";
import createApolloServer from "../../imports/plugins/core/graphql/server/no-meteor/createApolloServer";
import defineCollections from "../../imports/collections/defineCollections";
import mutations from "../../imports/plugins/core/graphql/server/mutations";
import queries from "../../imports/plugins/core/graphql/server/queries";
import setUpFileCollections from "../../imports/plugins/core/files/server/no-meteor/setUpFileCollections";
import methods from "./methods";

const { MONGO_URL, ROOT_URL } = process.env;
if (!MONGO_URL) throw new Error("You must set MONGO_URL");
Expand Down Expand Up @@ -45,12 +42,13 @@ MongoClient.connect(dbUrl, (error, client) => {
* the API changes through the Meteor app in case there are any differences.
*/
const app = createApolloServer({
context: {
collections,
methods,
mutations,
queries
addCallMeteorMethod(context) {
context.callMeteorMethod = (name) => {
console.warn(`The "${name}" Meteor method was called. The method has not yet been converted to a mutation that works outside of Meteor. If you are relying on a side effect or return value from this method, you may notice unexpected behavior.`);
return null;
};
},
context: { collections },
debug: true,
graphiql: true
});
Expand Down
3 changes: 0 additions & 3 deletions .reaction/devserver/methods.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
export default {
"accounts/addressBookAdd"() {
return {};
},
"accounts/addressBookUpdate"() {
return {};
},
Expand Down
2 changes: 1 addition & 1 deletion .reaction/devserver/mockmeteor/meteor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ReactionError from "../../../imports/plugins/core/graphql/server/ReactionError";
import ReactionError from "../../../imports/plugins/core/graphql/server/no-meteor/ReactionError";

export const Meteor = {
Error: ReactionError,
Expand Down
18 changes: 7 additions & 11 deletions .snyk
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@ ignore:
'npm:hoek:20180212':
- '*':
reason: 'Possible false positive, waiting on requestjs to updated hawk version'
expires: 2018-06-20T00:00:00.000Z
'npm:shelljs:20140723':
- eslint-config-react-tools > eslint-plugin-class-property > eslint > shelljs:
reason: no patch available
expires: '2018-03-22T04:22:44.834Z'
expires: 2018-06-30T00:00:00.000Z
'npm:bootstrap:20160627':
- bootstrap:
reason: We're not going to update to Bootstrap 4 any time soon
expires: '2018-07-26T20:23:03.274Z'
'npm:lodash:20180130':
- '*':
reason: no patch
expires: 2018-06-20T00:00:00.000Z
reason: 'Waiting on multiple dependencies to update'
expires: 2018-06-30T00:00:00.000Z
'npm:tunnel-agent:20170305':
- '*':
reason: No patch and we do not use this optional package
Expand All @@ -29,13 +25,13 @@ ignore:
'npm:stringstream:20180511':
- '*':
reason: Awaiting dependency updates of request 2.83.0 to gte 2.86
expires: 2018-06-20T00:00:00.000Z
expires: 2018-06-30T00:00:00.000Z
'npm:deep-extend:20180409':
- '*':
reason: No patch available https://github.com/unclechu/node-deep-extend/issues/41
expires: 2018-06-20T00:00:00.000Z
reason: rc updated with latest version - https://github.com/dominictarr/rc - can't find rc in our dependencies
expires: 2018-06-30T00:00:00.000Z
'npm:base64url:20180511':
- '*':
reason: Twillio and nexmo will be removed soon, file-collections isn't using any google-cloud stuff so this vuln doesn't apply
expires: 2018-06-20T00:00:00.000Z
expires: 2018-06-30T00:00:00.000Z
patch: {}
115 changes: 115 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,118 @@
# v1.14.0
## Removing Optional Plugins
As part of our focus simplifying the core Reaction application and improving performance, we've [made the decision to remove optional plugins from the core application](https://blog.reactioncommerce.com/the-road-ahead-product-updates-june-2018/). From our blog post on this topic:
> It’s about quality over quantity. As a part of our initiative to simplify Reaction, we’re focusing on providing one reference application per feature and moving all others over to community-sponsored packages. We’ll be migrating packages, APIs, and schemas over to npm. It’s a standard approach to package management, one that improves the developer experience overall.
Here’s how it will look:

|Category|Reaction default(s)|Community package(s)|
|---|---|---|
|Payments|Stripe, example payment package|PayPal, Authorize.net, Braintree|
|Taxes|Flat rate|Avalara, TaxCloud, TaxJar|
|Shipping|Flat rate|Shippo|
|Connectors|CSV connector|Shopify connector|

## GraphQL DevServer
### Features
- feat: GraphQL Cart Schema (#4307)

## Meteor App
### Features
- feat: Create product hash of published product properties (#4336)

### Fixes
- fix: low quantity/sold out flags not saving correctly in db (#4342)
- fix: Scrolling to bottom adds more products to the view (#4243) .. Resolves #4090
- fix: for "react-addons-create-fragment should be removed" (#4164)
- fix: change session active product when adding new product (#4313)
- fix: missing styles on refund popover (#4300) .. Resolves #4005

### Refactors
- refactor: Remove Authorize.net plugin (#4310)
- refactor: Use new Reaction component library components for the SMS settings form (#4318)

# v1.13.0

## Removal of Legacy Product Revision Control system
The major change in this release is that we've removed the existing revision control system in favor of publishing Products to the Catalog. The existing revision control system contained some powerful ideas, but was complex and intertwined into many areas of the app that were not directly related to Product. By removing the old revision control system, we've paved the way to substantially improve product grid performance, especially for Operators and we've simplified the product publication logic.

This removes all code, hooks, collections, and packages related to revision control.

**Breaking changes:**
- Any custom packages that depend on the `Revision` control system.
- Operators will no longer be able to "undo" changes to a product. Instead products are published through the catalog
- Any _unpublished_ changes to products will be lost when upgrading to `1.13.0`. In this release, it's possible that if you were to downgrade that you would see the unpublished changes again, but that may cause unexpected behavior. We recommend either publishing or discarding any changes to your products before upgrading to this release.
- Similarly, any products that have been created but not published will demonstrate unexpected behavior. To avoid this undesirable behavior, publish any newly created, unpublished products prior to upgrading to this release.

- **All plugin authors** will need to update your `package.json` with a change to the babel config similar to what was done [here](https://github.com/reaction-contrib/meteor-authorize-net/commit/f19a5cf7591a17f426e67bd3737af5a4d1c7a64a)


## Update to Meteor 1.7
This update brings some enormous improvements to the amount of time it takes to rebuild the application in development after making a file change. In some (less than perfectly scientific) tests that I ran testing file changes between 1.7 and 1.6.1 I saw 50%-90% improvements in the reload time. Your experience may vary depending on how much you've customized Reaction, your computer specs, and your specific development setup, but I fully expect this to be a noticeable improvement for anyone working with Reaction.

There are some [early](https://github.com/meteor/meteor/issues/9949) [reports](https://github.com/meteor/meteor/issues/9945) that the included update to the MongoDB driver may have [some kinks](https://github.com/meteor/meteor/issues/9944) to work out, so I'd follow those issues on Meteor's repo if that's a cause for concern for you. These reports are all coming from a single person, and we haven't experienced any of these issues in particular yet, but we'll be keeping an eye on them.

##
We ran into a few issues with `npm install` that we resolved in #4317. One product that came out of this investigation was some documentation for how to properly clean up and rebuild docker images in Reaction.

To stop and clean up your images
```sh
docker-compose down -v --rmi local --remove-orphans
```

To rebuild your Reaction images
```sh
docker-compose up --build --force-recreate --renew-anon-volumes
```

If you only want to run Reaction and not the GraphQL DevServer
```sh
docker-compose up --build --force-recreate --renew-anon-volumes reaction
```

If you only want to run the DevServer and not the Meteor app
```sh
docker-compose up --build --force-recreate --renew-anon-volumes devserver
```

## Meteor App
### Performance
- perf: remove revision control (#4238)
- perf: update to Meteor 1.7 (#4265)

### Bug Fixes
- fix: Use catalog collection for PDP (#4324)
- fix: Import fixture data only if collections empty (#4327) .. Resolves #4326
- fix: Invalid class name: .variant-list-item-{variant._id} (#4217)
- fix: NPM build issue in Docker build (#4317)
- fix: add getAutoValues: false to discounts/codes/remove (#4288)
- fix: hadolint image version (#4306)
- fix: CI step failure to tag Docker image with latest release version (#4304)
- fix: admin products publication slowness (#4260)
- fix: remove inventoryPolicy check on low inventory (#4298)

### Refactors
- refactor: non meteor schemas (#4266) .. Resolves #4263

### Tests
- test: new mocks factory (#4276) .. Resolves #4246
- test: run snyk when package.json has changed or base is master (#4285)

### Docs
- docs(jsdoc): document all Meteor Template helpers in 1 @namespace (#3841) .. Resolves #3840

## GraphQL Dev Server
### Features
- feat: add Media to Tag Schema and GraphQL query (#4270)

### Chore
- chore: update default GraphQL query limit values (#4297)

## Contributors
Thanks to @mikeumus for contributing to this release. 🎉



# v1.12.1
## Bug Fixes
- fix: handle products without positions obj .. Resolves #4299
Expand Down
9 changes: 9 additions & 0 deletions client/modules/core/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,15 @@ export default {
Meteor.call("shop/resetShopId");
},

/**
* @name isShopPrimary
* @summary Whether the current shop is the Primary Shop (vs a Merchant Shop)
* @return {Boolean}
*/
isShopPrimary() {
return this.getShopId() === this.getPrimaryShopId();
},

/**
* @name getShopName
* @method
Expand Down
2 changes: 1 addition & 1 deletion imports/collections/schemas/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export const Accounts = new SimpleSchema({
type: String,
regEx: SimpleSchema.RegEx.Id,
index: 1,
label: "Accounts ShopId"
label: "Accounts userId"
},
"sessions": {
type: Array,
Expand Down
5 changes: 5 additions & 0 deletions imports/collections/schemas/products.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ registerSchema("PriceRange", PriceRange);
* @property {Date} publishedAt optional
* @property {String} publishedScope optional
* @property {Workflow} workflow optional
* @property {String} publishedProductHash optional
*/
export const Product = new SimpleSchema({
"_id": {
Expand Down Expand Up @@ -583,6 +584,10 @@ export const Product = new SimpleSchema({
type: Workflow,
optional: true,
defaultValue: {}
},
"publishedProductHash": {
type: String,
optional: true
}
});

Expand Down
34 changes: 34 additions & 0 deletions imports/collections/schemas/shops.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,36 @@ export const Currency = new SimpleSchema({

registerSchema("Currency", Currency);

/**
* @name ParcelSize
* @memberof schemas
* @type {SimpleSchema}
* @property {Number} weight default value: 8lb
* @property {Number} height default value: 6in
* @property {Number} length default value: 11.25in
* @property {Number} width default value: 8.75in
*/
export const ParcelSize = new SimpleSchema({
weight: {
type: Number,
min: 0
},
height: {
type: Number,
min: 0
},
length: {
type: Number,
min: 0
},
width: {
type: Number,
min: 0
}
});

registerSchema("ParcelSize", ParcelSize);

/**
* @name Locale
* @memberof Schemas
Expand Down Expand Up @@ -422,6 +452,10 @@ export const Shop = new SimpleSchema({
"defaultSellerRoles.$": {
type: String
},
"defaultParcelSize": {
type: ParcelSize,
optional: true
},
"layout": {
type: Array,
optional: true
Expand Down
4 changes: 4 additions & 0 deletions imports/plugins/core/accounts/server/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { Meteor } from "meteor/meteor";
import "./i18n";
import "./init.js";
import methods from "./methods";

/**
* Query functions that do not import or use any Meteor packages or globals. These can be used both
* by Meteor methods or publications, and by GraphQL resolvers.
* @namespace Accounts/NoMeteorQueries
*/

Meteor.methods(methods);

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit cba4ead

Please sign in to comment.