Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(): Support easy serialization of custom properties #10071

Merged
merged 7 commits into from
Aug 16, 2024

Conversation

asturur
Copy link
Member

@asturur asturur commented Aug 16, 2024

Description

There is a lot of feedback about easyness serialization of custom properties.
This PR adds a static property to fabricObject where you can store the name of the custom ( or non custom but not exported ) properties you would like to be exported regadless.

In Action

Copy link

codesandbox bot commented Aug 16, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@asturur asturur changed the title feat(): Support easy serialization of customer properties feat(): Support easy serialization of custom properties Aug 16, 2024
Copy link
Contributor

github-actions bot commented Aug 16, 2024

Build Stats

file / KB (diff) bundled minified
fabric 920.728 (+0.161) 306.754 (-0.156)

Copy link
Contributor

Coverage after merging support-custom-prop-serialization into master will be

85.19%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
index.node.ts14.29%100%0%25%23, 26, 29, 41, 44, 47
extensions/aligning_guidelines/util
   basic.ts100%100%100%100%
src
   ClassRegistry.ts91.18%64.29%100%97.92%35, 56
   Collection.ts78.71%44.62%87.10%86.21%130, 153, 155–157, 159, 169–170, 181, 197, 217, 228, 241, 243, 252, 254, 265, 270, 279, 281, 286–287, 302, 304, 309–310, 329, 333–334, 338–344, 346–348, 350
   CommonMethods.ts91.43%71.43%100%96%50, 52
   Intersection.ts85.25%48.91%100%97.30%184–188, 190, 228, 237, 239, 289, 297, 297
   Observable.ts80.63%53.49%93.75%87.88%144, 153, 156, 168, 170, 175, 68–70, 72, 76, 80, 84–85, 87–91
   Point.ts90.53%62%100%93.90%104, 117, 148, 157, 179, 197, 206, 216, 225, 236–239, 259, 285, 297, 328, 341, 349, 359, 95
   Shadow.ts89.21%78.26%100%90%140, 143, 145–150, 159, 196, 199, 206, 223–230, 234–235
   cache.ts84.88%45.45%100%90.14%57, 59, 71–72, 74–77
   config.ts87.73%55%66.67%94.03%132, 134–137, 139, 142–143, 147, 152
   constants.ts100%100%100%100%
src/LayoutManager
   ActiveSelectionLayoutManager.ts93.33%76.92%85.71%100%
   LayoutManager.ts90.75%65.48%76.92%99.31%279, 344, 355
   constants.ts100%100%100%100%
   index.ts48.57%37.50%80%66.67%1, 1, 1–2, 2, 2–3, 3, 3–4, 4, 4–5, 5, 5, 5–6
   types.ts100%100%100%100%
src/LayoutManager/LayoutStrategies
   ClipPathLayout.ts75%56.25%100%78.95%39, 41–44, 46–48, 66–69
   FitContentLayout.ts100%100%100%100%
   FixedLayout.ts85.71%20%100%100%23, 23
   LayoutStrategy.ts87.60%57.14%100%96.51%46, 54, 73, 73, 75
   utils.ts72.58%50%100%78.72%29–32, 34–35, 40–44
src/Pattern
   Pattern.ts67.50%88.57%80%63.08%105–107, 114, 118–119, 119–122, 130–138, 140–141, 143, 153–164, 174, 176–181, 183–188, 190–199, 203–206, 209–210, 212–214, 216–218, 218–221, 33, 37
src/brushes
   BaseBrush.ts89.33%91.67%100%88.55%110, 115, 124–125, 130, 135, 143, 146, 155–160, 99
   CircleBrush.ts52.10%12.50%12.50%58.25%100–108, 108–118, 122, 130–139, 55, 67, 69, 76, 76, 78–79, 79, 83, 85–86, 92–98
   PatternBrush.ts97.06%87.50%100%100%21
   PencilBrush.ts91.06%82.35%100%93.81%122–123, 152, 152–154, 176, 176, 276, 280, 285–286, 68–69, 84–85
   SprayBrush.ts0%0%0%0%107, 107, 107, 107, 107–108, 110–111, 118–119, 121, 123–127, 136, 140–141, 141, 148, 148, 148–151, 153–156, 160–161, 163, 165–168, 17, 171, 178–179, 18, 181, 183–184, 186, 193–194, 196–197, 20, 200, 200, 207, 207, 21, 211, 22, 22, 22–24, 28, 32, 39, 46, 53, 60, 67, 84–86, 94–96, 98–99
src/canvas
   Canvas.ts75.43%39.53%92.86%84.95%1000, 1005, 1009, 1013–1014, 1019, 1064–1069, 1106, 1127, 1129, 1131, 1138, 1141, 1204–1208, 1287–1291, 1318, 1335, 1381–1398, 1404–1409, 1412–1413, 1415, 1419, 1421–1422, 1424–1426, 1430, 1432, 1434–1436, 1439–1444, 1447–1449, 1452, 1454, 1468, 1475, 1477–1488, 1490–1493, 1493–1494, 1496–1497, 1501–1502, 1505–1506, 1509–1511, 1514, 329, 354, 370, 389, 444, 560–564, 567–568, 570, 580, 583–584, 586, 589–591, 603, 610–614, 616–621, 623–627, 660, 662, 669–673, 675–680, 682, 684–685, 687–690, 692–693, 748, 784–787, 790, 792, 795, 797, 799, 825, 887–888, 933–934, 936–937, 939, 948–954, 957, 965–971, 973, 975, 996–997
   CanvasOptions.ts100%100%100%100%
   SelectableCanvas.ts85.45%54.22%100%94.39%1006, 1008–1009, 1026, 1035, 1103–1107, 1153–1154, 1156–1157, 1159, 1186, 1188–1189, 1189, 1191, 1233, 1235, 1237, 1253, 1255, 1283, 1286, 1329–1336, 1339, 1342, 1351–1352, 1356–1365, 1369, 1371–1372, 1378–1383, 1387, 340–342, 346, 376, 398, 476, 527, 529, 605, 610, 687, 715
   StaticCanvas.ts75.74%69.11%98.91%75.38%1000, 1006, 1009, 1011, 1013, 1021, 1023–1029, 1039, 1042, 1045–1051, 1053–1054, 1056–1077, 1084–1086, 1088, 1096, 1102, 1104, 1104–1105, 1105–1106, 1108, 1108–1113, 1126, 1131–1133, 1137, 1141, 1143, 1145, 1150–1154, 1156, 1158–1161, 1164, 1166, 1175, 1177–1178, 1185–1188, 1190, 1196–1199, 1203–1204, 1214, 1220–1222, 1224–1229, 1229, 1229–1233, 1233, 1233–1238, 1240–1247, 1276–1277, 1279–1284, 1286–1292, 1296, 1298–1311, 1319–1320, 1330, 1341, 1382–1386, 1388, 1390, 1392–1396, 1415, 1431, 1448, 1468, 1501, 1505, 1516–1518, 425, 436,

@asturur asturur merged commit d39b667 into master Aug 16, 2024
20 checks passed
@asturur asturur deleted the support-custom-prop-serialization branch August 16, 2024 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant