github reactioncommerce/reaction v3.0.0

v3.0.0

We're excited to introduce version 3.0.0 (v3.0.0) of the Reaction Commerce GraphQL API (hereby referred to as "The Reaction API"). In this version, we've expanded the existing GraphQL API to include administrative and operator functionality, eliminated the Meteor framework from the Reaction API, split the Reaction Admin UI and the identity provider into separate services, added support for plugins as NPM packages, and improved automated integration testing for the Reaction API.

Notable Changes

Reaction API is now fully headless

The reactioncommerce/reaction repo exclusively hosts the Reaction API in v3.0.0. This Reaction API now has full GraphQL coverage of the functionality that was previously provided by Meteor. In v2 we introduced GraphQL into the Reaction API for storefronts. Now the Reaction API includes GraphQL coverage for administrative and operator functionality. This enables the creation of custom UI for operating a shop using Reaction Commerce.

Plugins as NPM Packages

The Reaction API plugin system has changed a lot - primarily because the Reaction API runs as a Node.js application instead of a Meteor application. It's now possible and recommended to write plugins as NPM packages. See our docs on plugins in Reaction 3.x for details.

Permissions system overhaul

Permissions of a Reaction Account are now exclusively determined by the permissions of the Group (or Groups) the Account belongs to.

Previously, roles (renamed permissions) were attached to a user by querying the single Group a user belonged to, and copying the group permissions over to the user account. Permissions were then checked against the user.roles object. If there was ever an update to the permissions a group was allowed, every user in the group needed to be updated.

In v3.0.0, Accounts are now allowed to be added to more than one group, and permissions are checked by querying the Groups the user belongs too, aggregating all permissions all of these groups, and then checking against this list of permissions. If a group is ever updated, each individual account no longer needs to be updated.

Improved Integration Test Coverage

We've written many integration tests for our Reaction API. See this GitHub ticket for a full list of new integration tests. While we've made huge strides here to improve test coverage, there is still room for improvement here. We'd welcome contributions that improve our test coverage!

Removed Meteor from the Reaction API

Improving developer experience has been high on the list of priorities for quite a while. We've made significant improvements to startup, restart, and build times for the reaction project by removing Meteor. In doing this we've also updated to version 12 of Node.js, which is in Active LTS status.

Reaction Admin has a new home

With this release, we are also introducing a beta of Reaction Admin, now a standalone application. We've moved the codebase for the Admin UI into a separate repository - reactioncommerce/reaction-admin.
It's important to note that while this is the official v3.0.0 release of the Reaction API, we're keeping the beta tag on Reaction Admin for now.

Our focus and effort for this release has primarily been on readying our full GraphQL Reaction API. We're keeping Reaction Admin in beta because it uses Meteor under the hood for builds and there are still a few Meteor APIs left in the codebase. The future Reaction Admin UI will use the Reaction API exclusively.
The Reaction Admin project will be in beta beyond the v3.0.0 release of Reaction API. We suggest careful consideration before copying any patterns found in the Reaction Admin project while it still has the beta tag. There are sections where it consumes the Reaction API and other sections that still use patterns from when the Admin UI was part of the monolithic Meteor application.

New identity provider service: Reaction Identity

This release moves the identity provider for Reaction into a separate service - reactioncommerce/reaction-identity. Reaction Identity is the user interface and server for identity management, including user registration, login, logout, and password change. It works together with reaction-hydra to enable OAuth2 flows.

Independent Releases

v3.0.0 is a coordinated release across all of Reaction's open source projects. Following this release, we will release Reaction Commerce projects independently. For example, if there are fixes or improvements made to the Example Storefront or to the API, they can be released without bumping the version of every other project. Reaction Development Platform will continue to be bumped with each release of a Reaction Commerce project.

Mongo 4

Mongo version 4.0+ is now required. Mongo 4 introduces multi-document transactions. Requiring Mongo 4+ means that services and plugins can start using transactions where necessary to ensure better data integrity.

