You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Facets:** Internal function names in facets should be prefixed with `internal` if they otherwise have the same name as an external function in the same facet. Usually, there should be few or no internal functions in facets; repeat code if it improves readability.
26
-
-**Libraries:** All functions in libraries use the `internal` visibility specifier.
26
+
-**Modules:** All functions in modules use the `internal` visibility specifier.
Copy file name to clipboardExpand all lines: website/docs/design/design-for-composition.mdx
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
sidebar_position: 5
3
3
title: Design for Composition
4
-
description: How to design Compose facets and libraries for composition.
4
+
description: How to design Compose facets and modules for composition.
5
5
---
6
6
7
7
Here are the guidelines and rules for creating composable facets.
@@ -20,17 +20,17 @@ We focus on building **small, independent, and easy-to-read facets**. Each facet
20
20
6. Facets are fully self-contained. They do not import anything.
21
21
22
22
23
-
## Writing Facet Libraries
23
+
## Writing Facet Modules
24
24
25
-
1. Facet libraries are self-contained code units. They do not import anything.
26
-
2. Each facet should have one corresponding facet library.
27
-
3. Facet libraries are used to initialize facets on deployment and during upgrades.
28
-
4. Facet libraries are also used to integrate custom facets with Compose facets.
29
-
5. Facet libraries have one or more functions which are used to initialize storage variables during deployment.
25
+
1. Facet modules are self-contained code units. They do not import anything.
26
+
2. Each facet should have one corresponding facet modules.
27
+
3. Facet modules are used to initialize facets on deployment and during upgrades.
28
+
4. Facet modules are also used to integrate custom facets with Compose facets.
29
+
5. Facet modules have one or more functions which are used to initialize storage variables during deployment.
30
30
31
-
## Facets & Libraries
31
+
## Facets & Modules
32
32
33
-
1. Facets and facet libraries should not contain owner/admin authorization checks unless absolutely required or fundamental to the functionality being implemented. If permission or authorization checks are required, the facet should integrate with `OwnerFacet` or `AccessControlFacet`.
33
+
1. Facets and facet modules should not contain owner/admin authorization checks unless absolutely required or fundamental to the functionality being implemented. If permission or authorization checks are required, the facet should integrate with `OwnerFacet` or `AccessControlFacet`.
34
34
35
35
36
36
## Extending Facets
@@ -47,7 +47,7 @@ We focus on building **small, independent, and easy-to-read facets**. Each facet
47
47
9. Never add new variables to an existing struct.
48
48
49
49
:::info Important
50
-
Maintain the same order of variables in structs when reusing them across facets or libraries. Unused variables may only be removed from the end of a struct.
50
+
Maintain the same order of variables in structs when reusing them across facets or modules. Unused variables may only be removed from the end of a struct.
The `LibAccessControl` library accesses the same storage as `AccessControlFacet`, so permissions set through the facet are instantly available to your custom facets!
189
+
The `AccessControlMod` library accesses the same storage as `AccessControlFacet`, so permissions set through the facet are instantly available to your custom facets!
0 commit comments