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

Custom Editor: Initial Experiment #39373

Closed
wants to merge 3 commits into from
Closed

Custom Editor: Initial Experiment #39373

wants to merge 3 commits into from

Conversation

ockham
Copy link
Contributor

@ockham ockham commented Feb 11, 2020

Changes proposed in this Pull Request

Take two of #36771.

For context, see pbAok1-dh-p2#comment-589

I'm customizing apiFetch, based on D37093-code. This might be generic enough to make sense across Calypso -- all apiFetch requests made there should go through the WP.com proxy, change the root to public-api.wordpress.com, add /sites/123456, etc.

TODO

Testing instructions

Go to http://calypso.localhost:3000/custom-editor

cc @Automattic/cylon

@ockham ockham added [Feature] Post/Page Editor The editor for editing posts and pages. [Status] In Progress [Goal] Gutenberg Working towards full integration with Gutenberg labels Feb 11, 2020
@ockham ockham self-assigned this Feb 11, 2020
@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

matticbot commented Feb 11, 2020

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Webpack Runtime (~31149 bytes added 📈 [gzipped])

name      parsed_size         gzip_size
manifest    +173670 B  (new)   +31149 B  (new)

Webpack runtime for loading modules. It is included in the HTML page as an inline script. Is downloaded and parsed every time the app is loaded.

App Entrypoints (~2517811 bytes added 📈 [gzipped])

name                   parsed_size         gzip_size
entry-gutenboarding     +2795417 B  (new)  +730992 B  (new)
entry-custom-editor     +2392587 B  (new)  +606171 B  (new)
entry-main              +1477483 B  (new)  +376204 B  (new)
entry-jetpack-cloud     +1430190 B  (new)  +364636 B  (new)
entry-login              +999972 B  (new)  +270915 B  (new)
entry-domains-landing    +615253 B  (new)  +168893 B  (new)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~6005357 bytes added 📈 [gzipped])

name                      parsed_size         gzip_size
woocommerce                +2062311 B  (new)  +548520 B  (new)
post-editor                +1891030 B  (new)  +521012 B  (new)
checkout                   +1339586 B  (new)  +329358 B  (new)
purchases                   +973738 B  (new)  +231505 B  (new)
domains                     +881325 B  (new)  +202578 B  (new)
gutenberg-editor            +836457 B  (new)  +224725 B  (new)
stats                       +812967 B  (new)  +203450 B  (new)
settings                    +529788 B  (new)  +137933 B  (new)
comments                    +521003 B  (new)  +122261 B  (new)
jetpack-connect             +519488 B  (new)  +136573 B  (new)
activity                    +474413 B  (new)  +120957 B  (new)
help                        +459365 B  (new)  +114461 B  (new)
plugins                     +456532 B  (new)  +117848 B  (new)
reader                      +445156 B  (new)  +116883 B  (new)
settings-writing            +444511 B  (new)  +113158 B  (new)
plans                       +439874 B  (new)  +116006 B  (new)
marketing                   +427498 B  (new)  +107629 B  (new)
security                    +408316 B  (new)  +106323 B  (new)
media                       +374299 B  (new)  +100987 B  (new)
people                      +363820 B  (new)   +93510 B  (new)
themes                      +362894 B  (new)   +96671 B  (new)
concierge                   +311455 B  (new)   +76312 B  (new)
posts                       +309367 B  (new)   +81836 B  (new)
posts-custom                +307055 B  (new)   +81164 B  (new)
notification-settings       +304209 B  (new)   +76996 B  (new)
account                     +299387 B  (new)   +80234 B  (new)
email                       +296374 B  (new)   +78790 B  (new)
zoninator                   +287350 B  (new)   +79642 B  (new)
theme                       +287194 B  (new)   +77096 B  (new)
account-close               +277759 B  (new)   +74364 B  (new)
earn                        +275333 B  (new)   +70797 B  (new)
settings-security           +273990 B  (new)   +73660 B  (new)
google-my-business          +273857 B  (new)   +76847 B  (new)
home                        +271289 B  (new)   +73575 B  (new)
checklist                   +266117 B  (new)   +71581 B  (new)
site-blocks                 +265164 B  (new)   +70459 B  (new)
accept-invite               +256681 B  (new)   +68186 B  (new)
happychat                   +243201 B  (new)   +66129 B  (new)
wp-super-cache              +233180 B  (new)   +60737 B  (new)
pages                       +228375 B  (new)   +62727 B  (new)
privacy                     +223822 B  (new)   +60003 B  (new)
hosting                     +221705 B  (new)   +60845 B  (new)
settings-performance        +219337 B  (new)   +60170 B  (new)
import                      +218023 B  (new)   +58266 B  (new)
me                          +216115 B  (new)   +57837 B  (new)
customize                   +187060 B  (new)   +53044 B  (new)
export                      +185114 B  (new)   +50677 B  (new)
settings-discussion         +181169 B  (new)   +47990 B  (new)
feature-upsell              +158367 B  (new)   +39603 B  (new)
signup                      +157954 B  (new)   +39310 B  (new)
devdocs                     +149589 B  (new)   +40324 B  (new)
migrate                     +149315 B  (new)   +40871 B  (new)
hello-dolly                 +110516 B  (new)   +31741 B  (new)
preview                     +107615 B  (new)   +30978 B  (new)
sensei                      +106138 B  (new)   +30206 B  (new)
sites                       +101551 B  (new)   +28983 B  (new)
auth                         +17693 B  (new)    +5212 B  (new)
domain-connect-authorize     +12726 B  (new)    +3637 B  (new)
mailing-lists                 +6547 B  (new)    +1873 B  (new)
root                           +454 B  (new)     +307 B  (new)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Async-loaded Components (~2654497 bytes added 📈 [gzipped])