Default to running public docker images

The docker-compose.yml file in each project now uses public images rather than building an image. This drastically speeds up the initial startup time in development, and makes the application run smoother in development. When you're ready to start developing, you'll need to switch over to using the docker-compose.dev.yml file in the project you're wanting to develop - see for example: reaction/docker-compose.dev.yml).

Migrations

The migration tool in Reaction v2.x depended on Meteor and was built into the Reaction monolith. For v3.0.0, we've moved to a new CLI migration tool for MongoDB. We weren't planning to write Migrator, but we couldn't find anything that met all of our MongoDB migration needs. Although we built Migrator for Reaction Commerce, it is a general purpose MongoDB data migration tool that you can use for any project. See the project page for details on why we decided to build our own and to learn how to use the new migration tool.
We've got an example project that you can use to get started. There's also an npm package that can ensure your database has migrated to the correct version before running any commands.

How to get started with Reaction v3.0.0

Our (recently renamed) reactioncommerce/reaction-development-platform project is still the best place to start if you want to check out what Reaction has to offer or start developing for Reaction.
If you're experienced with Reaction already check-out our Upgrade Guide. If you've got a plugin you'd like to upgrade, read our guide for updating a 2.x API plugin to work with Reaction API 3.x.

Features

  • feat: Add Accounts GraphQL query to find non-admin accounts (#5848)
  • feat: add addAccountEmailRecord mutation and corresponding integration (#5813)
  • feat: Add Babel config to make Jest tests work (#5728)
  • feat: add checkPermissions function (#5727)
  • feat: Add createNavigationTree mutation & its tests (#6023)
  • feat: add delete action to account managers policy (#6024)
  • feat: add email templates query (#5811)
  • feat: add graphql equivalent of create group (#5850)
  • feat: Add updateAccountGroup mutation (#6016)
  • feat: add updateProduct and updateProductVariant mutations for 3.0 (#5768)
  • feat: add updateProductVariantPrices mutation to API (#5910)
  • feat: addCartItems mutation (#5814)
  • feat: adds integration test for generateSitemaps mutation (#5995)
  • feat: Allow remoteURL in MediaRecordInfo schema (#6074)
  • feat: authentication plugin; drop support for meteor-login-token header (#5999)
  • feat: authorization plugin & checkPermissions functionality (#5724)
  • feat: Better internal context design (#6020)
  • feat: change graphql route (#6027)
  • feat: Create updateAccount GraphQL mutation (#6067)
  • feat: GQL discount & discount codes plugins (#5800)
  • feat: GQL Email (core/email) (#5793)
  • feat: GQL products & product query (#5818)
  • feat: GQL Tags (core/tags) (#5786)
  • feat: GQL tax rates (#5774)
  • feat: GQL Templates (core/templates) (#5792)
  • feat: Product/Variant GQL fixes (#6079)
  • feat: pt-BR translation for reaction-orders. (#6004)
  • feat: pt-BR translation for reaction-tags. (#5997)
  • feat: retry initial MongoDB connections (#5807)
  • feat: Shipping (flatRateFulfillmentMethods) query (#5844)
  • feat: Tag query improvements (#5783)
  • feat: Update brand assets and parcel size on shop (GQL) (#5846)
  • feat: update groups permission with migration (#6086)
  • feat: update updateShop mutation to set all necessary settings (#5804)
  • feat: Use api-utils for currency definitions (#5823)
  • feat: Warn about non-unique names of functionsByType functions (#6001)
  • feat(simple-pricing): Compute displayPrice as resolver as needed (#6025)

Fixes

  • fix: a few 3.0 bugs (#5824)
  • fix: account invite flow and account email data (#5799)
  • fix: add missing permissions check to (#6040)
  • fix: addAccountToGroup (#6071)
  • fix: Adjust the sharp syntax (#5881)
  • fix: canBackorder has lowercase o throughout codebase (#5990)
  • fix: check if the url is already absolute (#6032)
  • fix: comment out auth checks that aren't valid until new permissions are finished (#5900)
  • fix: Don't use Packages for tax settings, and tax rates GQL fixes (#5852)
  • fix: fix adding shop creator to owner group (#6072)
  • fix: fix default public password reset URL (#5991)
  • fix: Invisible Tags do not show on Admin tags list (#6028)
  • fix: parse complicated MONGO_URL properly (#5827)
  • fix: partialProductPublish for products without Catalog (#6059)
  • fix: Polish translations (#6069)
  • fix: problems with accounts queries (#6060)
  • fix: Proper sitemap last modify date (#6078)
  • fix: remove check for shopId where not needed (#5895)
  • fix: respect allowGuestCheckout setting (#5815)
  • fix: Return fulfillment quotes without a shipping address (#5934)
  • fix: Some minor 3.0 fixes (#5977)
  • fix: user roles and owner permission checks (#6008)
  • fix: Various 3.0.0 fixes (#5722)
  • fix: Various product GQL fixes (#6053)

Refactors

  • refactor: add product media resolver & update translations for new DataTable products view (#6036)
  • refactor: kieckhafer remove deprecations (#5718)
  • refactor: add legacy system name to permission resource structure (#6019)
  • refactor: cart token param name consistent to cartToken (#5820)
  • refactor: clean up ENV/envalid code (#5922)
  • refactor: clean up translations for products view (#5746)
  • refactor: fix failing integration tests in release-3.0.0 (#5862)
  • refactor: get roles / permissions directly from group(s), not user object (#6031)
  • refactor: move xforms into plugins (#5713)
  • refactor: No more Packages collection, implement AddressValidationRules GQL, other 3.0 stuff (#5888)
  • refactor: only allow provides: default for one email address (#6062)
  • refactor: pass cart down to calculateOrderTaxes fn (#6000)
  • refactor: remove "owner" and other default permissions / groups (#6063)
  • refactor: remove legacyRoles from authorization (#6021)
  • refactor: Remove most remaining uses of users collection (#6056)
  • refactor: remove restriction that limits account to one group per shop (#6035)
  • refactor: rename simple-authorization to legacy-authorization, change function footprint (#5772)
  • refactor: Replace context.queries.primaryShopId shopId with client shopId (#5802)
  • refactor: source SMTP email configuation from ENV vars instead of DB (#5788)
  • refactor: source Stripe API keys from ENV vars (#5771)
  • refactor: use functionsOfType to register multiple auth permissions functions (#6009)
  • refactor: use new URL instead of url.parse (#5717)

Chores

  • chore: [3.0.0] Consolidate translation plugins (#5920)
  • chore: add integration test for anonymousCartByCartId query (#5859)
  • chore: add integration test for getFlatRateFulfillmentRestriction (#5869)
  • chore: add integration test for getFlatRateFulfillmentRestrictions (#5866)
  • chore: add integration test for globalSettings query (#5879)
  • chore: add integration test for shopSettings query (#5873)
  • chore: Check Node version (#5734)
  • chore: copy over integration test from v2.x (#5854)
  • chore: fix up eslintignore (#6026)
  • chore: lock api-utils version number (#5851)
  • chore: Node debugger config (#5993)
  • chore: reconfigure docker-compose networks (#6068)
  • chore: update Babel (#6065)
  • chore: Upgrade mongodb and jest-mongodb (#5904)
  • chore: use published image for docker-compose (#5992)

Docs

  • docs: update links to use trunk branch of docs (#6050)

Tests

  • test: add create/update/delete navigation item integration tests (#5890)
  • test: add integration tes for recalculateReservedSimpleInventory mutation (#6010)
  • test: add integration test available payment methods (#5864)
  • test: add integration test for addressValidationServices query (#5930)
  • test: add integration test for accountCartByAccountId query (#5857)
  • test: add integration test for create, update & delete FlatRateFulfillmentMethod (#5964)
  • test: add integration test for create, update & delete FlatRateFulfillmentRestriction mutations (#5981)
  • test: add integration test for echo (#5942)
  • test: add integration test for enablePaymentMethodForShop (#5944)
  • test: add integration test for inviteShopMember mutation (#5984)
  • test: add integration test for payment methods (#5883)
  • test: add integration test for publishNavigationChanges mutation (#5969)
  • test: add integration test for removeAccountAddressBookEntry (#5961)
  • test: add integration test for removeAccountEmailRecord mutation (#5965)
  • test: add integration test for setAccountProfileCurrency mutation (#5958)
  • test: add integration test for setAccountProfileLanguage mutation (#5960)
  • test: add integration test for taxCodes query (#5911)
  • test: add integration test for updateAccountAddressBookEntry (#5962)
  • test: Add integration tests for surcharge (#5938)
  • test: add navigation query integration tests (#5856)
  • test: add Tag query integration test (#5874)
  • test: add updateTag mutation integration test (#5876)
  • test: adds addressValidation query integration test (#5917)
  • test: adds integration test for captureOrderPayments mutation (#6015)
  • test: adds integration test for roles query (#5885)
  • test: adds integration test for taxServices query (#5912)
  • test: adds integration test for updateShopSettings mutation (#5974)
  • test: adds integration test sitemap (#5889)
  • test: adds integration test subrchargeById query (#5896)
  • test: adds integration test surcharges (#5902)
  • test: adds integration test updateGlobalSettings mutation (#5970)
  • test: adds systemInformation query integration test (#5907)
  • test: delete unused documents in afterAll (#5903)
  • test: Eliminate factory mocks for catalogItemProduct (#5892)
  • test: fix out-of-memory issues in tests (#5918)
  • test: full cart/checkout integration test (#5976)
  • test: integration test approve order payments mutation (#6013)
  • test: integration test for update navigation tree (#5914)
  • test: integration test set tag hero media (#6007)
  • test: split query and mutation integration tests in CI config (#5919)
  • test: Use Factory to mock FulfillmentMethod (#5988)
  • test: Working integration tests (#5732)

Contributors

We couldn't have done this without the incredible people contributing to Reaction. From writing PRs and docs to creating bug reports, every contribution matters. Thanks to the over 60 people, involved in 8+ repos who have contributed in some way to the v3.0.0 release. We appreciate each of you! 🎉

@janus-reith
@loan-laux
@trojanh
@HarisSpahijaPon

@adilsaeed31
@agustif
@akakak1
@aktywnitu
@albertstartup
@alex-haproff
@Arthur236
@ashwinsoni
@Badyl1g
@bjanssen-pon
@BunnyMan1
@chriscamplin
@cmbirk
@CristianCucunuba
@curmudgeonation
@daniel-rosiak
@deividaspetraitis
@delagroove
@DennisWanjiru
@derBretti
@desktp
@dominik-myszkowski
@Escalion
@eusebiu-andrei9
@gddabe
@hamxabaig
@hems
@ichtestemalwieder
@ikabudimir
@jackson-sandland
@jdonor
@jhonsfran1165
@jm18457
@jmav
@joshreeves
@juanzjck
@karaarda
@karbal
@kmyn
@manzettidenis
@MarcMagnin
@mauber91
@michaelstanton
@moeghashim
@monarkatfactly
@Niko0918
@octoxan
@okazdal
@paales
@preminfy
@rogersoares
@RoytenBerge
@sagargupta
@samkelleher
@tccack
@TilenKreca
@vigyano
@volanar
@yashutanna
@YuuwakU
@Zachary-work

Notes

These changes were originally tested and released in our alpha and beta releases

The following Reaction projects are being released one time in coordination as v3.0.0

After this release, Reaction releases will no longer be coordinated across all projects - we'll release each project independently, as needed. Version numbers will no longer be kept in sync. The newest versions of each project will work together.

Don't miss a new reaction release

NewReleases is sending notifications on new releases.