Revert startup performance PRs #2930 and #2931 - #2933
Conversation
This reverts commit 5a7cc93. The startup work is being consolidated into a single PR for review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
| const disabledMap = settings.value.pluginsDisabled || {}; | ||
| if (helpers.isIapAvailable()) { | ||
| iapPurchases = await helpers.promisify(iap.getPurchases); | ||
| const disabledMap = settings.value.pluginsDisabled || {}; |
There was a problem hiding this comment.
Owned plugins list crashes When a signed-in user opens Owned plugins on a device where IAP is unavailable, an installed plugin reaches
disabledMap[plugin.id]. The map is now declared inside the IAP-only block, so this throws a ReferenceError and stops the list from rendering.
Knowledge Base Used: Plugin lifecycle and extension management
|
|
||
| window.ANDROID_SDK_INT = androidSdkInt; | ||
| try { | ||
| await helpers.promisify(iap.startConnection).catch((e) => { |
There was a problem hiding this comment.
Billing can block startup If Play Billing is slow or never calls back, startup waits for its connection and purchase checks before calling
loadApp(). Neither await has a timeout, and the ten-second warning only changes the message, so the editor is delayed or never opens.
Knowledge Base Used: Startup orchestration
| if (isPro) { | ||
| config.HAS_PRO = true; | ||
| } else { | ||
| config.HAS_PRO = !isFreePackage; |
There was a problem hiding this comment.
Confirmed Pro purchase not cached When startup finds a Pro purchase on a free build, it sets
HAS_PRO but no longer saves the result in localStorage.acode_pro. If that user next launches offline, startup skips the purchase lookup and starts without Pro, locking paid features and allowing ads.
Knowledge Base Used: Application bootstrap and runtime composition
| value: true, | ||
| }, | ||
| ]).catch(() => null); | ||
| ]); |
There was a problem hiding this comment.
| } | ||
|
|
||
| invalidateKeymap(); | ||
| rebuildKeymap(); |
There was a problem hiding this comment.
Command bursts repeat keymap work Each external command registration now rebuilds the full keymap, and the subsequent refresh immediately reconfigures each affected editor pane. A plugin registering many commands repeats that work for every command instead of sharing one rebuild and dispatch, adding avoidable startup work.
Knowledge Base Used: Application bootstrap and runtime composition
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| import { openTabContextMenuOnRelease } from "handlers/tabContextMenu"; | ||
| import tag from "html-tag-js"; | ||
| import quickToolsAdapters from "lib/quickToolsAdapter"; | ||
| import mimeTypes from "mime-types"; |
There was a problem hiding this comment.
Preview dependencies load at startup
editorFile is loaded during startup, so its static mime-types and run imports also pull in the MIME database and preview dependencies before either feature is used. This increases the initial bundle and the work needed to open the editor.
Knowledge Base Used: Startup orchestration
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| add(...(await import("./files")).default); | ||
| add(...(await import("./searchInFiles")).default); | ||
| add(...(await import("./extensions")).default); | ||
| add(...(await import("./notification")).default); | ||
| setSponsorSidebarAppVisibility(appSettings.value.showSponsorSidebarApp); |
There was a problem hiding this comment.
Sidebar chunks load sequentially Each sidebar import now starts only after the previous one finishes. These four independent chunks are loaded during workspace setup, so their load times add up instead of overlapping, delaying startup.
Knowledge Base Used: Startup orchestration
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| } | ||
| } | ||
|
|
||
| export async function initEncodings() { |
There was a problem hiding this comment.
Encoding lookup delays every launch Removing the cache makes
initEncodings() request the encoding list through the native bridge every time. Because startup now awaits it before beginning independent storage and device setup, every launch pays for that round trip before other initialization can proceed.
Knowledge Base Used: Startup orchestration
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| }; | ||
|
|
||
| if (validate && !validateThemeExtensions(key, theme.getExtension())) { | ||
| if (!validateThemeExtensions(key, theme.getExtension())) { |
There was a problem hiding this comment.
Bundled themes slow module loading Bundled themes now use
addTheme, which constructs a CodeMirror state to validate each theme as the module loads. Doing this for every bundled theme before the workspace starts adds synchronous startup work even when those themes are not selected.
Knowledge Base Used: Startup orchestration
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Reverts #2931 and #2930, which were merged together. The startup work goes back into a single PR for review before anything lands on
main.3e2e0ab4(feat: review button in plugin page (#2925)), the commit before both PRs.The consolidated startup PR is stacked on this branch and retargets to
mainonce this merges.🤖 Generated with Claude Code