name                                                         parsed_size         gzip_size
async-load-design-blocks                                      +2765775 B  (new)  +647738 B  (new)
async-load-design                                             +1784758 B  (new)  +411319 B  (new)
async-load-design-playground                                  +1705836 B  (new)  +390734 B  (new)
async-load-components-web-preview-component                    +391558 B  (new)  +101196 B  (new)
async-load-my-sites-site-settings-seo-settings-form            +280423 B  (new)   +74661 B  (new)
async-load-post-editor-media-modal                             +268512 B  (new)   +71864 B  (new)
async-load-blocks-calendar-popover                             +239927 B  (new)   +46664 B  (new)
async-load-blocks-inline-help-popover                          +236551 B  (new)   +57365 B  (new)
async-load-signup-steps-domains                                +219441 B  (new)   +52949 B  (new)
async-load-signup-steps-plans                                  +154422 B  (new)   +40890 B  (new)
async-load-signup-steps-clone-point                            +151409 B  (new)   +35119 B  (new)
async-load-my-sites-checklist-wpcom-checklist-component-jsx    +143440 B  (new)   +36148 B  (new)
async-load-emoji-text                                          +128902 B  (new)   +22496 B  (new)
async-load-apps-notifications-index-jsx                        +117816 B  (new)   +34548 B  (new)
async-load-signup-steps-user                                   +113813 B  (new)   +29994 B  (new)
async-load-reader-following-manage                             +109277 B  (new)   +28953 B  (new)
async-load-signup-steps-plans-atomic-store                      +98536 B  (new)   +25902 B  (new)
async-load-layout-guided-tours-component                        +94133 B  (new)   +20297 B  (new)
async-load-blocks-support-article-dialog-dialog                 +84851 B  (new)   +24788 B  (new)
async-load-reader-search-stream                                 +83149 B  (new)   +21668 B  (new)
async-load-blocks-inline-help                                   +62960 B  (new)   +14842 B  (new)
async-load-lib-happychat-connection                             +61513 B  (new)   +17530 B  (new)
async-load-reader-sidebar                                       +55151 B  (new)   +14237 B  (new)
async-load-signup-steps-theme-selection                         +54276 B  (new)   +13690 B  (new)
async-load-my-sites-current-site-domain-warnings                +53425 B  (new)   +13243 B  (new)
async-load-signup-steps-about                                   +45985 B  (new)   +12690 B  (new)
async-load-my-sites-current-site-notice                         +45221 B  (new)   +10878 B  (new)
async-load-signup-steps-clone-credentials                       +43472 B  (new)   +11378 B  (new)
async-load-extensions-woocommerce-app-store-stats               +42860 B  (new)   +12145 B  (new)
async-load-extensions-woocommerce-app-store-stats-referrers     +42148 B  (new)   +11678 B  (new)
async-load-blocks-product-purchase-features-list                +41564 B  (new)    +9682 B  (new)
async-load-blocks-reader-full-post                              +40865 B  (new)   +11051 B  (new)
async-load-my-sites-current-site-stale-cart-items-notice        +40720 B  (new)   +11470 B  (new)
async-load-signup-steps-rewind-form-creds                       +38093 B  (new)   +10215 B  (new)
async-load-layout-guided-tours                                  +36261 B  (new)   +10017 B  (new)
async-load-components-happychat                                 +34609 B  (new)   +11062 B  (new)
async-load-signup-steps-import-url-onboarding                   +30278 B  (new)    +8815 B  (new)
async-load-signup-steps-site-style                              +29570 B  (new)    +9831 B  (new)
async-load-quick-language-switcher                              +28775 B  (new)    +8361 B  (new)
async-load-signup-steps-site-topic                              +27622 B  (new)    +7921 B  (new)
async-load-signup-steps-clone-ready                             +27542 B  (new)    +7622 B  (new)
async-load-post-editor-editor-sharing-accordion                 +25481 B  (new)    +6586 B  (new)
async-load-reader-site-stream                                   +24548 B  (new)    +6806 B  (new)
async-load-reader-feed-stream                                   +24452 B  (new)    +6746 B  (new)
async-load-signup-steps-passwordless                            +24343 B  (new)    +5983 B  (new)
async-load-signup-steps-rewind-migrate                          +24316 B  (new)    +6794 B  (new)
async-load-signup-steps-site                                    +24299 B  (new)    +6197 B  (new)
async-load-components-jetpack-header-inmotion                   +24215 B  (new)    +7229 B  (new)
async-load-signup-steps-creds-confirm                           +22755 B  (new)    +6320 B  (new)
async-load-my-sites-guided-transfer                             +22751 B  (new)    +5557 B  (new)
async-load-signup-steps-creds-permission                        +22629 B  (new)    +6336 B  (new)
async-load-layout-nps-survey-notice                             +22328 B  (new)    +5756 B  (new)
async-load-signup-steps-import-preview                          +20778 B  (new)    +6262 B  (new)
async-load-blocks-jitm-templates-sidebar-banner                 +20161 B  (new)    +6194 B  (new)
async-load-signup-steps-import-url                              +20013 B  (new)    +5665 B  (new)
async-load-signup-steps-site-or-domain                          +19256 B  (new)    +5466 B  (new)
async-load-layout-masterbar-drafts-popover                      +18920 B  (new)    +5794 B  (new)
async-load-blocks-jitm-templates-default                        +18511 B  (new)    +5860 B  (new)
async-load-components-jetpack-header-dreamhost                  +18500 B  (new)    +5587 B  (new)
async-load-layout-community-translator-launcher                 +18258 B  (new)    +5895 B  (new)
async-load-post-editor-editor-author                            +18105 B  (new)    +5220 B  (new)
async-load-signup-steps-clone-destination                       +17875 B  (new)    +4906 B  (new)
async-load-components-jetpack-header-pressable                  +17373 B  (new)    +5313 B  (new)
async-load-lib-preferences-helper                               +16925 B  (new)    +4957 B  (new)
async-load-signup-steps-survey                                  +16569 B  (new)    +4392 B  (new)
async-load-components-jetpack-header-liquidweb                  +16478 B  (new)    +5788 B  (new)
async-load-extensions-woocommerce-app-store-stats-listview      +15665 B  (new)    +4485 B  (new)
async-load-reader-tag-stream-main                               +15574 B  (new)    +4728 B  (new)
async-load-signup-steps-clone-start                             +14076 B  (new)    +4092 B  (new)
async-load-signup-steps-clone-cloning                           +13597 B  (new)    +3968 B  (new)
async-load-signup-steps-rebrand-cities-welcome                  +13001 B  (new)    +3600 B  (new)
async-load-post-editor-editor-location                          +12717 B  (new)    +3803 B  (new)
async-load-components-jetpack-header-bluehost                   +11588 B  (new)    +3361 B  (new)
async-load-signup-steps-reader-landing                          +11449 B  (new)    +3133 B  (new)
async-load-signup-steps-site-type                               +11301 B  (new)    +3173 B  (new)
async-load-signup-steps-site-title                              +11120 B  (new)    +3069 B  (new)
async-load-signup-steps-clone-jetpack                           +10379 B  (new)    +2808 B  (new)
async-load-reader-list-stream                                   +10316 B  (new)    +3013 B  (new)
async-load-components-jetpack-header-eurodns                     +9892 B  (new)    +2476 B  (new)
async-load-signup-steps-site-picker                              +8997 B  (new)    +2611 B  (new)
async-load-lib-abtest-test-helper                                +8982 B  (new)    +3072 B  (new)
async-load-signup-steps-rewind-were-backing                      +8677 B  (new)    +2570 B  (new)
async-load-post-editor-editor-seo-accordion                      +8657 B  (new)    +2795 B  (new)
async-load-signup-steps-creds-complete                           +8632 B  (new)    +2583 B  (new)
async-load-blocks-app-banner                                     +8222 B  (new)    +2909 B  (new)
async-load-components-community-translator                       +8120 B  (new)    +2567 B  (new)
async-load-signup-steps-test-step                                +7944 B  (new)    +2314 B  (new)
async-load-components-signup-site-preview-component              +7206 B  (new)    +2257 B  (new)
async-load-blocks-product-plan-overlap-notices                   +6418 B  (new)    +2037 B  (new)
async-load-components-jetpack-header-woocommerce                 +5609 B  (new)    +1444 B  (new)
async-load-docs-selectors                                        +5591 B  (new)    +1763 B  (new)
async-load-design-typography                                     +5509 B  (new)    +1686 B  (new)
async-load-post-editor-editor-post-formats-accordion             +5212 B  (new)    +1748 B  (new)
async-load-blocks-inline-help-dialog                             +4974 B  (new)    +1961 B  (new)
async-load-post-editor-editor-discussion                         +4950 B  (new)    +1590 B  (new)
async-load-blocks-jitm                                           +4647 B  (new)    +1708 B  (new)
async-load-reader-conversations-stream                           +4448 B  (new)    +1633 B  (new)
async-load-lib-network-connection                                +4116 B  (new)    +1532 B  (new)
async-load-blocks-login-social-connect-prompt                    +3919 B  (new)    +1347 B  (new)
async-load-featured-image                                        +2912 B  (new)    +1036 B  (new)
async-load-components-webpack-build-monitor                      +2552 B  (new)    +1130 B  (new)
async-load-blocks-legal-updates-banner                           +2485 B  (new)    +1063 B  (new)
async-load-blocks-support-article-dialog                         +1021 B  (new)     +448 B  (new)
async-load-blocks-jitm-templates-notice                           +642 B  (new)     +391 B  (new)
async-load-components-jetpack-header-milesweb                     +628 B  (new)     +408 B  (new)
async-load-signup-steps-launch-site                               +586 B  (new)     +357 B  (new)
async-load-lib-rubberband-scroll-disable                          +487 B  (new)     +303 B  (new)
async-load-reader-team-main                                       +370 B  (new)     +265 B  (new)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

