File tree Expand file tree Collapse file tree 5 files changed +39
-12
lines changed
packages/gatsby/src/redux Expand file tree Collapse file tree 5 files changed +39
-12
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ import { IGatsbyState , ActionsUnion } from "../types"
2
+
3
+ export const flattenedPluginsReducer = (
4
+ state : IGatsbyState [ "flattenedPlugins" ] = [ ] ,
5
+ action : ActionsUnion
6
+ ) : IGatsbyState [ "flattenedPlugins" ] => {
7
+ switch ( action . type ) {
8
+ case `SET_SITE_FLATTENED_PLUGINS` :
9
+ return [ ...action . payload ]
10
+
11
+ default :
12
+ return state
13
+ }
14
+ }
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ import { webpackCompilationHashReducer } from "./webpack-compilation-hash"
12
12
import { reducer as logReducer } from "gatsby-cli/lib/reporter/redux/reducer"
13
13
import { lastAction } from "./last-action"
14
14
import { jobsV2Reducer } from "./jobsv2"
15
+ import { flattenedPluginsReducer } from "./flattened-plugins"
16
+ import { resolvedNodesCacheReducer } from "./resolved-nodes"
15
17
import { pageDataStatsReducer } from "./page-data-stats"
16
18
import { componentsReducer } from "./components"
17
19
import { componentDataDependenciesReducer } from "./component-data-dependencies"
@@ -26,10 +28,10 @@ module.exports = {
26
28
program : require ( `./program` ) ,
27
29
nodes : nodeReducer ,
28
30
nodesByType : nodesByTypeReducer ,
29
- resolvedNodesCache : require ( `./resolved-nodes` ) ,
31
+ resolvedNodesCache : resolvedNodesCacheReducer ,
30
32
nodesTouched : nodesTouchedReducer ,
31
33
lastAction : lastAction ,
32
- flattenedPlugins : require ( `./flattened-plugins` ) ,
34
+ flattenedPlugins : flattenedPluginsReducer ,
33
35
config : require ( `./config` ) ,
34
36
schema : schemaReducer ,
35
37
pages : pagesReducer ,
Original file line number Diff line number Diff line change 1
- // resolvedNodesCache
2
- module . exports = ( state = new Map ( ) , action ) => {
1
+ import { IGatsbyState , ActionsUnion } from "../types"
2
+
3
+ export const resolvedNodesCacheReducer = (
4
+ state : IGatsbyState [ "resolvedNodesCache" ] = new Map ( ) ,
5
+ action : ActionsUnion
6
+ ) : IGatsbyState [ "resolvedNodesCache" ] => {
3
7
switch ( action . type ) {
4
8
case `DELETE_CACHE` :
5
9
case `CREATE_NODE` :
Original file line number Diff line number Diff line change @@ -273,7 +273,9 @@ export type ActionsUnion =
273
273
| IReplaceWebpackConfigAction
274
274
| ISetPluginStatusAction
275
275
| ISetProgramStatusAction
276
+ | ISetResolvedNodesAction
276
277
| ISetSchemaAction
278
+ | ISetSiteFlattenedPluginsAction
277
279
| ISetWebpackCompilationHashAction
278
280
| ISetWebpackConfigAction
279
281
| ITouchNodeAction
@@ -625,6 +627,19 @@ export interface IDeleteNodesAction {
625
627
payload : Identifier [ ]
626
628
}
627
629
630
+ export interface ISetSiteFlattenedPluginsAction {
631
+ type : `SET_SITE_FLATTENED_PLUGINS`
632
+ payload : IGatsbyState [ "flattenedPlugins" ]
633
+ }
634
+
635
+ export interface ISetResolvedNodesAction {
636
+ type : `SET_RESOLVED_NODES`
637
+ payload : {
638
+ key : string
639
+ nodes : IGatsbyState [ "resolvedNodesCache" ]
640
+ }
641
+ }
642
+
628
643
export interface IAddPageDataStatsAction {
629
644
type : `ADD_PAGE_DATA_STATS`
630
645
payload : {
You can’t perform that action at this time.
0 commit comments