eslint-plugin-use-agnostic 1.1.0 → 1.2.0
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/comments.config.js +10 -2
- package/jscomments/_commons/constants/bases.js +95 -0
- package/jscomments/agnostic20/constants/modules-comments.js +28 -14
- package/jscomments/directive21/constants/modules-comments.js +52 -25
- package/library/agnostic20/_commons/constants/bases.js +49 -49
- package/library/agnostic20/_commons/utilities/helpers.js +4 -4
- package/library/directive21/_commons/constants/bases.js +81 -81
- package/library/directive21/_commons/utilities/helpers.js +0 -3
- package/package.json +1 -1
package/comments.config.js
CHANGED
|
@@ -3,11 +3,18 @@ import {
|
|
|
3
3
|
directive21ConfigName,
|
|
4
4
|
} from "./library/_commons/constants/bases.js";
|
|
5
5
|
|
|
6
|
+
import {
|
|
7
|
+
jSDocComments,
|
|
8
|
+
testsComments,
|
|
9
|
+
} from "./jscomments/_commons/constants/bases.js";
|
|
6
10
|
import { agnostic20Comments } from "./jscomments/agnostic20/constants/bases.js";
|
|
7
11
|
import { directive21Comments } from "./jscomments/directive21/constants/bases.js";
|
|
8
12
|
|
|
9
13
|
const config = Object.freeze({
|
|
10
|
-
|
|
14
|
+
jsDoc: jSDocComments,
|
|
15
|
+
// ...jSDocComments,
|
|
16
|
+
tests: testsComments,
|
|
17
|
+
// ...testsComments,
|
|
11
18
|
[agnostic20ConfigName]: agnostic20Comments,
|
|
12
19
|
[directive21ConfigName]: directive21Comments,
|
|
13
20
|
});
|
|
@@ -15,11 +22,12 @@ const config = Object.freeze({
|
|
|
15
22
|
export default config;
|
|
16
23
|
|
|
17
24
|
/* Notes
|
|
25
|
+
comment: "comment", // $COMMENT#COMMENT in code, "comment" on hover when resolved by the VSCode extension JSComments
|
|
18
26
|
Aims of the VSCode extension JSComments:
|
|
19
27
|
- automatically capitalizes keys, so here:
|
|
20
28
|
- config.comment would return $COMMENT#COMMENT
|
|
21
29
|
- automatically chain keys within keys, so here
|
|
22
30
|
- config["agnostic20"] would return $COMMENT#AGNOSTIC20#*
|
|
23
31
|
- config["directive21"] would return $COMMENT#DIRECTIVE21#*
|
|
24
|
-
- this way, instead doing a find-replace on a big documentation comment, the comment stays within the config and only the config placeholder is found and replaced for the same results
|
|
32
|
+
- this way, instead doing a find-replace on a big documentation comment, the comment stays within the config and only the config placeholder is found and replaced for the same results
|
|
25
33
|
*/
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// comment variables for JSDoc definitions
|
|
2
|
+
export const jSDocComments = Object.freeze({
|
|
3
|
+
// library/_commons/utilities/helpers.js
|
|
4
|
+
basePath: "The absolute import path with extension yet resolved.",
|
|
5
|
+
currentDir:
|
|
6
|
+
"The directory of the file containing the import (from `path.dirname(context.filename)`).",
|
|
7
|
+
importPath:
|
|
8
|
+
"The import specifier (e.g., `@/components/Button` or `./utils`), from the current node.",
|
|
9
|
+
cwd: "The project root (from `context.cwd`).",
|
|
10
|
+
fileResolvedPath: "The resolved path of the file.",
|
|
11
|
+
aContext: "An ESLint rule's `context` object.",
|
|
12
|
+
resolvedDirectives_blockedImports: `The blocked imports object, either for agnostic20 or for directive21.`,
|
|
13
|
+
currentFileResolvedDirective: `The current file's "resolved" directive.`,
|
|
14
|
+
importedFileResolvedDirective: `The imported file's "resolved" directive.`,
|
|
15
|
+
theCurrentFileResolvedDirective: `The "resolved" directive of the "resolved" module.`,
|
|
16
|
+
// library/ ... /config.js
|
|
17
|
+
plugin: "The use-agnostic ESLint plugin itself.",
|
|
18
|
+
// library/agnostic20/_commons/constants/bases.js
|
|
19
|
+
currentFileEffectiveDirective: "The current file's effective directive.",
|
|
20
|
+
importedFileEffectiveDirective: "The imported file's effective directive.",
|
|
21
|
+
// library/ ... /flows.js
|
|
22
|
+
context: "The ESLint rule's `context` object.",
|
|
23
|
+
node: "The ESLint `node` of the rule's current traversal.",
|
|
24
|
+
// library/ ... /helpers.js
|
|
25
|
+
extension: "The JavaScript (TypeScript) extension of the file.",
|
|
26
|
+
resolvedPath: "The resolved path of the imported module.",
|
|
27
|
+
// library/agnostic20/_commons/utilities/helpers.js
|
|
28
|
+
ast: "The module's AST (Abstract Syntax Tree).",
|
|
29
|
+
directiveA20: `The directive as written on top of the file (\`"no directive"\` if no valid directive).`,
|
|
30
|
+
effectiveDirective: "The effective directive of the effective module.",
|
|
31
|
+
serverByDefault: `\`null\` denotes a server-by-default module, ideally a Server Module.`,
|
|
32
|
+
useServer: `\`'use server'\` denotes a Server Functions Module.`,
|
|
33
|
+
useClient: `\`'use client'\` denotes a Client Module.`,
|
|
34
|
+
useAgnostic: `\`'use agnostic'\` denotes an Agnostic Module (formerly Shared Module).`,
|
|
35
|
+
useServerLogics20: `\`'use server logics'\` denotes a Server Logics Module.`,
|
|
36
|
+
useServerComponents20: `\`'use server components'\` denotes a Server Components Module.`,
|
|
37
|
+
useServerFunctions20: `\`'use server functions'\` denotes a Server Functions Module.`,
|
|
38
|
+
useClientLogics20: `\`'use client logics'\` denotes a Client Logics Module.`,
|
|
39
|
+
useClientComponents20: `\`'use client components'\` denotes a Client Components Module.`,
|
|
40
|
+
useAgnosticLogics20: `\`'use agnostic logics'\` denotes an Agnostic Logics Module.`,
|
|
41
|
+
useAgnosticComponents20: `\`'use agnostic components'\` denotes an Agnostic Components Module.`,
|
|
42
|
+
// library/directive21/_commons/constants/bases.js
|
|
43
|
+
currentFileCommentedDirective: "The current file's commented directive.",
|
|
44
|
+
importedFileCommentedDirective: "The imported file's commented directive.",
|
|
45
|
+
// library/directive21/_commons/utilities/helpers.js
|
|
46
|
+
string: "The original string.",
|
|
47
|
+
sourceCode: "The ESLint SourceCode object.",
|
|
48
|
+
directiveD21:
|
|
49
|
+
"The commented directive as written on top of the file (cannot be `null` at that stage).",
|
|
50
|
+
commentedDirective: "The commented directive of the commented module.",
|
|
51
|
+
useServerLogics21: `\`'use server logics'\`, \`"use server logics"\` denoting a Server Logics Module.`,
|
|
52
|
+
useClientLogics21: `\`'use client logics'\`, \`"use client logics"\` denoting a Client Logics Module.`,
|
|
53
|
+
useAgnosticLogics21: `\`'use agnostic logics'\`, \`"use agnostic logics"\` denoting an Agnostic Logics Module.`,
|
|
54
|
+
useServerComponents21: `\`'use server components'\`, \`"use server components"\` denoting a Server Components Module.`,
|
|
55
|
+
useClientComponents21: `\`'use client components'\`, \`"use client components"\` denoting a Client Components Module.`,
|
|
56
|
+
useAgnosticComponents21: `\`'use agnostic components'\`, \`"use agnostic components"\` denoting an Agnostic Components Module.`,
|
|
57
|
+
useServerFunctions21: `\`'use server functions'\`, \`"use server functions"\` denoting a Server Functions Module.`,
|
|
58
|
+
useClientContexts21: `\`'use client contexts'\`, \`"use client contexts"\` denoting a Client Contexts Module.`,
|
|
59
|
+
useAgnosticConditions21: `\`'use agnostic conditions'\`, \`"use agnostic conditions"\` denoting an Agnostic Conditions Module.`,
|
|
60
|
+
useAgnosticStrategies21: `\`'use agnostic strategies'\`, \`"use agnostic strategies"\` denoting an Agnostic Strategies Module.`,
|
|
61
|
+
useServerLogicsExtensionRule: `\`'use server logics'\`: Server Logics Modules do NOT export JSX.`,
|
|
62
|
+
useClientLogicsExtensionRule: `\`'use client logics'\`: Client Logics Modules do NOT export JSX.`,
|
|
63
|
+
useAgnosticLogicsExtensionRule: `\`'use agnostic logics'\`: Agnostic Logics Modules do NOT export JSX.`,
|
|
64
|
+
useServerComponentsExtensionRule: `\`'use server components'\`: Server Components Modules ONLY export JSX.`,
|
|
65
|
+
useClientComponentsExtensionRule: `\`'use client components'\`: Client Components Modules ONLY export JSX.`,
|
|
66
|
+
useAgnosticComponentsExtensionRule: `\`'use agnostic components'\`: Agnostic Components Modules ONLY export JSX.`,
|
|
67
|
+
useServerFunctionsExtensionRule: `\`'use server functions'\`: Server Functions Modules do NOT export JSX.`,
|
|
68
|
+
useClientContextsExtensionRule: `\`'use client contexts'\`: Client Contexts Modules ONLY export JSX.`,
|
|
69
|
+
useAgnosticConditionsExtensionRule: `\`'use agnostic conditions'\`: Agnostic Conditions Modules ONLY export JSX.`,
|
|
70
|
+
useAgnosticStrategiesExtensionRule: `\`'use agnostic strategies'\`: Agnostic Strategies Modules may export JSX.`,
|
|
71
|
+
// tests/_commons/utilities/helpers.js
|
|
72
|
+
folderPath: "The provided directory.",
|
|
73
|
+
allFiles:
|
|
74
|
+
"The accumulator array of file paths. Defaults to an empty array on the initial call, and is passed through each recursive call to be mutated and collect results.",
|
|
75
|
+
javaScriptErrorsLength: "The number of errors expected on JavaScript files.",
|
|
76
|
+
typeScriptErrorsLength: "The number of errors expected on TypeScript files.",
|
|
77
|
+
messageId: "The messageId of the errors expected.",
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
// comment variables for tests flavor texts
|
|
81
|
+
export const testsComments = Object.freeze({
|
|
82
|
+
thatsA: "That's a",
|
|
83
|
+
thatsAn: "That's an",
|
|
84
|
+
importingA: "...Importing a",
|
|
85
|
+
withExtension: "with extension",
|
|
86
|
+
withExtensionParentheses: "(with extension).",
|
|
87
|
+
byFolder: "by a folder.",
|
|
88
|
+
importing: "...Importing",
|
|
89
|
+
viaStrategy: "via Special Agnostic Strategy",
|
|
90
|
+
viaStrategyPeriod: "via Special Agnostic Strategy.",
|
|
91
|
+
viaAlias: "Via alias.",
|
|
92
|
+
viaBaseUrl: "Via baseUrl.",
|
|
93
|
+
valid: "Valid.",
|
|
94
|
+
invalid: "Invalid.",
|
|
95
|
+
});
|
|
@@ -17,13 +17,15 @@ export const serverLogicsComments = Object.freeze({
|
|
|
17
17
|
[USE_SERVER_FUNCTIONS]:
|
|
18
18
|
/* valid */ "Server Functions, being able to import one another, can compose and do so via Server Logics, despite this method seeming superfluous at first glance. (Perhaps a preferrable use case for this has been found or could be found either today or in the future.)",
|
|
19
19
|
[USE_CLIENT_LOGICS]:
|
|
20
|
-
/* invalid */ "Client Logics should never leak to the server.",
|
|
20
|
+
/* invalid */ "Client Logics should never leak to the server, such as would be the case here in a Server Logics Module.",
|
|
21
21
|
[USE_CLIENT_COMPONENTS]:
|
|
22
22
|
/* invalid */ "Client Components cannot be tinkered with on the server.",
|
|
23
23
|
[USE_AGNOSTIC_LOGICS]:
|
|
24
|
-
/* valid */ "Agnostic Logics can run safely on the server just like they can on the client.",
|
|
24
|
+
/* valid */ "Agnostic Logics can run safely on the server just like they can on the client, such as is the case here in a Server Logics Module.",
|
|
25
25
|
[USE_AGNOSTIC_COMPONENTS]:
|
|
26
26
|
/* valid */ "Agnostic Components can be composed with Logics on the server just like they can on the client, as long at the Server Logics Module, by convention, does not export React components.",
|
|
27
|
+
module: "Server Logics Module",
|
|
28
|
+
modulePeriod: "Server Logics Module.",
|
|
27
29
|
});
|
|
28
30
|
|
|
29
31
|
export const serverComponentsComments = Object.freeze({
|
|
@@ -34,13 +36,15 @@ export const serverComponentsComments = Object.freeze({
|
|
|
34
36
|
[USE_SERVER_FUNCTIONS]:
|
|
35
37
|
/* valid */ "Server Functions can be passed to imported Client Components within Server Components Modules, even though indeed Server Components Modules and Server Components can make their own Server Functions through inline 'use server' directives.",
|
|
36
38
|
[USE_CLIENT_LOGICS]:
|
|
37
|
-
/* invalid */ "Client Logics should never leak to the server.",
|
|
39
|
+
/* invalid */ "Client Logics should never leak to the server, such as would be the case here in a Server Components Module.",
|
|
38
40
|
[USE_CLIENT_COMPONENTS]:
|
|
39
41
|
/* valid */ "Client Components can be nested inside Server Components either to wrap some of the tree with client state accessible through child Client Components and pass through Server Components, or to create client boundaries when the root of the application is planted on the server.",
|
|
40
42
|
[USE_AGNOSTIC_LOGICS]:
|
|
41
|
-
/* valid */ "Agnostic Logics can run safely on the server just like they can on the client.",
|
|
43
|
+
/* valid */ "Agnostic Logics can run safely on the server just like they can on the client, such as is the case here in a Server Components Module.",
|
|
42
44
|
[USE_AGNOSTIC_COMPONENTS]:
|
|
43
45
|
/* valid */ "Agnostic Components can render safely on the server just like they can on the client.",
|
|
46
|
+
module: "Server Components Module",
|
|
47
|
+
modulePeriod: "Server Components Module.",
|
|
44
48
|
});
|
|
45
49
|
|
|
46
50
|
export const serverFunctionsComments = Object.freeze({
|
|
@@ -51,18 +55,20 @@ export const serverFunctionsComments = Object.freeze({
|
|
|
51
55
|
[USE_SERVER_FUNCTIONS]:
|
|
52
56
|
/* valid */ "Server Functions, even though they don't need to import one another and the same results can be generated via Server Logics for the outcome of a single Server Function, can still compose with one another. (Perhaps a preferrable use case for this has been found or could be found either today or in the future.)",
|
|
53
57
|
[USE_CLIENT_LOGICS]:
|
|
54
|
-
/* invalid */ "Client Logics should never leak to the server.",
|
|
58
|
+
/* invalid */ "Client Logics should never leak to the server, such as would be the case here in a Server Functions Module.",
|
|
55
59
|
[USE_CLIENT_COMPONENTS]:
|
|
56
60
|
/* invalid */ "Client Components aren't allowed because Server Functions have no business working with React Components.",
|
|
57
61
|
[USE_AGNOSTIC_LOGICS]:
|
|
58
|
-
/* valid */ "Agnostic Logics can run safely on the server just like they can on the client.",
|
|
62
|
+
/* valid */ "Agnostic Logics can run safely on the server just like they can on the client, such as is the case here in a Server Functions Module.",
|
|
59
63
|
[USE_AGNOSTIC_COMPONENTS]:
|
|
60
64
|
/* invalid */ "Agnostic Components aren't allowed because Server Functions have no business working with React Components.",
|
|
65
|
+
module: "Server Functions Module",
|
|
66
|
+
modulePeriod: "Server Functions Module.",
|
|
61
67
|
});
|
|
62
68
|
|
|
63
69
|
export const clientLogicsComments = Object.freeze({
|
|
64
70
|
[USE_SERVER_LOGICS]:
|
|
65
|
-
/* invalid */ "Server Logics should never leak to the client.",
|
|
71
|
+
/* invalid */ "Server Logics should never leak to the client, such as would be the case here in a Client Logics Module.",
|
|
66
72
|
[USE_SERVER_COMPONENTS]:
|
|
67
73
|
/* invalid */ "Server Components cannot be thinkered with on the client.",
|
|
68
74
|
[USE_SERVER_FUNCTIONS]:
|
|
@@ -72,14 +78,16 @@ export const clientLogicsComments = Object.freeze({
|
|
|
72
78
|
[USE_CLIENT_COMPONENTS]:
|
|
73
79
|
/* valid */ "Client Components are OK to be composed with Client Logics as long as the Client Logics Module, by convention, does not export React components.",
|
|
74
80
|
[USE_AGNOSTIC_LOGICS]:
|
|
75
|
-
/* valid */ "Agnostic Logics can run safely on the client just like they can on the server.",
|
|
81
|
+
/* valid */ "Agnostic Logics can run safely on the client just like they can on the server, such as is the case here in a Client Logics Module.",
|
|
76
82
|
[USE_AGNOSTIC_COMPONENTS]:
|
|
77
83
|
/* valid */ "Agnostic Components can be composed with Logics on the client just like they can on the server, as long as the Client Logics Module, by convention, does not export React components.",
|
|
84
|
+
module: "Client Logics Module",
|
|
85
|
+
modulePeriod: "Client Logics Module.",
|
|
78
86
|
});
|
|
79
87
|
|
|
80
88
|
export const clientComponentsComments = Object.freeze({
|
|
81
89
|
[USE_SERVER_LOGICS]:
|
|
82
|
-
/* invalid */ "Server Logics should never leak to the client.",
|
|
90
|
+
/* invalid */ "Server Logics should never leak to the client, such as would be the case here in a Client Components Module.",
|
|
83
91
|
[USE_SERVER_COMPONENTS]:
|
|
84
92
|
/* invalid */ "Server Components may only pass through Client Components via the children prop within Server Components Modules.",
|
|
85
93
|
[USE_SERVER_FUNCTIONS]:
|
|
@@ -89,41 +97,47 @@ export const clientComponentsComments = Object.freeze({
|
|
|
89
97
|
[USE_CLIENT_COMPONENTS]:
|
|
90
98
|
/* valid */ "Client Components can compose with one another.",
|
|
91
99
|
[USE_AGNOSTIC_LOGICS]:
|
|
92
|
-
/* valid */ "Agnostic Logics can run safely on the client just like they can on the server.",
|
|
100
|
+
/* valid */ "Agnostic Logics can run safely on the client just like they can on the server, such as is the case here in a Client Components Module.",
|
|
93
101
|
[USE_AGNOSTIC_COMPONENTS]:
|
|
94
102
|
/* valid */ "Agnostic Components can render safely on the client just like they can on the server.",
|
|
103
|
+
module: "Client Components Module",
|
|
104
|
+
modulePeriod: "Client Components Module.",
|
|
95
105
|
});
|
|
96
106
|
|
|
97
107
|
export const agnosticLogicsComments = Object.freeze({
|
|
98
108
|
[USE_SERVER_LOGICS]:
|
|
99
|
-
/* invalid */ "Server Logics cannot run on both the server and the client.",
|
|
109
|
+
/* invalid */ "Server Logics cannot run on both the server and the client, such as would be the case here in an Agnostic Logics Module.",
|
|
100
110
|
[USE_SERVER_COMPONENTS]:
|
|
101
111
|
/* invalid */ "Server Components cannot be tinkered with on both the server and the client.",
|
|
102
112
|
[USE_SERVER_FUNCTIONS]:
|
|
103
113
|
/* invalid */ "Server Functions can be modified on the server and on the client, but their use cases on both environments are not one-to-one compatible, since they're being addressed as they are on the server and addressed as references on the client.",
|
|
104
114
|
[USE_CLIENT_LOGICS]:
|
|
105
|
-
/* invalid */ "Client Logics cannot run on both the server and the client.",
|
|
115
|
+
/* invalid */ "Client Logics cannot run on both the server and the client, such as would be the case here in an Agnostic Logics Module.",
|
|
106
116
|
[USE_CLIENT_COMPONENTS]:
|
|
107
117
|
/* invalid */ "Client Components cannot be tinkered with on both the server and the client.",
|
|
108
118
|
[USE_AGNOSTIC_LOGICS]:
|
|
109
119
|
/* valid */ "Agnostic Logics can compose with one another.",
|
|
110
120
|
[USE_AGNOSTIC_COMPONENTS]:
|
|
111
121
|
/* valid */ "Agnostic Components can be composed with Logics agnostically as long as the Agnostic Logics Module, by convention, does not export React components.",
|
|
122
|
+
module: "Agnostic Logics Module",
|
|
123
|
+
modulePeriod: "Agnostic Logics Module.",
|
|
112
124
|
});
|
|
113
125
|
|
|
114
126
|
export const agnosticComponentsComments = Object.freeze({
|
|
115
127
|
[USE_SERVER_LOGICS]:
|
|
116
|
-
/* invalid */ "Server Logics cannot run on both the server and the client.",
|
|
128
|
+
/* invalid */ "Server Logics cannot run on both the server and the client, such as would be the case here in an Agnostic Components Module.",
|
|
117
129
|
[USE_SERVER_COMPONENTS]:
|
|
118
130
|
/* invalid */ "Server Components, unlike Client Components, cannot make silos of their own once on the opposing environment (the client in this case), and therefore cannot be executed from the client, making them unable to execute agnostically from both the server and the client.",
|
|
119
131
|
[USE_SERVER_FUNCTIONS]:
|
|
120
132
|
/* valid */ "Server Functions can be passed to Client Components as props when Client Components are also legally imported into Agnostic Components Modules.",
|
|
121
133
|
[USE_CLIENT_LOGICS]:
|
|
122
|
-
/* invalid */ "Client Logics cannot run on both the server and the client.",
|
|
134
|
+
/* invalid */ "Client Logics cannot run on both the server and the client, such as would be the case here in an Agnostic Components Module.",
|
|
123
135
|
[USE_CLIENT_COMPONENTS]:
|
|
124
136
|
/* valid */ "Client Components can be nested inside Agnostic Components either to wrap some of the tree with client state accessible through child Client Components and pass through Server Components (if still on the Server Tree), or to create client boundaries when the root of the application is planted on the server.",
|
|
125
137
|
[USE_AGNOSTIC_LOGICS]:
|
|
126
138
|
/* valid */ "Agnostic Logics, being environment-agnostic logic, can safely support Agnostic Components.",
|
|
127
139
|
[USE_AGNOSTIC_COMPONENTS]:
|
|
128
140
|
/* valid */ "Agnostic Components can compose with one another.",
|
|
141
|
+
module: "Agnostic Components Module",
|
|
142
|
+
modulePeriod: "Agnostic Components Module.",
|
|
129
143
|
});
|
|
@@ -15,49 +15,55 @@ export const serverLogicsComments = Object.freeze({
|
|
|
15
15
|
[USE_SERVER_LOGICS]:
|
|
16
16
|
/* valid */ "Prime Server Logics can compose with one another.",
|
|
17
17
|
[USE_CLIENT_LOGICS]:
|
|
18
|
-
/* invalid */ "Prime Client Logics should never leak to the server.",
|
|
18
|
+
/* invalid */ "Prime Client Logics should never leak to the server, such as would be the case here in a Prime Server Logics Module.",
|
|
19
19
|
[USE_AGNOSTIC_LOGICS]:
|
|
20
|
-
/* valid */ "Prime Agnostic Logics can run safely on the server just like they can on the client.",
|
|
20
|
+
/* valid */ "Prime Agnostic Logics can run safely on the server just like they can on the client, such as is the case here in a Prime Server Logics Module.",
|
|
21
21
|
[USE_SERVER_COMPONENTS]:
|
|
22
22
|
/* valid */ "Lineal Server Components are OK to be composed with Prime Server Logics as long as the Prime Server Logics Module, by convention, does not export React components.",
|
|
23
23
|
[USE_CLIENT_COMPONENTS]:
|
|
24
24
|
/* invalid */ "Lineal Client Components, like any Client Components, cannot be tinkered with on the server.",
|
|
25
25
|
[USE_AGNOSTIC_COMPONENTS]:
|
|
26
|
-
/* valid */ "Lineal Agnostic Components can be composed with any Prime Environment Logics agnostically as long as the Prime Environment Logics Module, by convention, does not export React components.",
|
|
26
|
+
/* valid */ "Lineal Agnostic Components can be composed with any Prime Environment Logics agnostically, such as Prime Server Logics, as long as the Prime Environment Logics Module, by convention, does not export React components.",
|
|
27
27
|
[USE_SERVER_FUNCTIONS]:
|
|
28
28
|
/* valid */ "(Special) Server Functions, being able to import one another, can compose and do so via Prime Server Logics, despite this method seeming superfluous at first glance. (Perhaps a preferrable use case for this has been found or could be found either today or in the future.)",
|
|
29
29
|
[USE_CLIENT_CONTEXTS]:
|
|
30
30
|
/* invalid */ "Client Contexts Components, like any Client Components, cannot be tinkered with on the server.",
|
|
31
31
|
[USE_AGNOSTIC_CONDITIONS]:
|
|
32
32
|
/* valid */ "(Special) Agnostic Conditions Components are able to safely render on the server, guaranteeing that only their `ComponentForServer` will be effectively involved in Prime Server Logics Modules.",
|
|
33
|
+
module: "Prime Server Logics Module",
|
|
34
|
+
modulePeriod: "Prime Server Logics Module.",
|
|
35
|
+
kinds: "Prime Server Logics",
|
|
33
36
|
});
|
|
34
37
|
|
|
35
38
|
export const clientLogicsComments = Object.freeze({
|
|
36
39
|
[USE_SERVER_LOGICS]:
|
|
37
|
-
/* invalid */ "Prime Server Logics should never leak to the client.",
|
|
40
|
+
/* invalid */ "Prime Server Logics should never leak to the client, such as would be the case here in a Prime Client Logics Module.",
|
|
38
41
|
[USE_CLIENT_LOGICS]:
|
|
39
42
|
/* valid */ "Prime Client Logics can compose with one another.",
|
|
40
43
|
[USE_AGNOSTIC_LOGICS]:
|
|
41
|
-
/* valid */ "Prime Agnostic Logics can run safely on the client just like they can on the server.",
|
|
44
|
+
/* valid */ "Prime Agnostic Logics can run safely on the client just like they can on the server, such as is the case here in a Prime Client Logics Module.",
|
|
42
45
|
[USE_SERVER_COMPONENTS]:
|
|
43
46
|
/* invalid */ "Lineal Server Components cannot be thinkered with on the client.",
|
|
44
47
|
[USE_CLIENT_COMPONENTS]:
|
|
45
48
|
/* valid */ "Lineal Client Components, like any Client Components, are OK to be composed with Prime Client Logics as long as the Prime Client Logics Module, by convention, does not export React components.",
|
|
46
49
|
[USE_AGNOSTIC_COMPONENTS]:
|
|
47
|
-
/* valid */ "Lineal Agnostic Components can be composed with any Prime Environment Logics agnostically as long as the Prime Environment Logics Module, by convention, does not export React components.",
|
|
50
|
+
/* valid */ "Lineal Agnostic Components can be composed with any Prime Environment Logics agnostically, such as Prime Client Logics, as long as the Prime Environment Logics Module, by convention, does not export React components.",
|
|
48
51
|
[USE_SERVER_FUNCTIONS]:
|
|
49
52
|
/* valid */ "(Special) Server Functions can technically be attached to Client Components that are being tinkered with within Client Logics Modules.",
|
|
50
53
|
[USE_CLIENT_CONTEXTS]:
|
|
51
54
|
/* valid */ "(Special) Client Contexts Components, like any Client Components, are OK to be composed with Prime Client Logics as long as the Prime Client Logics Module, by convention, does not export React components.",
|
|
52
55
|
[USE_AGNOSTIC_CONDITIONS]:
|
|
53
56
|
/* valid */ "(Special) Agnostic Conditions Components are able to safely render on the client, guaranteeing that only their `ComponentForClient` will be effectively involved in Prime Client Logics Modules.",
|
|
57
|
+
module: "Prime Client Logics Module",
|
|
58
|
+
modulePeriod: "Prime Client Logics Module.",
|
|
59
|
+
kinds: "Prime Client Logics",
|
|
54
60
|
});
|
|
55
61
|
|
|
56
62
|
export const agnosticLogicsComments = Object.freeze({
|
|
57
63
|
[USE_SERVER_LOGICS]:
|
|
58
|
-
/* invalid */ "Prime Server Logics cannot run on both the server and the client.",
|
|
64
|
+
/* invalid */ "Prime Server Logics cannot run on both the server and the client, such as would be the case here in a Prime Agnostic Logics Module.",
|
|
59
65
|
[USE_CLIENT_LOGICS]:
|
|
60
|
-
/* invalid */ "Prime Client Logics cannot run on both the server and the client.",
|
|
66
|
+
/* invalid */ "Prime Client Logics cannot run on both the server and the client, such as would be the case here in a Prime Agnostic Logics Module.",
|
|
61
67
|
[USE_AGNOSTIC_LOGICS]:
|
|
62
68
|
/* valid */ "Prime Agnostic Logics can compose with one another.",
|
|
63
69
|
[USE_SERVER_COMPONENTS]:
|
|
@@ -65,22 +71,25 @@ export const agnosticLogicsComments = Object.freeze({
|
|
|
65
71
|
[USE_CLIENT_COMPONENTS]:
|
|
66
72
|
/* invalid */ "Lineal Client Components, like any Client Components, cannot be tinkered with on both the server and the client.",
|
|
67
73
|
[USE_AGNOSTIC_COMPONENTS]:
|
|
68
|
-
/* valid */ "Lineal Agnostic Components can be composed with any Prime Environment Logics agnostically as long as the Prime Environment Logics Module, by convention, does not export React components.",
|
|
74
|
+
/* valid */ "Lineal Agnostic Components can be composed with any Prime Environment Logics agnostically, such as Prime Agnostic Logics, as long as the Prime Environment Logics Module, by convention, does not export React components.",
|
|
69
75
|
[USE_SERVER_FUNCTIONS]:
|
|
70
76
|
/* invalid */ "(Special) Server Functions can be modified on the server and on the client, but their use cases on both environments are not one-to-one compatible, since they're being addressed as they are on the server and addressed as references on the client.",
|
|
71
77
|
[USE_CLIENT_CONTEXTS]:
|
|
72
78
|
/* invalid */ "(Special) Client Contexts Components, like any Client Components, cannot be tinkered with on both the server and the client.",
|
|
73
79
|
[USE_AGNOSTIC_CONDITIONS]:
|
|
74
80
|
/* valid */ "(Special) Agnostic Conditions Components, as if they were Lineal Agnostic Components themselves, can be composed with any Prime Environment Logics agnostically as long as the Prime Environment Logics Module, by convention, does not export React components.",
|
|
81
|
+
module: "Prime Agnostic Logics Module",
|
|
82
|
+
modulePeriod: "Prime Agnostic Logics Module.",
|
|
83
|
+
kinds: "Prime Agnostic Logics",
|
|
75
84
|
});
|
|
76
85
|
|
|
77
86
|
export const serverComponentsComments = Object.freeze({
|
|
78
87
|
[USE_SERVER_LOGICS]:
|
|
79
88
|
/* valid */ "Prime Server Logics, being logic from the server, can safely support Lineal Server Components.",
|
|
80
89
|
[USE_CLIENT_LOGICS]:
|
|
81
|
-
/* invalid */ "Prime Client Logics should never leak to the server.",
|
|
90
|
+
/* invalid */ "Prime Client Logics should never leak to the server, such as would be the case here in a Lineal Server Components Module.",
|
|
82
91
|
[USE_AGNOSTIC_LOGICS]:
|
|
83
|
-
/* valid */ "Prime Agnostic Logics can run safely on the server just like they can on the client.",
|
|
92
|
+
/* valid */ "Prime Agnostic Logics can run safely on the server just like they can on the client, such as is the case here in a Lineal Server Components Module.",
|
|
84
93
|
[USE_SERVER_COMPONENTS]:
|
|
85
94
|
/* valid */ "Lineal Server Components can compose with one another, now that thanks to the inclusion of Agnostic Components they are actual Server Components.",
|
|
86
95
|
[USE_CLIENT_COMPONENTS]:
|
|
@@ -93,34 +102,40 @@ export const serverComponentsComments = Object.freeze({
|
|
|
93
102
|
/* valid */ "(Special) Client Contexts Components can be nested inside Server Components to wrap some of the tree with client state accessible through child Client Components, and to pass through Server Components when the root of the application is planted on the server.",
|
|
94
103
|
[USE_AGNOSTIC_CONDITIONS]:
|
|
95
104
|
/* valid */ "(Special) Agnostic Conditions Components, as if they were Lineal Agnostic Components themselves, can render safely on the server just like they can on the client.",
|
|
105
|
+
module: "Lineal Server Components Module",
|
|
106
|
+
modulePeriod: "Lineal Server Components Module.",
|
|
107
|
+
kinds: "Lineal Server Components",
|
|
96
108
|
});
|
|
97
109
|
|
|
98
110
|
export const clientComponentsComments = Object.freeze({
|
|
99
111
|
[USE_SERVER_LOGICS]:
|
|
100
|
-
/* invalid */ "Prime Server Logics should never leak to the client.",
|
|
112
|
+
/* invalid */ "Prime Server Logics should never leak to the client, such as would be the case here in a Lineal Client Components Module.",
|
|
101
113
|
[USE_CLIENT_LOGICS]:
|
|
102
114
|
/* valid */ "Prime Client Logics, being logic from the client, can safely support Lineal Client Components, like any Client Components.",
|
|
103
115
|
[USE_AGNOSTIC_LOGICS]:
|
|
104
|
-
/* valid */ "Prime Agnostic Logics can run safely on the client just like they can on the server.",
|
|
116
|
+
/* valid */ "Prime Agnostic Logics can run safely on the client just like they can on the server, such as is the case here in a Lineal Client Components Module.",
|
|
105
117
|
[USE_SERVER_COMPONENTS]:
|
|
106
118
|
/* invalid */ "Lineal Server Components cannot be the children of Lineal Client Components.",
|
|
107
119
|
[USE_CLIENT_COMPONENTS]:
|
|
108
120
|
/* valid */ "Lineal Client Components can compose with one another.",
|
|
109
121
|
[USE_AGNOSTIC_COMPONENTS]:
|
|
110
|
-
/* valid */ "Lineal Agnostic Components can render safely on the client just like they can on the server.",
|
|
122
|
+
/* valid */ "Lineal Agnostic Components can render safely on the client just like they can on the server, such as is the case here in a Lineal Client Components Module.",
|
|
111
123
|
[USE_SERVER_FUNCTIONS]:
|
|
112
|
-
/* valid */ "(Special) Server Functions are specifically triggered by Client Components.",
|
|
124
|
+
/* valid */ "(Special) Server Functions are specifically triggered by Client Components, such as is the case here in a Lineal Client Components Module.",
|
|
113
125
|
[USE_CLIENT_CONTEXTS]:
|
|
114
126
|
/* valid */ "(Special) Client Contexts Components can effectively become Lineal and only render their children on the client via this mechanism since, by a Client Contexts Component being the child of a Lineal Client Component, the Client Contexts Component's children become the grand-children of an ancestor Lineal Client Component, enforcing them to render exclusively on the client.",
|
|
115
127
|
[USE_AGNOSTIC_CONDITIONS]:
|
|
116
128
|
/* valid */ "(Special) Agnostic Conditions Components, as if they were Lineal Agnostic Components themselves, can render safely on the client just like they can on the server.",
|
|
129
|
+
module: "Lineal Client Components Module",
|
|
130
|
+
modulePeriod: "Lineal Client Components Module.",
|
|
131
|
+
kinds: "Lineal Client Components",
|
|
117
132
|
});
|
|
118
133
|
|
|
119
134
|
export const agnosticComponentsComments = Object.freeze({
|
|
120
135
|
[USE_SERVER_LOGICS]:
|
|
121
|
-
/* invalid */ "Prime Server Logics cannot run on both the server and the client.",
|
|
136
|
+
/* invalid */ "Prime Server Logics cannot run on both the server and the client, such as would be the case here in a Lineal Agnostic Components Module.",
|
|
122
137
|
[USE_CLIENT_LOGICS]:
|
|
123
|
-
/* invalid */ "Prime Client Logics cannot run on both the server and the client.",
|
|
138
|
+
/* invalid */ "Prime Client Logics cannot run on both the server and the client, such as would be the case here in a Lineal Agnostic Components Module.",
|
|
124
139
|
[USE_AGNOSTIC_LOGICS]:
|
|
125
140
|
/* valid */ "Prime Agnostic Logics, being environment-agnostic logic, can safely support Agnostic Components.",
|
|
126
141
|
[USE_SERVER_COMPONENTS]:
|
|
@@ -135,15 +150,18 @@ export const agnosticComponentsComments = Object.freeze({
|
|
|
135
150
|
/* valid */ "(Special) Client Contexts Components can be nested inside Agnostic Components to wrap some of the tree with client state accessible through child Client Components, and to pass through Server Components (if still on the Server Tree) when the root of the application is planted on the server.",
|
|
136
151
|
[USE_AGNOSTIC_CONDITIONS]:
|
|
137
152
|
/* valid */ "(Special) Agnostic Conditions Components can compose with Lineal Agnostic Components as if they were Lineal Agnostic Components themselves, making them a necessary mechanism for Server Components to be nested in Agnostic Components.",
|
|
153
|
+
module: "Lineal Agnostic Components Module",
|
|
154
|
+
modulePeriod: "Lineal Agnostic Components Module.",
|
|
155
|
+
kinds: "Lineal Agnostic Components",
|
|
138
156
|
});
|
|
139
157
|
|
|
140
158
|
export const serverFunctionsComments = Object.freeze({
|
|
141
159
|
[USE_SERVER_LOGICS]:
|
|
142
160
|
/* valid */ "Prime Server Logics, being logic from the server, can safely support (Special) Server Functions.",
|
|
143
161
|
[USE_CLIENT_LOGICS]:
|
|
144
|
-
/* invalid */ "Prime Client Logics should never leak to the server.",
|
|
162
|
+
/* invalid */ "Prime Client Logics should never leak to the server, such as would be the case here in a Special Server Functions Module.",
|
|
145
163
|
[USE_AGNOSTIC_LOGICS]:
|
|
146
|
-
/* valid */ "Prime Agnostic Logics can run safely on the server just like they can on the client.",
|
|
164
|
+
/* valid */ "Prime Agnostic Logics can run safely on the server just like they can on the client, such as is the case here in a Special Server Functions Module.",
|
|
147
165
|
[USE_SERVER_COMPONENTS]:
|
|
148
166
|
/* invalid */ "Lineal Server Components aren't allowed because (Special) Server Functions have no business working with React Components.",
|
|
149
167
|
[USE_CLIENT_COMPONENTS]:
|
|
@@ -156,34 +174,40 @@ export const serverFunctionsComments = Object.freeze({
|
|
|
156
174
|
/* invalid */ "(Special) Client Contexts Components aren't allowed because (Special) Server Functions have no business working with React Components.",
|
|
157
175
|
[USE_AGNOSTIC_CONDITIONS]:
|
|
158
176
|
/* invalid */ "(Special) Agnostic Conditions Components aren't allowed because (Special) Server Functions have no business working with React Components.",
|
|
177
|
+
module: "Special Server Functions Module",
|
|
178
|
+
modulePeriod: "Special Server Functions Module.",
|
|
179
|
+
kinds: "Special Server Functions",
|
|
159
180
|
});
|
|
160
181
|
|
|
161
182
|
export const clientContextsComments = Object.freeze({
|
|
162
183
|
[USE_SERVER_LOGICS]:
|
|
163
|
-
/* invalid */ "Prime Server Logics should never leak to the client.",
|
|
184
|
+
/* invalid */ "Prime Server Logics should never leak to the client, such as would be the case here in a Special Client Contexts Module.",
|
|
164
185
|
[USE_CLIENT_LOGICS]:
|
|
165
186
|
/* valid */ "Prime Client Logics, being logic from the client, can safely support (Special) Client Contexts Components, like any Client Components.",
|
|
166
187
|
[USE_AGNOSTIC_LOGICS]:
|
|
167
|
-
/* valid */ "Prime Agnostic Logics can run safely on the client just like they can on the server.",
|
|
188
|
+
/* valid */ "Prime Agnostic Logics can run safely on the client just like they can on the server, such as is the case here in a Special Client Contexts Module.",
|
|
168
189
|
[USE_SERVER_COMPONENTS]:
|
|
169
190
|
/* invalid */ "Lineal Server Components may only pass through (Special) Client Contexts Components via the children prop within Server Components Modules.",
|
|
170
191
|
[USE_CLIENT_COMPONENTS]:
|
|
171
192
|
/* valid */ "Lineal Client Components can create client boundaries within (Special) Client Contexts Components.",
|
|
172
193
|
[USE_AGNOSTIC_COMPONENTS]:
|
|
173
|
-
/* valid */ "Lineal Agnostic Components can render safely on the client just like they can on the server.",
|
|
194
|
+
/* valid */ "Lineal Agnostic Components can render safely on the client just like they can on the server, such as is the case here in a Special Client Contexts Module.",
|
|
174
195
|
[USE_SERVER_FUNCTIONS]:
|
|
175
|
-
/* valid */ "(Special) Server Functions are specifically triggered by Client Components.",
|
|
196
|
+
/* valid */ "(Special) Server Functions are specifically triggered by Client Components, such as is the case here in a Special Client Contexts Module.",
|
|
176
197
|
[USE_CLIENT_CONTEXTS]:
|
|
177
198
|
/* valid */ "(Special) Client Contexts Components can compose with one another.",
|
|
178
199
|
[USE_AGNOSTIC_CONDITIONS]:
|
|
179
200
|
/* valid */ "(Special) Agnostic Conditions Components, as if they were Lineal Agnostic Components themselves, can render safely on the client just like they can on the server, in a mechanism that allows (Special) Client Contexts Components to safely and indirectly compose with child Server Components within Client Contexts Modules.",
|
|
201
|
+
module: "Special Client Contexts Module",
|
|
202
|
+
modulePeriod: "Special Client Contexts Module.",
|
|
203
|
+
kinds: "Special Client Contexts",
|
|
180
204
|
});
|
|
181
205
|
|
|
182
206
|
export const agnosticConditionsComments = Object.freeze({
|
|
183
207
|
[USE_SERVER_LOGICS]:
|
|
184
|
-
/* invalid */ "Prime Server Logics cannot run on both the server and the client.",
|
|
208
|
+
/* invalid */ "Prime Server Logics cannot run on both the server and the client, such as would be the case here in a Special Agnostic Conditions Module.",
|
|
185
209
|
[USE_CLIENT_LOGICS]:
|
|
186
|
-
/* invalid */ "Prime Client Logics cannot run on both the server and the client.",
|
|
210
|
+
/* invalid */ "Prime Client Logics cannot run on both the server and the client, such as would be the case here in a Special Agnostic Conditions Module.",
|
|
187
211
|
[USE_AGNOSTIC_LOGICS]:
|
|
188
212
|
/* valid */ "Prime Agnostic Logics, being environment-agnostic logic, can safely support Agnostic Components, including (Special) Agnostic Conditions Components. (In this case this is necessary for the import of the `conditionAgnosticComponent` function needed to make Agnostic Conditions Components.)",
|
|
189
213
|
[USE_SERVER_COMPONENTS]:
|
|
@@ -198,4 +222,7 @@ export const agnosticConditionsComments = Object.freeze({
|
|
|
198
222
|
/* invalid */ "(Special) Client Contexts Components cannot be used as component arguments for (Special) Agnostic Conditions Components since they only take Lineal Components as arguments in their making.",
|
|
199
223
|
[USE_AGNOSTIC_CONDITIONS]:
|
|
200
224
|
/* valid */ "(Special) Agnostic Conditions Components, despite not being Lineal Components themselves, output components that can only be Lineal and compatible with their attributed rendering environments, making them acceptable arguments in the making of Agnostic Conditions Components.",
|
|
225
|
+
module: "Special Agnostic Conditions Module",
|
|
226
|
+
modulePeriod: "Special Agnostic Conditions Module.",
|
|
227
|
+
kinds: "Special Agnostic Conditions",
|
|
201
228
|
});
|
|
@@ -140,123 +140,123 @@ const makeBlockedImportSuggestingUseAgnostic = (
|
|
|
140
140
|
|
|
141
141
|
export const effectiveDirectives_blockedImports = Object.freeze({
|
|
142
142
|
[USE_SERVER_LOGICS]: Object.freeze([
|
|
143
|
-
// USE_SERVER_LOGICS allowed, because
|
|
144
|
-
// USE_SERVER_COMPONENTS allowed, because
|
|
145
|
-
// USE_SERVER_FUNCTIONS allowed, because
|
|
143
|
+
// USE_SERVER_LOGICS allowed, because Server Logics can compose with one another.
|
|
144
|
+
// USE_SERVER_COMPONENTS allowed, because Server Components are OK to be composed with Server Logics as long as the Server Logics Module, by convention, does not export React components.
|
|
145
|
+
// USE_SERVER_FUNCTIONS allowed, because Server Functions, being able to import one another, can compose and do so via Server Logics, despite this method seeming superfluous at first glance. (Perhaps a preferrable use case for this has been found or could be found either today or in the future.)
|
|
146
146
|
makeBlockedImport(
|
|
147
147
|
USE_SERVER_LOGICS,
|
|
148
148
|
USE_CLIENT_LOGICS
|
|
149
|
-
) /*
|
|
149
|
+
) /* Client Logics should never leak to the server, such as would be the case here in a Server Logics Module. */,
|
|
150
150
|
makeBlockedImport(
|
|
151
151
|
USE_SERVER_LOGICS,
|
|
152
152
|
USE_CLIENT_COMPONENTS
|
|
153
|
-
) /*
|
|
154
|
-
// USE_AGNOSTIC_LOGICS allowed, because
|
|
155
|
-
// USE_AGNOSTIC_COMPONENTS allowed, because
|
|
153
|
+
) /* Client Components cannot be tinkered with on the server. */,
|
|
154
|
+
// USE_AGNOSTIC_LOGICS allowed, because Agnostic Logics can run safely on the server just like they can on the client, such as is the case here in a Server Logics Module.
|
|
155
|
+
// USE_AGNOSTIC_COMPONENTS allowed, because Agnostic Components can be composed with Logics on the server just like they can on the client, as long at the Server Logics Module, by convention, does not export React components.
|
|
156
156
|
]),
|
|
157
157
|
[USE_SERVER_COMPONENTS]: Object.freeze([
|
|
158
|
-
// USE_SERVER_LOGICS allowed, because
|
|
159
|
-
// USE_SERVER_COMPONENTS allowed, because
|
|
160
|
-
// USE_SERVER_FUNCTIONS allowed, because
|
|
158
|
+
// USE_SERVER_LOGICS allowed, because Server Logics, being logic from the server, can safely support Server Components.
|
|
159
|
+
// USE_SERVER_COMPONENTS allowed, because Server Components can compose with one another, assuming thanks to the inclusion of the 'use agnostic' directive that they are actual Server Components.
|
|
160
|
+
// USE_SERVER_FUNCTIONS allowed, because Server Functions can be passed to imported Client Components within Server Components Modules, even though indeed Server Components Modules and Server Components can make their own Server Functions through inline 'use server' directives.
|
|
161
161
|
makeBlockedImport(
|
|
162
162
|
USE_SERVER_COMPONENTS,
|
|
163
163
|
USE_CLIENT_LOGICS
|
|
164
|
-
) /*
|
|
165
|
-
// USE_CLIENT_COMPONENTS allowed, because
|
|
166
|
-
// USE_AGNOSTIC_LOGICS allowed, because
|
|
167
|
-
// USE_AGNOSTIC_COMPONENTS allowed, because
|
|
164
|
+
) /* Client Logics should never leak to the server, such as would be the case here in a Server Components Module. */,
|
|
165
|
+
// USE_CLIENT_COMPONENTS allowed, because Client Components can be nested inside Server Components either to wrap some of the tree with client state accessible through child Client Components and pass through Server Components, or to create client boundaries when the root of the application is planted on the server.
|
|
166
|
+
// USE_AGNOSTIC_LOGICS allowed, because Agnostic Logics can run safely on the server just like they can on the client, such as is the case here in a Server Components Module.
|
|
167
|
+
// USE_AGNOSTIC_COMPONENTS allowed, because Agnostic Components can render safely on the server just like they can on the client.
|
|
168
168
|
]),
|
|
169
169
|
[USE_SERVER_FUNCTIONS]: Object.freeze([
|
|
170
|
-
// USE_SERVER_LOGICS allowed, because
|
|
170
|
+
// USE_SERVER_LOGICS allowed, because Server Logics, being logic from the server, can safely support Server Functions.
|
|
171
171
|
makeBlockedImport(
|
|
172
172
|
USE_SERVER_FUNCTIONS,
|
|
173
173
|
USE_SERVER_COMPONENTS
|
|
174
|
-
) /*
|
|
175
|
-
// USE_SERVER_FUNCTIONS allowed, because
|
|
174
|
+
) /* Server Components aren't allowed because Server Functions have no business working with React Components. */,
|
|
175
|
+
// USE_SERVER_FUNCTIONS allowed, because Server Functions, even though they don't need to import one another and the same results can be generated via Server Logics for the outcome of a single Server Function, can still compose with one another. (Perhaps a preferrable use case for this has been found or could be found either today or in the future.)
|
|
176
176
|
makeBlockedImport(
|
|
177
177
|
USE_SERVER_FUNCTIONS,
|
|
178
178
|
USE_CLIENT_LOGICS
|
|
179
|
-
) /*
|
|
179
|
+
) /* Client Logics should never leak to the server, such as would be the case here in a Server Functions Module. */,
|
|
180
180
|
makeBlockedImport(
|
|
181
181
|
USE_SERVER_FUNCTIONS,
|
|
182
182
|
USE_CLIENT_COMPONENTS
|
|
183
|
-
) /*
|
|
184
|
-
// USE_AGNOSTIC_LOGICS allowed, because
|
|
183
|
+
) /* Client Components aren't allowed because Server Functions have no business working with React Components. */,
|
|
184
|
+
// USE_AGNOSTIC_LOGICS allowed, because Agnostic Logics can run safely on the server just like they can on the client, such as is the case here in a Server Functions Module.
|
|
185
185
|
makeBlockedImport(
|
|
186
186
|
USE_SERVER_FUNCTIONS,
|
|
187
187
|
USE_AGNOSTIC_COMPONENTS
|
|
188
|
-
) /*
|
|
188
|
+
) /* Agnostic Components aren't allowed because Server Functions have no business working with React Components. */,
|
|
189
189
|
]),
|
|
190
190
|
[USE_CLIENT_LOGICS]: Object.freeze([
|
|
191
191
|
makeBlockedImportSuggestingUseAgnostic(
|
|
192
192
|
USE_CLIENT_LOGICS,
|
|
193
193
|
USE_SERVER_LOGICS
|
|
194
|
-
) /*
|
|
194
|
+
) /* Server Logics should never leak to the client, such as would be the case here in a Client Logics Module. */,
|
|
195
195
|
makeBlockedImportSuggestingUseAgnostic(
|
|
196
196
|
USE_CLIENT_LOGICS,
|
|
197
197
|
USE_SERVER_COMPONENTS
|
|
198
|
-
) /*
|
|
199
|
-
// USE_SERVER_FUNCTIONS allowed, because
|
|
200
|
-
// USE_CLIENT_LOGICS allowed, because
|
|
201
|
-
// USE_CLIENT_COMPONENTS allowed, because
|
|
202
|
-
// USE_AGNOSTIC_LOGICS allowed, because
|
|
203
|
-
// USE_AGNOSTIC_COMPONENTS allowed, because
|
|
198
|
+
) /* Server Components cannot be thinkered with on the client. */,
|
|
199
|
+
// USE_SERVER_FUNCTIONS allowed, because Server Functions can technically be attached to Client Components that are being tinkered with within Client Logics Modules.
|
|
200
|
+
// USE_CLIENT_LOGICS allowed, because Client Logics can compose with one another.
|
|
201
|
+
// USE_CLIENT_COMPONENTS allowed, because Client Components are OK to be composed with Client Logics as long as the Client Logics Module, by convention, does not export React components.
|
|
202
|
+
// USE_AGNOSTIC_LOGICS allowed, because Agnostic Logics can run safely on the client just like they can on the server, such as is the case here in a Client Logics Module.
|
|
203
|
+
// USE_AGNOSTIC_COMPONENTS allowed, because Agnostic Components can be composed with Logics on the client just like they can on the server, as long as the Client Logics Module, by convention, does not export React components.
|
|
204
204
|
]),
|
|
205
205
|
[USE_CLIENT_COMPONENTS]: Object.freeze([
|
|
206
206
|
makeBlockedImportSuggestingUseAgnostic(
|
|
207
207
|
USE_CLIENT_LOGICS,
|
|
208
208
|
USE_SERVER_LOGICS
|
|
209
|
-
) /*
|
|
209
|
+
) /* Server Logics should never leak to the client, such as would be the case here in a Client Logics Module. */,
|
|
210
210
|
makeBlockedImportSuggestingUseAgnostic(
|
|
211
211
|
USE_CLIENT_LOGICS,
|
|
212
212
|
USE_SERVER_COMPONENTS
|
|
213
|
-
) /*
|
|
214
|
-
// USE_SERVER_FUNCTIONS allowed, because
|
|
215
|
-
// USE_CLIENT_LOGICS allowed, because
|
|
216
|
-
// USE_CLIENT_COMPONENTS allowed, because
|
|
217
|
-
// USE_AGNOSTIC_LOGICS allowed, because
|
|
218
|
-
// USE_AGNOSTIC_COMPONENTS allowed, because
|
|
213
|
+
) /* Server Components cannot be thinkered with on the client. */,
|
|
214
|
+
// USE_SERVER_FUNCTIONS allowed, because Server Functions are specifically triggered by Client Components.
|
|
215
|
+
// USE_CLIENT_LOGICS allowed, because Client Logics, being logic from the client, can safely support Client Components.
|
|
216
|
+
// USE_CLIENT_COMPONENTS allowed, because Client Components can compose with one another.
|
|
217
|
+
// USE_AGNOSTIC_LOGICS allowed, because Agnostic Logics can run safely on the client just like they can on the server, such as is the case here in a Client Components Module.
|
|
218
|
+
// USE_AGNOSTIC_COMPONENTS allowed, because Agnostic Components can render safely on the client just like they can on the server.
|
|
219
219
|
]),
|
|
220
220
|
[USE_AGNOSTIC_LOGICS]: Object.freeze([
|
|
221
221
|
makeBlockedImportSuggestingUseAgnostic(
|
|
222
222
|
USE_AGNOSTIC_LOGICS,
|
|
223
223
|
USE_SERVER_LOGICS
|
|
224
|
-
) /*
|
|
224
|
+
) /* Server Logics cannot run on both the server and the client, such as would be the case here in an Agnostic Logics Module. */,
|
|
225
225
|
makeBlockedImportSuggestingUseAgnostic(
|
|
226
226
|
USE_AGNOSTIC_LOGICS,
|
|
227
227
|
USE_SERVER_COMPONENTS
|
|
228
|
-
) /*
|
|
228
|
+
) /* Server Components cannot be tinkered with on both the server and the client. */,
|
|
229
229
|
makeBlockedImport(
|
|
230
230
|
USE_AGNOSTIC_LOGICS,
|
|
231
231
|
USE_SERVER_FUNCTIONS
|
|
232
|
-
) /*
|
|
232
|
+
) /* Server Functions can be modified on the server and on the client, but their use cases on both environments are not one-to-one compatible, since they're being addressed as they are on the server and addressed as references on the client. */,
|
|
233
233
|
makeBlockedImport(
|
|
234
234
|
USE_AGNOSTIC_LOGICS,
|
|
235
235
|
USE_CLIENT_LOGICS
|
|
236
|
-
) /*
|
|
236
|
+
) /* Client Logics cannot run on both the server and the client, such as would be the case here in an Agnostic Logics Module. */,
|
|
237
237
|
makeBlockedImport(
|
|
238
238
|
USE_AGNOSTIC_LOGICS,
|
|
239
239
|
USE_CLIENT_COMPONENTS
|
|
240
|
-
) /*
|
|
241
|
-
// USE_AGNOSTIC_LOGICS allowed, because
|
|
242
|
-
// USE_AGNOSTIC_COMPONENTS allowed, because
|
|
240
|
+
) /* Client Components cannot be tinkered with on both the server and the client. */,
|
|
241
|
+
// USE_AGNOSTIC_LOGICS allowed, because Agnostic Logics can compose with one another.
|
|
242
|
+
// USE_AGNOSTIC_COMPONENTS allowed, because Agnostic Components can be composed with Logics agnostically as long as the Agnostic Logics Module, by convention, does not export React components.
|
|
243
243
|
]),
|
|
244
244
|
[USE_AGNOSTIC_COMPONENTS]: Object.freeze([
|
|
245
245
|
makeBlockedImportSuggestingUseAgnostic(
|
|
246
246
|
USE_AGNOSTIC_COMPONENTS,
|
|
247
247
|
USE_SERVER_LOGICS
|
|
248
|
-
) /*
|
|
248
|
+
) /* Server Logics cannot run on both the server and the client, such as would be the case here in an Agnostic Components Module. */,
|
|
249
249
|
makeBlockedImportSuggestingUseAgnostic(
|
|
250
250
|
USE_AGNOSTIC_COMPONENTS,
|
|
251
251
|
USE_SERVER_COMPONENTS
|
|
252
|
-
) /*
|
|
253
|
-
// USE_SERVER_FUNCTIONS allowed, because
|
|
252
|
+
) /* Server Components, unlike Client Components, cannot make silos of their own once on the opposing environment (the client in this case), and therefore cannot be executed from the client, making them unable to execute agnostically from both the server and the client. */,
|
|
253
|
+
// USE_SERVER_FUNCTIONS allowed, because Server Functions can be passed to Client Components as props when Client Components are also legally imported into Agnostic Components Modules.
|
|
254
254
|
makeBlockedImport(
|
|
255
255
|
USE_AGNOSTIC_COMPONENTS,
|
|
256
256
|
USE_CLIENT_LOGICS
|
|
257
|
-
) /*
|
|
258
|
-
// USE_CLIENT_COMPONENTS allowed, because
|
|
259
|
-
// USE_AGNOSTIC_LOGICS allowed, because
|
|
260
|
-
// USE_AGNOSTIC_COMPONENTS allowed, because
|
|
257
|
+
) /* Client Logics cannot run on both the server and the client, such as would be the case here in an Agnostic Components Module. */,
|
|
258
|
+
// USE_CLIENT_COMPONENTS allowed, because Client Components can be nested inside Agnostic Components either to wrap some of the tree with client state accessible through child Client Components and pass through Server Components (if still on the Server Tree), or to create client boundaries when the root of the application is planted on the server.
|
|
259
|
+
// USE_AGNOSTIC_LOGICS allowed, because Agnostic Logics, being environment-agnostic logic, can safely support Agnostic Components.
|
|
260
|
+
// USE_AGNOSTIC_COMPONENTS allowed, because Agnostic Components can compose with one another.
|
|
261
261
|
]),
|
|
262
262
|
});
|
|
@@ -29,8 +29,8 @@ import {
|
|
|
29
29
|
/**
|
|
30
30
|
* Gets the directive of a module from its Abstract Syntax Tree.
|
|
31
31
|
* - `null` denotes a server-by-default module, ideally a Server Module.
|
|
32
|
-
* - `'use client'` denotes a Client Module.
|
|
33
32
|
* - `'use server'` denotes a Server Functions Module.
|
|
33
|
+
* - `'use client'` denotes a Client Module.
|
|
34
34
|
* - `'use agnostic'` denotes an Agnostic Module (formerly Shared Module).
|
|
35
35
|
* @param {AST} ast The module's AST (Abstract Syntax Tree).
|
|
36
36
|
* @returns The directive, or lack thereof via `null`. The lack of a directive is considered server-by-default.
|
|
@@ -64,8 +64,8 @@ export const getDirectiveFromModule = (ast) => {
|
|
|
64
64
|
/**
|
|
65
65
|
* Gets the directive of the current module.
|
|
66
66
|
* - `null` denotes a server-by-default module, ideally a Server Module.
|
|
67
|
-
* - `'use client'` denotes a Client Module.
|
|
68
67
|
* - `'use server'` denotes a Server Functions Module.
|
|
68
|
+
* - `'use client'` denotes a Client Module.
|
|
69
69
|
* - `'use agnostic'` denotes an Agnostic Module (formerly Shared Module).
|
|
70
70
|
* @param {Context} context The ESLint rule's `context` object.
|
|
71
71
|
* @returns The directive, or lack thereof via `null`. The lack of a directive is considered server-by-default.
|
|
@@ -81,10 +81,10 @@ export const getDirectiveFromCurrentModule = (context) => {
|
|
|
81
81
|
|
|
82
82
|
/**
|
|
83
83
|
* Gets the directive of the imported module.
|
|
84
|
-
* - `
|
|
84
|
+
* - `null` denotes a server-by-default module, ideally a Server Module.
|
|
85
85
|
* - `'use server'` denotes a Server Functions Module.
|
|
86
|
+
* - `'use client'` denotes a Client Module.
|
|
86
87
|
* - `'use agnostic'` denotes an Agnostic Module (formerly Shared Module).
|
|
87
|
-
* - `null` denotes a server-by-default module, ideally a Server Module.
|
|
88
88
|
* @param {string} resolvedPath The resolved path of the imported module.
|
|
89
89
|
* @returns The directive, or lack thereof via `null`. The lack of a directive is considered server-by-default.
|
|
90
90
|
*/
|
|
@@ -169,189 +169,189 @@ export const makeBlockedImport = (
|
|
|
169
169
|
|
|
170
170
|
export const commentedDirectives_blockedImports = Object.freeze({
|
|
171
171
|
[USE_SERVER_LOGICS]: Object.freeze([
|
|
172
|
-
// USE_SERVER_LOGICS allowed, because
|
|
172
|
+
// USE_SERVER_LOGICS allowed, because Prime Server Logics can compose with one another.
|
|
173
173
|
makeBlockedImport(
|
|
174
174
|
USE_SERVER_LOGICS,
|
|
175
175
|
USE_CLIENT_LOGICS
|
|
176
|
-
) /*
|
|
177
|
-
// USE_AGNOSTIC_LOGICS allowed, because
|
|
178
|
-
// USE_SERVER_COMPONENTS allowed, because
|
|
176
|
+
) /* Prime Client Logics should never leak to the server, such as would be the case here in a Prime Server Logics Module. */,
|
|
177
|
+
// USE_AGNOSTIC_LOGICS allowed, because Prime Agnostic Logics can run safely on the server just like they can on the client, such as is the case here in a Prime Server Logics Module.
|
|
178
|
+
// USE_SERVER_COMPONENTS allowed, because Lineal Server Components are OK to be composed with Prime Server Logics as long as the Prime Server Logics Module, by convention, does not export React components.
|
|
179
179
|
makeBlockedImport(
|
|
180
180
|
USE_SERVER_LOGICS,
|
|
181
181
|
USE_CLIENT_COMPONENTS
|
|
182
|
-
) /*
|
|
183
|
-
// USE_AGNOSTIC_COMPONENTS allowed, because
|
|
184
|
-
// USE_SERVER_FUNCTIONS allowed, because
|
|
182
|
+
) /* Lineal Client Components, like any Client Components, cannot be tinkered with on the server. */,
|
|
183
|
+
// USE_AGNOSTIC_COMPONENTS allowed, because Lineal Agnostic Components can be composed with any Prime Environment Logics agnostically, such as Prime Server Logics, as long as the Prime Environment Logics Module, by convention, does not export React components.
|
|
184
|
+
// USE_SERVER_FUNCTIONS allowed, because (Special) Server Functions, being able to import one another, can compose and do so via Prime Server Logics, despite this method seeming superfluous at first glance. (Perhaps a preferrable use case for this has been found or could be found either today or in the future.)
|
|
185
185
|
makeBlockedImport(
|
|
186
186
|
USE_SERVER_LOGICS,
|
|
187
187
|
USE_CLIENT_CONTEXTS
|
|
188
|
-
) /*
|
|
189
|
-
// USE_AGNOSTIC_CONDITIONS allowed, because
|
|
188
|
+
) /* Client Contexts Components, like any Client Components, cannot be tinkered with on the server. */,
|
|
189
|
+
// USE_AGNOSTIC_CONDITIONS allowed, because (Special) Agnostic Conditions Components are able to safely render on the server, guaranteeing that only their `ComponentForServer` will be effectively involved in Prime Server Logics Modules.
|
|
190
190
|
]),
|
|
191
191
|
[USE_CLIENT_LOGICS]: Object.freeze([
|
|
192
192
|
makeBlockedImport(
|
|
193
193
|
USE_CLIENT_LOGICS,
|
|
194
194
|
USE_SERVER_LOGICS
|
|
195
|
-
) /*
|
|
196
|
-
// USE_CLIENT_LOGICS allowed, because
|
|
197
|
-
// USE_AGNOSTIC_LOGICS allowed, because
|
|
195
|
+
) /* Prime Server Logics should never leak to the client, such as would be the case here in a Prime Client Logics Module. */,
|
|
196
|
+
// USE_CLIENT_LOGICS allowed, because Prime Client Logics can compose with one another.
|
|
197
|
+
// USE_AGNOSTIC_LOGICS allowed, because Prime Agnostic Logics can run safely on the client just like they can on the server, such as is the case here in a Prime Client Logics Module.
|
|
198
198
|
makeBlockedImport(
|
|
199
199
|
USE_CLIENT_LOGICS,
|
|
200
200
|
USE_SERVER_COMPONENTS
|
|
201
|
-
) /*
|
|
202
|
-
// USE_CLIENT_COMPONENTS allowed, because
|
|
203
|
-
// USE_AGNOSTIC_COMPONENTS allowed, because
|
|
204
|
-
// USE_SERVER_FUNCTIONS allowed, because
|
|
205
|
-
// USE_CLIENT_CONTEXTS allowed, because
|
|
206
|
-
// USE_AGNOSTIC_CONDITIONS allowed, because
|
|
201
|
+
) /* Lineal Server Components cannot be thinkered with on the client. */,
|
|
202
|
+
// USE_CLIENT_COMPONENTS allowed, because Lineal Client Components, like any Client Components, are OK to be composed with Prime Client Logics as long as the Prime Client Logics Module, by convention, does not export React components.
|
|
203
|
+
// USE_AGNOSTIC_COMPONENTS allowed, because Lineal Agnostic Components can be composed with any Prime Environment Logics agnostically, such as Prime Client Logics, as long as the Prime Environment Logics Module, by convention, does not export React components.
|
|
204
|
+
// USE_SERVER_FUNCTIONS allowed, because (Special) Server Functions can technically be attached to Client Components that are being tinkered with within Client Logics Modules.
|
|
205
|
+
// USE_CLIENT_CONTEXTS allowed, because (Special) Client Contexts Components, like any Client Components, are OK to be composed with Prime Client Logics as long as the Prime Client Logics Module, by convention, does not export React components.
|
|
206
|
+
// USE_AGNOSTIC_CONDITIONS allowed, because (Special) Agnostic Conditions Components are able to safely render on the client, guaranteeing that only their `ComponentForClient` will be effectively involved in Prime Client Logics Modules.
|
|
207
207
|
]),
|
|
208
208
|
[USE_AGNOSTIC_LOGICS]: Object.freeze([
|
|
209
209
|
makeBlockedImport(
|
|
210
210
|
USE_AGNOSTIC_LOGICS,
|
|
211
211
|
USE_SERVER_LOGICS
|
|
212
|
-
) /*
|
|
212
|
+
) /* Prime Server Logics cannot run on both the server and the client, such as would be the case here in a Prime Agnostic Logics Module. */,
|
|
213
213
|
makeBlockedImport(
|
|
214
214
|
USE_AGNOSTIC_LOGICS,
|
|
215
215
|
USE_CLIENT_LOGICS
|
|
216
|
-
) /*
|
|
217
|
-
// USE_AGNOSTIC_LOGICS allowed, because
|
|
216
|
+
) /* Prime Client Logics cannot run on both the server and the client, such as would be the case here in a Prime Agnostic Logics Module. */,
|
|
217
|
+
// USE_AGNOSTIC_LOGICS allowed, because Prime Agnostic Logics can compose with one another.
|
|
218
218
|
makeBlockedImport(
|
|
219
219
|
USE_AGNOSTIC_LOGICS,
|
|
220
220
|
USE_SERVER_COMPONENTS
|
|
221
|
-
) /*
|
|
221
|
+
) /* Lineal Server Components cannot be tinkered with on both the server and the client. */,
|
|
222
222
|
makeBlockedImport(
|
|
223
223
|
USE_AGNOSTIC_LOGICS,
|
|
224
224
|
USE_CLIENT_COMPONENTS
|
|
225
|
-
) /*
|
|
226
|
-
// USE_AGNOSTIC_COMPONENTS allowed, because
|
|
225
|
+
) /* Lineal Client Components, like any Client Components, cannot be tinkered with on both the server and the client. */,
|
|
226
|
+
// USE_AGNOSTIC_COMPONENTS allowed, because Lineal Agnostic Components can be composed with any Prime Environment Logics agnostically, such as Prime Agnostic Logics, as long as the Prime Environment Logics Module, by convention, does not export React components.
|
|
227
227
|
makeBlockedImport(
|
|
228
228
|
USE_AGNOSTIC_LOGICS,
|
|
229
229
|
USE_SERVER_FUNCTIONS
|
|
230
|
-
) /*
|
|
230
|
+
) /* (Special) Server Functions can be modified on the server and on the client, but their use cases on both environments are not one-to-one compatible, since they're being addressed as they are on the server and addressed as references on the client. */,
|
|
231
231
|
makeBlockedImport(
|
|
232
232
|
USE_AGNOSTIC_LOGICS,
|
|
233
233
|
USE_CLIENT_CONTEXTS
|
|
234
|
-
) /*
|
|
235
|
-
// USE_AGNOSTIC_CONDITIONS allowed, because
|
|
234
|
+
) /* (Special) Client Contexts Components, like any Client Components, cannot be tinkered with on both the server and the client. */,
|
|
235
|
+
// USE_AGNOSTIC_CONDITIONS allowed, because (Special) Agnostic Conditions Components, as if they were Lineal Agnostic Components themselves, can be composed with any Prime Environment Logics agnostically as long as the Prime Environment Logics Module, by convention, does not export React components.
|
|
236
236
|
]),
|
|
237
237
|
[USE_SERVER_COMPONENTS]: Object.freeze([
|
|
238
|
-
// USE_SERVER_LOGICS allowed, because
|
|
238
|
+
// USE_SERVER_LOGICS allowed, because Prime Server Logics, being logic from the server, can safely support Lineal Server Components.
|
|
239
239
|
makeBlockedImport(
|
|
240
240
|
USE_SERVER_COMPONENTS,
|
|
241
241
|
USE_CLIENT_LOGICS
|
|
242
|
-
) /*
|
|
243
|
-
// USE_AGNOSTIC_LOGICS allowed, because
|
|
244
|
-
// USE_SERVER_COMPONENTS allowed, because
|
|
245
|
-
// USE_CLIENT_COMPONENTS allowed, because
|
|
246
|
-
// USE_AGNOSTIC_COMPONENTS allowed, because
|
|
247
|
-
// USE_SERVER_FUNCTIONS allowed, because
|
|
248
|
-
// USE_CLIENT_CONTEXTS allowed, because
|
|
249
|
-
// USE_AGNOSTIC_CONDITIONS allowed, because
|
|
242
|
+
) /* Prime Client Logics should never leak to the server, such as would be the case here in a Lineal Server Components Module. */,
|
|
243
|
+
// USE_AGNOSTIC_LOGICS allowed, because Prime Agnostic Logics can run safely on the server just like they can on the client, such as is the case here in a Lineal Server Components Module.
|
|
244
|
+
// USE_SERVER_COMPONENTS allowed, because Lineal Server Components can compose with one another, now that thanks to the inclusion of Agnostic Components they are actual Server Components.
|
|
245
|
+
// USE_CLIENT_COMPONENTS allowed, because Lineal Client Components can be nested inside Server Components to create client boundaries when the root of the application is planted on the server.
|
|
246
|
+
// USE_AGNOSTIC_COMPONENTS allowed, because Lineal Agnostic Components can render safely on the server just like they can on the client.
|
|
247
|
+
// USE_SERVER_FUNCTIONS allowed, because (Special) Server Functions can be passed to imported Client Components within Lineal Server Components Modules, even though indeed Lineal Server Components Modules and Lineal Server Components can make their own Server Functions through inline 'use server' directives.
|
|
248
|
+
// USE_CLIENT_CONTEXTS allowed, because (Special) Client Contexts Components can be nested inside Server Components to wrap some of the tree with client state accessible through child Client Components, and to pass through Server Components when the root of the application is planted on the server.
|
|
249
|
+
// USE_AGNOSTIC_CONDITIONS allowed, because (Special) Agnostic Conditions Components, as if they were Lineal Agnostic Components themselves, can render safely on the server just like they can on the client.
|
|
250
250
|
]),
|
|
251
251
|
[USE_CLIENT_COMPONENTS]: Object.freeze([
|
|
252
252
|
makeBlockedImport(
|
|
253
253
|
USE_CLIENT_COMPONENTS,
|
|
254
254
|
USE_SERVER_LOGICS
|
|
255
|
-
) /*
|
|
256
|
-
// USE_CLIENT_LOGICS allowed, because
|
|
257
|
-
// USE_AGNOSTIC_LOGICS allowed, because
|
|
255
|
+
) /* Prime Server Logics should never leak to the client, such as would be the case here in a Lineal Client Components Module. */,
|
|
256
|
+
// USE_CLIENT_LOGICS allowed, because Prime Client Logics, being logic from the client, can safely support Lineal Client Components, like any Client Components.
|
|
257
|
+
// USE_AGNOSTIC_LOGICS allowed, because Prime Agnostic Logics can run safely on the client just like they can on the server, such as is the case here in a Lineal Client Components Module.
|
|
258
258
|
makeBlockedImport(
|
|
259
259
|
USE_CLIENT_COMPONENTS,
|
|
260
260
|
USE_SERVER_COMPONENTS
|
|
261
|
-
) /*
|
|
262
|
-
// USE_CLIENT_COMPONENTS allowed, because
|
|
263
|
-
// USE_AGNOSTIC_COMPONENTS allowed, because
|
|
264
|
-
// USE_SERVER_FUNCTIONS allowed, because
|
|
265
|
-
// USE_CLIENT_CONTEXTS allowed, because
|
|
266
|
-
// USE_AGNOSTIC_CONDITIONS allowed, because
|
|
261
|
+
) /* Lineal Server Components cannot be the children of Lineal Client Components. */,
|
|
262
|
+
// USE_CLIENT_COMPONENTS allowed, because Lineal Client Components can compose with one another.
|
|
263
|
+
// USE_AGNOSTIC_COMPONENTS allowed, because Lineal Agnostic Components can render safely on the client just like they can on the server, such as is the case here in a Lineal Client Components Module.
|
|
264
|
+
// USE_SERVER_FUNCTIONS allowed, because (Special) Server Functions are specifically triggered by Client Components, such as is the case here in a Lineal Client Components Module.
|
|
265
|
+
// USE_CLIENT_CONTEXTS allowed, because (Special) Client Contexts Components can effectively become Lineal and only render their children on the client via this mechanism since, by a Client Contexts Component being the child of a Lineal Client Component, the Client Contexts Component's children become the grand-children of an ancestor Lineal Client Component, enforcing them to render exclusively on the client.
|
|
266
|
+
// USE_AGNOSTIC_CONDITIONS allowed, because (Special) Agnostic Conditions Components, as if they were Lineal Agnostic Components themselves, can render safely on the client just like they can on the server.
|
|
267
267
|
]),
|
|
268
268
|
[USE_AGNOSTIC_COMPONENTS]: Object.freeze([
|
|
269
269
|
makeBlockedImport(
|
|
270
270
|
USE_AGNOSTIC_COMPONENTS,
|
|
271
271
|
USE_SERVER_LOGICS
|
|
272
|
-
) /*
|
|
272
|
+
) /* Prime Server Logics cannot run on both the server and the client, such as would be the case here in a Lineal Agnostic Components Module. */,
|
|
273
273
|
makeBlockedImport(
|
|
274
274
|
USE_AGNOSTIC_COMPONENTS,
|
|
275
275
|
USE_CLIENT_LOGICS
|
|
276
|
-
) /*
|
|
277
|
-
// USE_AGNOSTIC_LOGICS allowed, because
|
|
276
|
+
) /* Prime Client Logics cannot run on both the server and the client, such as would be the case here in a Lineal Agnostic Components Module. */,
|
|
277
|
+
// USE_AGNOSTIC_LOGICS allowed, because Prime Agnostic Logics, being environment-agnostic logic, can safely support Agnostic Components.
|
|
278
278
|
makeBlockedImport(
|
|
279
279
|
USE_AGNOSTIC_COMPONENTS,
|
|
280
280
|
USE_SERVER_COMPONENTS
|
|
281
|
-
) /*
|
|
282
|
-
// USE_CLIENT_COMPONENTS allowed, because
|
|
283
|
-
// USE_AGNOSTIC_COMPONENTS allowed, because
|
|
284
|
-
// USE_SERVER_FUNCTIONS allowed, because
|
|
285
|
-
// USE_CLIENT_CONTEXTS allowed, because
|
|
286
|
-
// USE_AGNOSTIC_CONDITIONS allowed, because
|
|
281
|
+
) /* Lineal Server Components, unlike Lineal Client Components, cannot make silos of their own once on the opposing environment (the client in this case), and therefore cannot be executed from the client, making them unable to execute agnostically from both the server and the client. */,
|
|
282
|
+
// USE_CLIENT_COMPONENTS allowed, because Lineal Client Components can be nested inside Agnostic Components to create client boundaries when the root of the application is planted on the server.
|
|
283
|
+
// USE_AGNOSTIC_COMPONENTS allowed, because Lineal Agnostic Components, can compose with one another.
|
|
284
|
+
// USE_SERVER_FUNCTIONS allowed, because (Special) Server Functions can be passed to Client Components as props when Client Components are also legally imported into Agnostic Components Modules.
|
|
285
|
+
// USE_CLIENT_CONTEXTS allowed, because (Special) Client Contexts Components can be nested inside Agnostic Components to wrap some of the tree with client state accessible through child Client Components, and to pass through Server Components (if still on the Server Tree) when the root of the application is planted on the server.
|
|
286
|
+
// USE_AGNOSTIC_CONDITIONS allowed, because (Special) Agnostic Conditions Components can compose with Lineal Agnostic Components as if they were Lineal Agnostic Components themselves, making them a necessary mechanism for Server Components to be nested in Agnostic Components.
|
|
287
287
|
]),
|
|
288
288
|
[USE_SERVER_FUNCTIONS]: Object.freeze([
|
|
289
|
-
// USE_SERVER_LOGICS allowed, because
|
|
289
|
+
// USE_SERVER_LOGICS allowed, because Prime Server Logics, being logic from the server, can safely support (Special) Server Functions.
|
|
290
290
|
makeBlockedImport(
|
|
291
291
|
USE_SERVER_FUNCTIONS,
|
|
292
292
|
USE_CLIENT_LOGICS
|
|
293
|
-
) /*
|
|
294
|
-
// USE_AGNOSTIC_LOGICS allowed, because
|
|
293
|
+
) /* Prime Client Logics should never leak to the server, such as would be the case here in a Special Server Functions Module. */,
|
|
294
|
+
// USE_AGNOSTIC_LOGICS allowed, because Prime Agnostic Logics can run safely on the server just like they can on the client, such as is the case here in a Special Server Functions Module.
|
|
295
295
|
makeBlockedImport(
|
|
296
296
|
USE_SERVER_FUNCTIONS,
|
|
297
297
|
USE_SERVER_COMPONENTS
|
|
298
|
-
) /*
|
|
298
|
+
) /* Lineal Server Components aren't allowed because (Special) Server Functions have no business working with React Components. */,
|
|
299
299
|
makeBlockedImport(
|
|
300
300
|
USE_SERVER_FUNCTIONS,
|
|
301
301
|
USE_CLIENT_COMPONENTS
|
|
302
|
-
) /*
|
|
302
|
+
) /* Lineal Client Components aren't allowed because (Special) Server Functions have no business working with React Components. */,
|
|
303
303
|
makeBlockedImport(
|
|
304
304
|
USE_SERVER_FUNCTIONS,
|
|
305
305
|
USE_AGNOSTIC_COMPONENTS
|
|
306
|
-
) /*
|
|
307
|
-
// USE_SERVER_FUNCTIONS allowed, because
|
|
306
|
+
) /* Lineal Agnostic Components aren't allowed because (Special) Server Functions have no business working with React Components. */,
|
|
307
|
+
// USE_SERVER_FUNCTIONS allowed, because (Special) Server Functions, even though they don't need to import one another and the same results can be generated via Prime Server Logics for the outcome of a single Server Function, can still compose with one another. (Perhaps a preferrable use case for this has been found or could be found either today or in the future.)
|
|
308
308
|
makeBlockedImport(
|
|
309
309
|
USE_SERVER_FUNCTIONS,
|
|
310
310
|
USE_CLIENT_CONTEXTS
|
|
311
|
-
) /*
|
|
311
|
+
) /* (Special) Client Contexts Components aren't allowed because (Special) Server Functions have no business working with React Components. */,
|
|
312
312
|
makeBlockedImport(
|
|
313
313
|
USE_SERVER_FUNCTIONS,
|
|
314
314
|
USE_AGNOSTIC_CONDITIONS
|
|
315
|
-
) /*
|
|
315
|
+
) /* (Special) Agnostic Conditions Components aren't allowed because (Special) Server Functions have no business working with React Components. */,
|
|
316
316
|
]),
|
|
317
317
|
[USE_CLIENT_CONTEXTS]: Object.freeze([
|
|
318
318
|
makeBlockedImport(
|
|
319
319
|
USE_CLIENT_CONTEXTS,
|
|
320
320
|
USE_SERVER_LOGICS
|
|
321
|
-
) /*
|
|
322
|
-
// USE_CLIENT_LOGICS allowed, because
|
|
323
|
-
// USE_AGNOSTIC_LOGICS allowed, because
|
|
321
|
+
) /* Prime Server Logics should never leak to the client, such as would be the case here in a Special Client Contexts Module. */,
|
|
322
|
+
// USE_CLIENT_LOGICS allowed, because Prime Client Logics, being logic from the client, can safely support (Special) Client Contexts Components, like any Client Components.
|
|
323
|
+
// USE_AGNOSTIC_LOGICS allowed, because Prime Agnostic Logics can run safely on the client just like they can on the server, such as is the case here in a Special Client Contexts Module.
|
|
324
324
|
makeBlockedImport(
|
|
325
325
|
USE_CLIENT_CONTEXTS,
|
|
326
326
|
USE_SERVER_COMPONENTS
|
|
327
|
-
) /*
|
|
328
|
-
// USE_CLIENT_COMPONENTS allowed, because
|
|
329
|
-
// USE_AGNOSTIC_COMPONENTS allowed, because
|
|
330
|
-
// USE_SERVER_FUNCTIONS allowed, because
|
|
331
|
-
// USE_CLIENT_CONTEXTS allowed, because
|
|
332
|
-
// USE_AGNOSTIC_CONDITIONS allowed, because
|
|
327
|
+
) /* Lineal Server Components may only pass through (Special) Client Contexts Components via the children prop within Server Components Modules. */,
|
|
328
|
+
// USE_CLIENT_COMPONENTS allowed, because Lineal Client Components can create client boundaries within (Special) Client Contexts Components.
|
|
329
|
+
// USE_AGNOSTIC_COMPONENTS allowed, because Lineal Agnostic Components can render safely on the client just like they can on the server, such as is the case here in a Special Client Contexts Module.
|
|
330
|
+
// USE_SERVER_FUNCTIONS allowed, because (Special) Server Functions are specifically triggered by Client Components, such as is the case here in a Special Client Contexts Module.
|
|
331
|
+
// USE_CLIENT_CONTEXTS allowed, because (Special) Client Contexts Components can compose with one another.
|
|
332
|
+
// USE_AGNOSTIC_CONDITIONS allowed, because (Special) Agnostic Conditions Components, as if they were Lineal Agnostic Components themselves, can render safely on the client just like they can on the server, in a mechanism that allows (Special) Client Contexts Components to safely and indirectly compose with child Server Components within Client Contexts Modules.
|
|
333
333
|
]),
|
|
334
334
|
[USE_AGNOSTIC_CONDITIONS]: Object.freeze([
|
|
335
335
|
makeBlockedImport(
|
|
336
336
|
USE_AGNOSTIC_CONDITIONS,
|
|
337
337
|
USE_SERVER_LOGICS
|
|
338
|
-
) /*
|
|
338
|
+
) /* Prime Server Logics cannot run on both the server and the client, such as would be the case here in a Special Agnostic Conditions Module. */,
|
|
339
339
|
makeBlockedImport(
|
|
340
340
|
USE_AGNOSTIC_CONDITIONS,
|
|
341
341
|
USE_CLIENT_LOGICS
|
|
342
|
-
) /*
|
|
343
|
-
// USE_AGNOSTIC_LOGICS allowed, because
|
|
344
|
-
// USE_SERVER_COMPONENTS allowed, because
|
|
345
|
-
// USE_CLIENT_COMPONENTS allowed, because
|
|
346
|
-
// USE_AGNOSTIC_COMPONENTS allowed, because
|
|
342
|
+
) /* Prime Client Logics cannot run on both the server and the client, such as would be the case here in a Special Agnostic Conditions Module. */,
|
|
343
|
+
// USE_AGNOSTIC_LOGICS allowed, because Prime Agnostic Logics, being environment-agnostic logic, can safely support Agnostic Components, including (Special) Agnostic Conditions Components. (In this case this is necessary for the import of the `conditionAgnosticComponent` function needed to make Agnostic Conditions Components.)
|
|
344
|
+
// USE_SERVER_COMPONENTS allowed, because Lineal Server Components are to be paired as `ComponentForServer` components with `ComponentForClient` components to form (Special) Agnostic Conditions Components.
|
|
345
|
+
// USE_CLIENT_COMPONENTS allowed, because Lineal Client Components are to be paired as `ComponentForClient` components with `ComponentForServer` components to form (Special) Agnostic Conditions Components.
|
|
346
|
+
// USE_AGNOSTIC_COMPONENTS allowed, because Lineal Agnostic Components can take the place of `ComponentForServer` and/or `ComponentForClient` components to form (Special) Agnostic Conditions Components.
|
|
347
347
|
makeBlockedImport(
|
|
348
348
|
USE_AGNOSTIC_CONDITIONS,
|
|
349
349
|
USE_SERVER_FUNCTIONS
|
|
350
|
-
) /*
|
|
350
|
+
) /* (Special) Server Functions are not accepted because (Special) Agnostic Conditions Components only take finite, imported components as arguments in their making. As such, assigning props to these components, including Server Functions, is not made within Agnostic Conditions Modules. */,
|
|
351
351
|
makeBlockedImport(
|
|
352
352
|
USE_AGNOSTIC_CONDITIONS,
|
|
353
353
|
USE_CLIENT_CONTEXTS
|
|
354
|
-
) /*
|
|
355
|
-
// USE_AGNOSTIC_CONDITIONS allowed, because
|
|
354
|
+
) /* (Special) Client Contexts Components cannot be used as component arguments for (Special) Agnostic Conditions Components since they only take Lineal Components as arguments in their making. */,
|
|
355
|
+
// USE_AGNOSTIC_CONDITIONS allowed, because (Special) Agnostic Conditions Components, despite not being Lineal Components themselves, output components that can only be Lineal and compatible with their attributed rendering environments, making them acceptable arguments in the making of Agnostic Conditions Components.
|
|
356
356
|
]),
|
|
357
357
|
});
|
|
@@ -78,7 +78,6 @@ const stripDoubleQuotes = (string) => {
|
|
|
78
78
|
* - `'use server components'`, `"use server components"` denoting a Server Components Module.
|
|
79
79
|
* - `'use client components'`, `"use client components"` denoting a Client Components Module.
|
|
80
80
|
* - `'use agnostic components'`, `"use agnostic components"` denoting an Agnostic Components Module.
|
|
81
|
-
* - `'use agnostic logics'`, `"use agnostic logics"` denoting an Agnostic Logics Module.
|
|
82
81
|
* - `'use server functions'`, `"use server functions"` denoting a Server Functions Module.
|
|
83
82
|
* - `'use client contexts'`, `"use client contexts"` denoting a Client Contexts Module.
|
|
84
83
|
* - `'use agnostic conditions'`, `"use agnostic conditions"` denoting an Agnostic Conditions Module.
|
|
@@ -137,7 +136,6 @@ export const getCommentedDirectiveFromSourceCode = (sourceCode) => {
|
|
|
137
136
|
* - `'use server components'`, `"use server components"` denoting a Server Components Module.
|
|
138
137
|
* - `'use client components'`, `"use client components"` denoting a Client Components Module.
|
|
139
138
|
* - `'use agnostic components'`, `"use agnostic components"` denoting an Agnostic Components Module.
|
|
140
|
-
* - `'use agnostic logics'`, `"use agnostic logics"` denoting an Agnostic Logics Module.
|
|
141
139
|
* - `'use server functions'`, `"use server functions"` denoting a Server Functions Module.
|
|
142
140
|
* - `'use client contexts'`, `"use client contexts"` denoting a Client Contexts Module.
|
|
143
141
|
* - `'use agnostic conditions'`, `"use agnostic conditions"` denoting an Agnostic Conditions Module.
|
|
@@ -164,7 +162,6 @@ export const getCommentedDirectiveFromCurrentModule = (context) => {
|
|
|
164
162
|
* - `'use server components'`, `"use server components"` denoting a Server Components Module.
|
|
165
163
|
* - `'use client components'`, `"use client components"` denoting a Client Components Module.
|
|
166
164
|
* - `'use agnostic components'`, `"use agnostic components"` denoting an Agnostic Components Module.
|
|
167
|
-
* - `'use agnostic logics'`, `"use agnostic logics"` denoting an Agnostic Logics Module.
|
|
168
165
|
* - `'use server functions'`, `"use server functions"` denoting a Server Functions Module.
|
|
169
166
|
* - `'use client contexts'`, `"use client contexts"` denoting a Client Contexts Module.
|
|
170
167
|
* - `'use agnostic conditions'`, `"use agnostic conditions"` denoting an Agnostic Conditions Module.
|