Moment.js Locales (~108669 bytes added 📈 [gzipped])

name                    parsed_size         gzip_size
moment-locale-ru            +4547 B  (new)    +1606 B  (new)
moment-locale-mr            +3437 B  (new)    +1275 B  (new)
moment-locale-bo            +3250 B  (new)    +1074 B  (new)
moment-locale-uk            +3242 B  (new)    +1435 B  (new)
moment-locale-ta            +3026 B  (new)    +1165 B  (new)
moment-locale-be            +2949 B  (new)    +1290 B  (new)
moment-locale-cs            +2882 B  (new)    +1170 B  (new)
moment-locale-ka            +2756 B  (new)     +995 B  (new)
moment-locale-kn            +2755 B  (new)    +1150 B  (new)
moment-locale-ar            +2663 B  (new)    +1186 B  (new)
moment-locale-ne            +2577 B  (new)    +1108 B  (new)
moment-locale-sr-cyrl       +2518 B  (new)    +1091 B  (new)
moment-locale-ar-ly         +2506 B  (new)    +1111 B  (new)
moment-locale-gu            +2505 B  (new)    +1089 B  (new)
moment-locale-el            +2484 B  (new)    +1220 B  (new)
moment-locale-bn            +2473 B  (new)    +1051 B  (new)
moment-locale-sl            +2462 B  (new)     +993 B  (new)
moment-locale-pa-in         +2461 B  (new)    +1022 B  (new)
moment-locale-ml            +2405 B  (new)     +959 B  (new)
moment-locale-hi            +2371 B  (new)    +1077 B  (new)
moment-locale-ug-cn         +2366 B  (new)    +1020 B  (new)
moment-locale-km            +2322 B  (new)    +1010 B  (new)
moment-locale-lt            +2320 B  (new)    +1102 B  (new)
moment-locale-te            +2287 B  (new)     +959 B  (new)
moment-locale-es-us         +2209 B  (new)     +945 B  (new)
moment-locale-es-do         +2209 B  (new)     +946 B  (new)
moment-locale-es            +2192 B  (new)     +940 B  (new)
moment-locale-mn            +2187 B  (new)     +971 B  (new)
moment-locale-sk            +2150 B  (new)     +933 B  (new)
moment-locale-tlh           +2143 B  (new)     +891 B  (new)
moment-locale-my            +2140 B  (new)     +938 B  (new)
moment-locale-hy-am         +2137 B  (new)     +966 B  (new)
moment-locale-hr            +2125 B  (new)     +940 B  (new)
moment-locale-th            +2107 B  (new)     +860 B  (new)
moment-locale-ku            +2091 B  (new)     +976 B  (new)
moment-locale-pl            +2067 B  (new)     +995 B  (new)
moment-locale-si            +2060 B  (new)     +863 B  (new)
moment-locale-tg            +2053 B  (new)     +981 B  (new)
moment-locale-me            +2045 B  (new)     +957 B  (new)
moment-locale-lo            +2044 B  (new)     +812 B  (new)
moment-locale-fa            +2038 B  (new)     +940 B  (new)
moment-locale-sr            +2027 B  (new)     +952 B  (new)
moment-locale-hu            +2018 B  (new)     +932 B  (new)
moment-locale-nl-be         +2002 B  (new)     +940 B  (new)
moment-locale-nl            +1993 B  (new)     +937 B  (new)
moment-locale-fi            +1982 B  (new)     +894 B  (new)
moment-locale-bs            +1975 B  (new)     +877 B  (new)
moment-locale-gom-latn      +1967 B  (new)     +962 B  (new)
moment-locale-he            +1940 B  (new)     +879 B  (new)
moment-locale-ar-sa         +1932 B  (new)     +921 B  (new)
moment-locale-is            +1925 B  (new)     +897 B  (new)
moment-locale-lv            +1895 B  (new)     +849 B  (new)
moment-locale-ca            +1823 B  (new)     +857 B  (new)
moment-locale-tzm           +1821 B  (new)     +653 B  (new)
moment-locale-lb            +1812 B  (new)     +942 B  (new)
moment-locale-ky            +1773 B  (new)     +892 B  (new)
moment-locale-kk            +1762 B  (new)     +875 B  (new)
moment-locale-zh-cn         +1759 B  (new)     +922 B  (new)
moment-locale-az            +1758 B  (new)     +914 B  (new)
moment-locale-zh-tw         +1757 B  (new)     +907 B  (new)
moment-locale-zh-hk         +1752 B  (new)     +908 B  (new)
moment-locale-mk            +1750 B  (new)     +910 B  (new)
moment-locale-bg            +1730 B  (new)     +915 B  (new)
moment-locale-cv            +1693 B  (new)     +813 B  (new)
moment-locale-tzl           +1637 B  (new)     +869 B  (new)
moment-locale-dv            +1574 B  (new)     +818 B  (new)
moment-locale-br            +1548 B  (new)     +837 B  (new)
moment-locale-x-pseudo      +1533 B  (new)     +852 B  (new)
moment-locale-ja            +1533 B  (new)     +771 B  (new)
moment-locale-vi            +1532 B  (new)     +771 B  (new)
moment-locale-ss            +1519 B  (new)     +805 B  (new)
moment-locale-gl            +1519 B  (new)     +738 B  (new)
moment-locale-et            +1498 B  (new)     +768 B  (new)
moment-locale-tr            +1487 B  (new)     +799 B  (new)
moment-locale-ko            +1483 B  (new)     +733 B  (new)
moment-locale-mi            +1478 B  (new)     +749 B  (new)
moment-locale-de-at         +1471 B  (new)     +760 B  (new)
moment-locale-de-ch         +1462 B  (new)     +744 B  (new)
moment-locale-de            +1460 B  (new)     +753 B  (new)
moment-locale-ar-dz         +1451 B  (new)     +686 B  (new)
moment-locale-ar-tn         +1435 B  (new)     +680 B  (new)
moment-locale-ar-ma         +1432 B  (new)     +682 B  (new)
moment-locale-ar-kw         +1432 B  (new)     +681 B  (new)
moment-locale-uz            +1431 B  (new)     +710 B  (new)
moment-locale-cy            +1419 B  (new)     +761 B  (new)
moment-locale-jv            +1415 B  (new)     +738 B  (new)
moment-locale-fy            +1411 B  (new)     +769 B  (new)
moment-locale-yo            +1402 B  (new)     +705 B  (new)
moment-locale-fr            +1388 B  (new)     +727 B  (new)
moment-locale-gd            +1377 B  (new)     +755 B  (new)
moment-locale-eu            +1377 B  (new)     +692 B  (new)
moment-locale-fr-ch         +1373 B  (new)     +724 B  (new)
moment-locale-ms-my         +1372 B  (new)     +722 B  (new)
moment-locale-ms            +1363 B  (new)     +719 B  (new)
moment-locale-ur            +1357 B  (new)     +731 B  (new)
moment-locale-sd            +1356 B  (new)     +755 B  (new)
moment-locale-fr-ca         +1354 B  (new)     +713 B  (new)
moment-locale-id            +1350 B  (new)     +718 B  (new)
moment-locale-ga            +1348 B  (new)     +735 B  (new)
moment-locale-eo            +1339 B  (new)     +734 B  (new)
moment-locale-af            +1332 B  (new)     +728 B  (new)
moment-locale-se            +1327 B  (new)     +708 B  (new)
moment-locale-pt-br         +1316 B  (new)     +702 B  (new)
moment-locale-it-ch         +1312 B  (new)     +721 B  (new)
moment-locale-pt            +1307 B  (new)     +703 B  (new)
moment-locale-it            +1303 B  (new)     +718 B  (new)
moment-locale-sq            +1292 B  (new)     +703 B  (new)
moment-locale-sv            +1282 B  (new)     +699 B  (new)
moment-locale-tet           +1263 B  (new)     +689 B  (new)
moment-locale-en-nz         +1256 B  (new)     +687 B  (new)
moment-locale-en-au         +1256 B  (new)     +686 B  (new)
moment-locale-en-SG         +1252 B  (new)     +687 B  (new)
moment-locale-en-gb         +1252 B  (new)     +686 B  (new)
moment-locale-en-ie         +1251 B  (new)     +686 B  (new)
moment-locale-bm            +1246 B  (new)     +635 B  (new)
moment-locale-en-ca         +1240 B  (new)     +675 B  (new)
moment-locale-ro            +1225 B  (new)     +713 B  (new)
moment-locale-nb            +1225 B  (new)     +645 B  (new)
moment-locale-tl-ph         +1218 B  (new)     +657 B  (new)
moment-locale-en-il         +1217 B  (new)     +667 B  (new)
moment-locale-fo            +1205 B  (new)     +660 B  (new)
moment-locale-tzm-latn      +1189 B  (new)     +566 B  (new)
moment-locale-nn            +1186 B  (new)     +641 B  (new)
moment-locale-mt            +1175 B  (new)     +679 B  (new)
moment-locale-da            +1165 B  (new)     +633 B  (new)
moment-locale-sw            +1161 B  (new)     +632 B  (new)
moment-locale-uz-latn       +1157 B  (new)     +599 B  (new)

