@graphcommerce/docs 4.12.0-canary.2 → 4.12.0-canary.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.12.0-canary.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1738](https://github.com/graphcommerce-org/graphcommerce/pull/1738) [`163be59f2`](https://github.com/graphcommerce-org/graphcommerce/commit/163be59f2bf0f1573e91da036e56455262c6abd5) - Better clone instructions when upgrading ([@paales](https://github.com/paales))
8
+
9
+ - [#1738](https://github.com/graphcommerce-org/graphcommerce/pull/1738) [`6171ad02c`](https://github.com/graphcommerce-org/graphcommerce/commit/6171ad02c19782b1e1f0eb00ea25ea6b764250b5) - Added topological sorting to plugins and added ifEnv export to plugins to conditionally load plugins ([@paales](https://github.com/paales))
10
+
3
11
  ## 4.12.0-canary.2
4
12
 
5
13
  ### Patch Changes
@@ -169,28 +169,21 @@ work for other things such as:
169
169
  - Abstraction between GraphCommerce and Backends? (Magento, BigCommerce,
170
170
  CommerceTools, etc.)
171
171
 
172
- ### Limitations
172
+ ### Conditionally include a plugin
173
173
 
174
- Work is planned to lift these limitations, but for now:
174
+ Provide an ifEnv export in the plugin that will only include the plugin if the
175
+ environment variable is set.
175
176
 
176
- React Refresh doesn't work correctly with Plugins, it will force a page reload
177
- on each file change and will throw an error in the console. To solve this issue,
178
- move your actual plugin outside of the plugin file and only have the plugin be a
179
- configuration file.
177
+ ```tsx
178
+ export const ifEnv = 'MY_ENV_VARIABLE'
179
+ ```
180
180
 
181
- It currently isn't possible to provide a plugin sort order. The project root is
182
- intercepting last, followed by the packages in reverse alphabetical order,
183
- followed by dependencies' dependencies. We don't generate a proper graph at the
184
- moment to figure out the actual dependencies but is an artifact of how we
185
- resolve the dependencies.
181
+ ### When to use a plugin?
186
182
 
187
- There currently isn't a way for the plugin to determine if the plugin should be
188
- activated at all. For example, the code for Google Analytics should only be
189
- added if the user has configured it. This is currently not possible. Of if a
190
- user wants to disable a plugin, this is currently not possible.
183
+ A plugin should be used when a new package is created that influences the
184
+ behavior of other packages.
191
185
 
192
- It is currently is only possible to extend React Components. This however sets
193
- the foundation to allow for a more flexible plugin system in the future.
186
+ ### Plugin loading order
194
187
 
195
- Plugins should be optional for GraphCommerce to function properly. Plugins for
196
- mandatory packages shouldn't exist.
188
+ A plugin is injected later than the dependencies of the package. So if a plugin
189
+ is loaded to early, make sure the package has a dependency on the other package.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/docs",
3
3
  "homepage": "https://www.graphcommerce.org/docs",
4
4
  "repository": "github:graphcommerce-org/graphcommerce/docs",
5
- "version": "4.12.0-canary.2",
5
+ "version": "4.12.0-canary.3",
6
6
  "sideEffects": true,
7
7
  "devDependencies": {
8
8
  "@graphcommerce/prettier-config-pwa": "^4.0.7"
package/upgrading.md CHANGED
@@ -38,7 +38,7 @@ dependencies, while keeping your customizations.
38
38
  2. Download a fresh copy of the repository:
39
39
 
40
40
  ```bash
41
- git clone git@github.com:graphcommerce-org/graphcommerce.git upgrade
41
+ git clone -b main --depth 1 https://github.com/graphcommerce-org/graphcommerce.git
42
42
  ```
43
43
 
44
44
  3. Navigate to the /upgrade directory you've just created. Run the following