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
Copy file name to clipboardexpand all lines: README.md
+41
Original file line number
Diff line number
Diff line change
@@ -137,9 +137,50 @@ enableReactOptimization(); // just makes it a but faster
137
137
## Serialize API
138
138
139
139
Use it to separate generation of styles lookup from your runtime.
140
+
140
141
It is useful in cases, where you can't directly use Discovery APIs on your client CSS bundles during app's runtime, e.g. various serverless runtimes.
141
142
Also it may be useful for you, if you want to save on the size of your container for the server app, since it allows you to only load styles lookup into it, without CSS bundles.
142
143
144
+
1.`serializeStylesLookup(def: StyleDef): SerializedStyleDef` - creates a serializable object from original styles lookup. Result can be then stringified with `JSON.stringify`
145
+
2.`loadSerializedLookup(def: SerializedStyleDef): StyleDef` - transforms serialized style definition back to normal `StyleDef`, which can be used with any Scanner API
146
+
147
+
### Example
148
+
149
+
#### During your build
150
+
151
+
1. Add separate script to generate style lookup and store it as you like.
0 commit comments