Locale data for moment.js. Unless you are upgrading the moment.js library, changes in these chunks are suspicious.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@ockham ockham force-pushed the add/custom-edit-post branch from c5b9261 to 0790031 Compare February 18, 2020 14:38
@vindl vindl requested a review from a team February 18, 2020 22:36
@vindl
Copy link
Member

vindl commented Feb 18, 2020

From what I can see this is still going in the direction of rebuilding the editor in Calypso from components, and my understanding was that our goal is much simpler now and that we should expose whatever existing in core's wp-admin Site Editor page now (for reference pbAok1-9M-p2#comment-623).

I think the starting point should be much simpler now and consist of exposing the experimental Site Editor first in Dotcom's wp-admin (since it's hidden now) and then building up on top of that and showing it in Calypso (similar to Gutenframe). Let me know if that makes sense?

@ockham
Copy link
Contributor Author

ockham commented Feb 19, 2020

From what I can see this is still going in the direction of rebuilding the editor in Calypso from components, and my understanding was that our goal is much simpler now and that we should expose whatever existing in core's wp-admin Site Editor page now (for reference pbAok1-9M-p2#comment-623).

I think the starting point should be much simpler now and consist of exposing the experimental Site Editor first in Dotcom's wp-admin (since it's hidden now) and then building up on top of that and showing it in Calypso (similar to Gutenframe). Let me know if that makes sense?

