Skip to content

Commit 3f6ffef

Browse files
Add warning to mkSProxies (#77)
1 parent 2e94bff commit 3f6ffef

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Formless/Transform/Row.purs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import Formless.Internal.Transform (class Row1Cons, FromScratch, fromScratch)
99
import Formless.Types.Form (InputField(..))
1010
import Prim.Row as Row
1111
import Prim.RowList as RL
12+
import Prim.TypeError (class Warn, Text)
1213
import Record.Builder as Builder
1314
import Type.Proxy (Proxy(..))
1415

@@ -68,9 +69,13 @@ type SProxies form =
6869

6970
-- | A helper function to produce a record of SProxies given a form spec, to save
7071
-- | you the boilerplate of writing them all out.
72+
-- |
73+
-- | WARNING: This can create significant code bloat, and it is not recommended
74+
-- | for production use.
7175
mkSProxies
7276
:: forall form xs inputs row
73-
. RL.RowToList inputs xs
77+
. Warn (Text "This function is not recommended for use in production settings due to large amounts of generated code.")
78+
=> RL.RowToList inputs xs
7479
=> Newtype (form Record InputField) (Record inputs)
7580
=> MakeSProxies xs row
7681
=> Proxy form

0 commit comments

Comments
 (0)