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: render embeds lazily #7519

Merged
merged 3 commits into from
Jan 4, 2024
Merged

feat: render embeds lazily #7519

merged 3 commits into from
Jan 4, 2024

Conversation

dwelle
Copy link
Member

@dwelle dwelle commented Jan 4, 2024

This PR makes embeddables render lazily, not rendering them until they first appear in viewport.

Pros:

  • faster init load and less traffic in cases where you don't land on canvas where all embeds are immediately visible, or you never even scroll to all the embeds on canvas in a session

Cons:

  • Slower initially-visible-to-rendered transition
  • in cases where preloading all embeds if desirable (e.g. presentations), this is a deoptimization

If the cons prove too bad, we could investigate hybrid solution to improve both the above while keeping (some of) the benefits.

/cc @zsviczian

Copy link

vercel bot commented Jan 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
excalidraw ✅ Ready (Inspect) Visit Preview Jan 4, 2024 4:12pm
excalidraw-package-example ✅ Ready (Inspect) Visit Preview Jan 4, 2024 4:12pm
1 Ignored Deployment
Name Status Preview Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Jan 4, 2024 4:12pm

Copy link

github-actions bot commented Jan 4, 2024

Coverage Report

Status Category Percentage Covered / Total
🔴 Lines 65.02% / 70% 44868 / 69005
🔴 Statements 65.02% / 70% 44868 / 69005
🔴 Functions 66.07% / 68% 1367 / 2069
🟢 Branches 79.9% / 70% 5540 / 6933
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
packages/excalidraw/components/App.tsx 68.53% 75.07% 68.5% 68.53% 447-448, 627-628, 646-647, 667-727, 730-736, 739-742, 745-821, 824-843, 851-862, 864-865, 870-871, 875-877, 896-1150, 1210-1211, 1222-1223, 1250-1255, 1265-1309, 1335, 1345, 1352-1355, 1390-1391, 1471-1477, 1482-1496, 1500-1546, 1614-1619, 1648-1653, 1656-1686, 1694-1719, 1722-1731, 1734-1847, 1850-1858, 1867-1880, 1883-1909, 1912-1983, 1986-2026, 2072-2073, 2091-2092, 2129-2130, 2134-2135, 2151-2158, 2163-2176, 2182-2183, 2188-2196, 2198-2206, 2218, 2258-2259, 2281-2282, 2289, 2350-2352, 2355-2360, 2365-2366, 2401-2409, 2414-2423, 2461-2462, 2545-2546, 2550, 2553-2554, 2562-2565, 2574-2587, 2593-2596, 2599, 2601-2602, 2609-2610, 2616-2617, 2625-2626, 2629-2630, 2633-2636, 2639-2642, 2653-2661, 2666-2667, 2723-2724, 2738-2744, 2750-2758, 2762-2770, 2774-2775, 2778-2811, 2814-2826, 2837-2838, 2849-2850, 2867-2871, 2875-2878, 2885-2887, 2905-2912, 2915, 2917-2922, 2926-2928, 2949-2950, 2957-2959, 2961-2984, 3010, 3016, 3055-3056, 3073-3075, 3097-3098, 3104-3107, 3113-3188, 3260-3261, 3266-3269, 3332, 3342-3360, 3363-3369, 3372-3373, 3379-3392, 3478-3479, 3481-3482, 3487-3489, 3497-3498, 3521-3535, 3540-3559, 3582-3583, 3616-3618, 3643, 3662-3666, 3677-3678, 3681-3685, 3687-3688, 3690-3693, 3718-3719, 3728-3730, 3732, 3807-3810, 3832-3834, 3844-3845, 3847-3867, 3870-3876, 3893-3896, 3902-3905, 3915-3922, 3926-3927, 3932, 3960-3964, 3968, 3973-3974, 3979-3983, 4015-4016, 4019-4020, 4028-4032, 4036-4046, 4051-4078, 4083-4094, 4153, 4179-4180, 4271, 4448-4449, 4452-4453, 4461, 4473, 4475-4476, 4517-4521, 4572-4578, 4584-4647, 4690, 4739, 4765, 4772-4773, 4782-4785, 4815, 4863-4866, 4869-4875, 4877-4880, 4895-4904, 4907-4908, 4989-4990, 4993, 4995-4996, 5002-5004, 5006, 5015, 5037-5042, 5044-5047, 5051-5052, 5062-5149, 5152-5153, 5167-5168, 5219-5220, 5247-5248, 5281-5307, 5314-5315, 5337-5338, 5357, 5359-5402, 5407-5408, 5410-5411, 5427-5428, 5434-5435, 5439-5442, 5445-5446, 5461-5488, 5496-5497, 5501-5504, 5506-5510, 5571-5576, 5578-5580, 5596, 5598-5609, 5634-5637, 5695-5696, 5698-5721, 5736-5737, 5849-5877, 5942-5946, 5969-5970, 5990-5991, 6085, 6091-6092, 6115-6134, 6149, 6282, 6304-6345, 6349-6400, 6415, 6424, 6458-6464, 6479-6481, 6623-6627, 6651-6685, 6698, 6700-6707, 6721, 6723-6730, 6737-6740, 6748-6753, 6776-6777, 6780-6781, 6786-6788, 6791-6792, 6817-6818, 6846-6847, 6929-6930, 6979-6992, 7052-7055, 7081-7082, 7113-7114, 7127, 7145-7151, 7158-7161, 7184-7189, 7260-7263, 7269, 7284-7291, 7294-7301, 7358, 7432-7433, 7453-7455, 7458, 7472-7496, 7602-7621, 7631-7670, 7683-7684, 7693-7700, 7714-7726, 7739-7744, 7800-7828, 7830-7831, 7905-7909, 7916, 7918-7954, 7983, 8033, 8052-8054, 8079-8084, 8086-8087, 8092-8123, 8126-8150, 8164-8165, 8171-8180, 8185, 8189-8193, 8202-8206, 8209-8214, 8218-8225, 8255, 8257-8261, 8263-8273, 8289-8291, 8302-8310, 8314-8350, 8353-8424, 8432, 8450-8457, 8459-8475, 8490-8512, 8531-8533, 8578-8579, 8609-8610, 8626, 8703-8706, 8708-8724, 8726-8730, 8742-8743, 8753-8769, 8803-8804, 8808-8820, 8830, 8832-8835, 8837-8838, 8878, 8899-8900, 8926, 8929, 8969, 8983-8990, 9007-9008, 9040-9043, 9132-9139, 9165-9166, 9207-9261, 9305-9306, 9315-9318, 9323-9324, 9345-9347, 9349-9353, 9391
Generated in workflow #1557

@dwelle dwelle merged commit 8b993d4 into master Jan 4, 2024
8 checks passed
@dwelle dwelle deleted the dwelle/embed-lazy branch January 4, 2024 18:03
dwelle added a commit to dwelle/excalidraw that referenced this pull request Jan 4, 2024
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.

None yet

1 participant