🤷‍♂️ It makes sense; I just think we still consider different things simple and complex 😅 I was going to import edit-site into a new Calypso entrypoint for the sake of simpler developer experience: The entrypoint would allow running edit-site locally, and help us develop and iterate more quickly than if we're dealing with a full-blown wp-admin plugin (and thus, a WP install -- Dockerized, or WP.com sandbox). (We'd still be able to build a wp-admin plugin from this Calypso-integrated codebase.)

It was my impression that whatever we need to solve for edit-site to work on WP.com, we'll face pretty much the same set of problems, regardless of whether we go the wp-admin plugin, or Calypso integration route. E.g.

  • Set the correct REST API URL (see PR desc)
  • Make some customizations to parts of the edit-site component tree (that we might expose as props from the top-level component). This needs to happen in the Gutenberg repo.
  • In our custom edit-site instance, pass some args as props to the top-level component.

Am I missing any big ones? Specifically any problems that present themselves much differently in a Calypso vs wp-admin context?


I've also asked @mtias to weigh in on this question (and more generally, on pbAok1-6n-p2#comment-497 and paYE8P-jT).

@vindl
Copy link
Member

vindl commented Feb 19, 2020

It was my impression that whatever we need to solve for edit-site to work on WP.com, we'll face pretty much the same set of problems, regardless of whether we go the wp-admin plugin, or Calypso integration route. E.g.

Some of these like "Set the correct REST API URL" are already solved by existing editor integration on Dotcom, and we won't have to tackle that separately as is the case here.

I also don't think we should be building the "custom edit-site instance" any longer. That was the planned approach before, but now my understanding of the proposed direction is to just run the vanilla core site editor (which is in wp-admin natively), and extend it where necessary.

Am I missing any big ones? Specifically any problems that present themselves much differently in a Calypso vs wp-admin context?

Any initialization logic that happens in PHP will have to be replicated with this. Admittedly, there is not as much of it for site editor now as for post edit, but it might grow in the future. Gutenberg functionality also assumes full page reloads in wp-admin, and that doesn't always translate well to Calypso's multisite realm.

@@ -0,0 +1,8 @@
export const CUSTOM_EDITOR_SECTION_DEFINITION = {
name: 'custom-editor',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case we decide to proceed with this, I think this should be replaced with site-editor or similar to avoid confusion.

@noahtallen
Copy link
Contributor

Gutenberg functionality also assumes full page reloads in wp-admin

though ideally, we would work to improve this ;)

I do like the idea of going this route because it's certainly how we want to run it if everything worked in our favor. I just have a feeling that we would still run into all wp-admin issues we discussed when we talked about custom editor for pages (like theme CSS, php plugins, etc.)

But maybe it is still worth exploring this if:

  1. it doesn't really require much work to do this instead of or on top of wp-admin
  2. we can expose the actual problems we'd have instead of just guessing that we'd have the same ones we already have for the page editor

Since we'll be working closely on edit-site, maybe this is an opportunity to make sure that it's not tied to php or wp-admin as much as possible?

@vindl
Copy link
Member

vindl commented Feb 19, 2020

Since we'll be working closely on edit-site, maybe this is an opportunity to make sure that it's not tied to php or wp-admin as much as possible?

That would be great but I'm not sure if it's possible. If we are going to expose 3rd party blocks in site editor it's ultimately going to depend on related plugins being loaded in wp-admin context?

@noahtallen
Copy link
Contributor

If we are going to expose 3rd party blocks in site editor it's ultimately going to depend on related plugins being loaded in wp-admin context

Definitely. I guess it depends if those blocks are loaded over the API endpoint rather than initialized on page load via PHP. (I'd be interested in finding out how this actually works; I don't really know.)

@ockham ockham force-pushed the add/custom-edit-post branch 2 times, most recently from 229aa9c to 3822742 Compare February 25, 2020 10:58
@noahtallen
Copy link
Contributor

In our meeting yesterday, we did discover that quite a bit of bootstrapping happens in php before loading the editor. Basically, the code which looks up the templates for the editor happens in php before returning the editor page. It was suggested this could be exposed behind a core API endpoint if we wanted to do a client-side editor.

I think I still am not sure how we would expose 3rd party JS to a Calypso page. For example, the Jetpack JS/editor CSS bundles would have to be pulled in from wp-admin (same for any plugin). I'm not sure how we feel about that security-wise for 3rd party Atomic plugins, but I wonder if an endpoint could return URLs to the various JS/CSS bundles that need to be loaded into the editor.

@sirreal
Copy link
Member

sirreal commented Feb 26, 2020

Currently failing with

GET http://calypso.localhost:3000/wp/v2/types?context=edit&_locale=user 404 (Not Found)

image

which makes sense -- we need to fix the URL for WP Core REST API requests.

Is this up to date? I get a sensible 200 response from https://public-api.wordpress.com/wp/v2/sites/[SOME-SITE-ID]/types?context=edit&_locale=user&_envelope=1

@ockham
Copy link
Contributor Author

ockham commented Feb 27, 2020

Currently failing with

GET http://calypso.localhost:3000/wp/v2/types?context=edit&_locale=user 404 (Not Found)

image
which makes sense -- we need to fix the URL for WP Core REST API requests.

Is this up to date? I get a sensible 200 response from https://public-api.wordpress.com/wp/v2/sites/[SOME-SITE-ID]/types?context=edit&_locale=user&_envelope=1

Right, this should work now, per my latest couple of commits. Should've updated the PR desc -- will do now!

@ockham
Copy link
Contributor Author

ockham commented Feb 27, 2020

In our meeting yesterday, we did discover that quite a bit of bootstrapping happens in php before loading the editor. Basically, the code which looks up the templates for the editor happens in php before returning the editor page. It was suggested this could be exposed behind a core API endpoint if we wanted to do a client-side editor.

Thanks, that's valuable information 👍

I think I still am not sure how we would expose 3rd party JS to a Calypso page. For example, the Jetpack JS/editor CSS bundles would have to be pulled in from wp-admin (same for any plugin).

I think we can do that for the plugins that we provide ourselves, at least initially. (We might want to optimize against redundantly loading shared dependencies later.)

For those plugins, there are also a few other options, such as packaging them as npms, and (statically or dynamically) importing their source.

I'm not sure how we feel about that security-wise for 3rd party Atomic plugins, but I wonder if an endpoint could return URLs to the various JS/CSS bundles that need to be loaded into the editor.

I like that thinking. This might even make sense in Core (could be an extensions of a potentially existing plugin list endpoint), and we could add a filter on WP.com that only whitelists the plugins provided by us (JP, CoBlocks). Alternatively, we could concoct a blocks endpoint for core (unless that's already a thing), which could expose information such as JS and CSS bundle locations as well as block availability -- for which we have some precedent in Jetpack. I know that a block availability endpoint, and dynamic block loading mechanism has been discussed in core before.

As for security of third party plugins on Atomic sites, I still don't see any other solution but some sort of sandbox. As we're clearly not going to do that in the near term, I think that using an FSE that's built as a plugin for wp-admin is inevitable for Atomic sites 🙁

(Note to self: Still need to read p1HpG7-7po-p2 in case that's a viable alternative.)


Really appreciate your input and feedback about this exploration, @noahtallen!

@ockham ockham force-pushed the add/custom-edit-post branch from 838382b to c0db02a Compare February 27, 2020 08:33
@noahtallen
Copy link
Contributor

Note to self: Still need to read p1HpG7-7po-p2 in case that's a viable alternative

I haven't seen that! Giving it a read now. It looks promising

@ockham ockham force-pushed the add/custom-edit-post branch from c0db02a to 5082ea3 Compare March 3, 2020 16:36
@vindl
Copy link
Member

vindl commented Mar 5, 2020

We already merged the initial version of wp-admin in #39877 so I think that we can abandon this approach for now. As already discussed we can easily reuse the existing wpcom customization for Gutenberg in wp-admin (just a matter of enqueueing appropriate scripts) while this path would require us recreate a good chunk of that functionality. In wp-admin we simply rely on existing PHP initialization code that we would have to expose via API endpoints if we went for the Calypso route.

All of the above would require constant maintenance effort just to keep it running after Gutenberg plugin updates, especially since this area will be under active development in the upcoming period.

@vindl vindl closed this Mar 5, 2020
@vindl vindl deleted the add/custom-edit-post branch March 5, 2020 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Post/Page Editor The editor for editing posts and pages. [Goal] Gutenberg Working towards full integration with Gutenberg
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants