Releases: ThisIs-Developer/Markdown-Viewer
v3.7.4
Release Notes - Markdown Viewer v3.7.4
Pleased to release Markdown Viewer v3.7.4. This release includes substantial feature additions and reliability improvements, including internationalization expansion, desktop app startup fix, export centering, re-engineered PDF page breaking, and advanced Find & Replace features.
🌐 Internationalization (i18n)
- Description: Added 9 new UI languages (expanding localization support) and synchronized desktop resources to align with language-specific menu, settings, and layout formats.
🖥️ Desktop Application
- Description: Fixed the Windows desktop application skeleton startup issue, resolving launch timing gaps and ensuring the desktop container opens reliably.
📄 HTML Export
- Description: Implemented centering alignment styles for HTML exports even when JavaScript execution is disabled in the target environment (fixes #152).
🖨️ PDF Export & Page-Break Overhauls (Fixes #166)
We completed a comprehensive rewrite of the PDF generation layout engine to guarantee professional, publication-quality document pagination:
- Layout Scaling & Preservation: Implemented a physical scaling fallback for SVG icons, large images, and layout elements, preventing them from overflowing page boundaries or creating large layout gaps.
- Mermaid.js Serialization: Serialized dynamic Mermaid diagram SVGs to static base64 images prior to PDF printing. This prevents pagination engine glitches from breaking diagrams across pages.
- MathJax Double Scaling: Prevented MathJax containers from experiencing double-scaling and synchronized page-build logic with webfont load states.
- Page-Break Safety Buffers: Resolved margin-collapse layout shifting, blockquote/callout splits, and heading keep-with-next threshold checks to ensure content splits cleanly at page boundaries.
🔗 Table of Contents (TOC) Navigation (Fixes #169)
- Smooth Scrolling: Implemented smooth dual-pane scrolling when clicking Table of Contents links—scrolling both the preview heading and the editor source line in parallel.
- Clean URLs: Explicitly intercepted TOC clicks to prevent modifying the browser's address bar hash or polluting navigation history.
🔍 Find & Replace Pane Integration (Fixes #169)
- Preview Highlighting: Integrated the Find & Replace search logic with preview-mode text node highlighting. Search keywords are highlighted in the preview container while correctly skipping structural tags, Mermaid diagrams, and MathJax containers.
- Auto-Scrolling: Matched the active match selection cycle to automatically scroll the preview container, keeping the highlighted matches in view.
- Offset/Padding Corrections: Cleaned up highlight element offsets in the editor container to solve alignment shifts.
🛠️ Commit Log Summary (v3.7.3 → v3.7.4)
| Commit | Message |
|---|---|
8ea71a8 |
Merge pull request #171 from ThisIs-Developer/fix/preview-find-scrolling-highlighting |
52316c2 |
fix(find): implement preview highlighting, auto-scrolling, and resolve editor alignment (fixes #169) |
841a184 |
Merge pull request #170 from ThisIs-Developer/fix/toc-scrolling-169 |
fc5e16f |
fix: resolve Table of Contents smooth scroll navigation (#169) |
03c7bdb |
Merge pull request #168 from ThisIs-Developer/codex/fix-pdf-page-breaks-166 |
01ba101 |
Merge pull request #167 from ThisIs-Developer/codex/fix-export-centering-sharepoint |
70915f6 |
fix(pdf): resolve blockquote alerts and nested table list splitting via safety buffer and valid list item shifting |
5043e4e |
fix(pdf): resolve blockquote callout splitting and margin-collapse pagination issues |
e94d24e |
fix(pdf): resolve margin-collapse layout shifting, keep-with-next positioning, and parent block redirection for inline images |
9afe919 |
fix(pdf): fix Mermaid svg-to-img selector target and implement heading keep-with-next threshold check |
809affc |
fix(pdf): resolve MathJax double-scaling and await webfonts loading during PDF export |
9701ff7 |
fix(pdf): enforce 20% page safety zone, wait for images, and use physical font-size scaling for pre/math blocks |
2795efa |
fix(pdf): serialize rendered Mermaid SVGs to base64 images for physical scaling and gap-less page breaks |
7e6f91b |
fix(pdf): resolve text slicing, diagram page breaks, and layout gaps (issue #166) |
aac5803 |
fix(pdf): resolve oversized graphics page gaps by physically scaling SVGs/images and resetting transient styles in cascade |
c4b41bc |
fix(pdf): fix text slicing, table pagination and page break layout overlaps (fixes #166) |
d4143f9 |
fix(pdf): fix page breaks and element scaling for PDF export (fixes #166) |
8d0f0d5 |
fix(export): support script-disabled centering for HTML exports (fixes #152) |
5835d3e |
Merge pull request #165 from ThisIs-Developer/codex/fix-windows-desktop-build |
2b15f25 |
Fix Windows desktop build skeleton startup |
bd20ef9 |
feat(i18n): add 9 new UI languages and synchronize desktop resources |
v3.7.3
Release v3.7.3
Markdown Viewer v3.7.3 — Critical rendering, export, and editor reliability fixes.
📅 Date: June 5, 2026
🔗 Full Changelog: v3.7.2...v3.7.3
🚀 What's Changed
🔧 Large Document Performance
- Re-engineered the preview rendering pipeline for large documents, eliminating render stalls and blank preview failures on large files (
9d09ca1) - Improved large document editor responsiveness with optimized input handling (
4ca8766) - Re-engineered the large preview rendering pipeline for scalable, non-blocking document rendering (
cb0c752)
📄 PDF & Export Improvements
- Improved PDF generation UX with better progress feedback and user experience (
936846b) - Fixed Mermaid diagram rendering failures in PDF export (
c55f68e) - Fixed exported document centering so exported HTML/PDF files render with proper alignment (
34741f4)
🐛 Bug Fixes
- Fixed find match scrolling — navigating between search results now correctly scrolls the matched text into view (
ee6df72) - Fixed toolbar markdown preservation — formatting actions no longer overwrite existing markdown content (
e017890)
🔄 Maintenance
- Bumped version to 3.7.3 and rotated Service Worker cache namespace (
f96bf39)
📋 Pull Requests
| PR | Title |
|---|---|
| #156 | Fix toolbar markdown preservation |
| #157 | Fix large preview engine |
| #158 | Fix find box scrolling |
| #159 | Fix export centered layout |
| #160 | Improve PDF generation UX |
📊 Stats
| Metric | Value |
|---|---|
| Commits | 9 (non-merge) |
| PRs Merged | 5 |
| Files Changed | 8 |
| Lines Added | 3,221 |
| Lines Removed | 410 |
| Net Change | +2,811 |
🗂️ Files Changed
script.js— Major rendering and editor pipeline changespreview-worker.js— New dedicated preview worker (web)desktop-app/resources/js/script.js— Desktop app syncdesktop-app/resources/js/preview-worker.js— New preview worker (desktop)styles.css— Export layout and UI styling fixessw.js— Service Worker cache rotationCHANGELOG.md— Updated changelogdesktop-app/prepare.js— Desktop build compiler update
v3.7.2
Markdown Viewer - Release Notes v3.7.2
Key Highlights
1. Robust Custom Editor History (Undo & Redo) & Document Clearing
Previously, relying on simple input updates caused loss of edit state tracking. In this release, we have built a custom, tab-aware edit history state manager:
- Undo / Redo Stack: Users can seamlessly revert or redo edits with high granularity.
- Clear Document Action: Added a dedicated "Clear Document" button in the editor toolbar, which wipes the editor pane instantly with a clean history state transition.
2. Tab Navigation & Dynamic Overflow Handling
Managing multiple open tabs on small viewports could previously wrap or push the layout off-screen.
- Relocated "New Tab" Button: Positioned strategically for better accessibility.
- Dynamic Overflow Handling: The tab list now dynamically detects space constraints and groups overflowing tabs into a clean UI structure, protecting the header layout from wrapping.
3. Mermaid.js Theme Change Transitions & Stabilization
Swapping themes (Light
- Deferred Re-rendering: Mermaid diagram rendering is now debounced and deferred to prioritize the immediate repaint of CSS color schemas.
- Synchronized Transitions: A smooth fade-in/fade-out transition occurs when diagrams redraw under the new theme.
- Original Instant Color Switching: Reverted full-page body transitions to ensure the color switches remain fast, lightweight, and responsive.
4. Layout Cleanups & Mobile Accessibility
- Mobile Direction Toggle: Removed the redundant LTR/RTL button from the mobile header, as it is already present in the formatting toolbar.
- Viewport Scroll Accessibility: Enabled window scroll on mobile viewports to allow full access to sidebar menu controls on small screens.
- Outer Scrollbar Cleanup: Fixed styling variables to remove redundant outer window scrollbars on desktop builds.
What's Changed
- fix: implement robust undo/redo history and clear document action by @ThisIs-Developer in #150
- fix(mermaid): prevent diagrams from breaking on theme change by @ThisIs-Developer in #151
- feat(tabs): relocate new tab button and implement overflow handling by @ThisIs-Developer in #153
Full Changelog: v3.7.1...v3.7.2
v3.7.1
Release Notes - Markdown Viewer v3.7.1
We are pleased to announce the release of Markdown Viewer v3.7.1. This release focuses on layout performance engineering, accessibility remediations, welcome template stabilization, and core library upgrades.
What's Changed
⚡ Performance & Layout Reflows
- Layout Coordinate Caching: Cached container layout coordinates (
leftandwidth) inside pane resizer move listeners. This eliminates forced layout calculation reflows (getBoundingClientRect) during dragging. - Scroll Sync Optimization: Implemented dimension caching variables for editor and preview scroll heights and client heights. The dimensions are updated dynamically during geometry changes and read on scroll ticks, eliminating layout thrashing and delivering stutter-free scrolling.
- Dynamic Lazy Loading: Removed
js-yaml.min.jsandFileSaver.min.jsfrom the critical bundle, reducing initial payload weight by 53KB. YAML frontmatter parsing and document exports now load these resources on demand asynchronously. - Idle Task Deferrals: Deferred non-critical initialization tasks (modals, formatting tools, panels) to decrease initial Total Blocking Time (TBT).
♿ Accessibility (a11y) Remediation
- Lighthouse Audit Fixes: Resolved multiple contrast-ratio violations by updating line-number text colors in both light and dark themes.
- Touch Target Adjustments: Expanded interactive touch-target dimensions to conform to WCAG AA guidelines.
- Tabbar ARIA Compliance: Added missing ARIA attributes and focus styles across the main navigation layout.
🐛 Onboarding & Welcome Template Fixes
- Welcome Template Stabilization: Patched
BUG-ONBOARD-001which could cause the welcome document to fail to display on a clean install. - Markdown Script Tags: Inlined default welcome markdown inside a
<script type="text/markdown">container to prevent parser interference with raw HTML elements.
📦 Dependency Upgrades
- Mermaid.js Update: Upgraded the embedded diagrams rendering library to
v11.15.0to resolve styling and layout inconsistencies.
What's Changed
- Performance, UX, and Accessibility Optimizations by @ThisIs-Developer in #134
- Performance, UX, and Accessibility Optimizations by @ThisIs-Developer in #135
- perf: cache editor layout geometry and preload styles to eliminate forced reflows by @ThisIs-Developer in #136
- perf: cache editor layout geometry and restore synchronous critical CSS by @ThisIs-Developer in #137
- fix: resolve welcome template first-run missing and new tab button duplication by @ThisIs-Developer in #138
- fix: resolve welcome template rendering and new tab button duplication bugs by @ThisIs-Developer in #139
- fix: resolve onboarding welcome template empty content bug (BUG-ONBOARD-001) by @ThisIs-Developer in #140
- perf: resolve startup forced reflows, debounce resize layout, and optimize touch targets by @ThisIs-Developer in #141
- Updated mermaid version by @bstordrup in #146
New Contributors
- @bstordrup made their first contribution in #146
Full Changelog: v3.7.0...v3.7.1
v3.7.0
Release Notes: v3.7.0
Architectural Performance Engineering Transformation & Code Modernization
This minor release marks a major architectural transition, converting a monolithic layout script with eager dependencies into a modular, asynchronous, production-certified layout engine.
⚡ Architectural Performance Engineering
- Asynchronous Dependency Engine: Replaced eager, blocking CDN includes inside the
<head>with an asynchronous script loader (loadScript()). Heavyweight optional libraries now load completely on-demand:- Mermaid (2.7 MB): Loads only when
```mermaidcode blocks are detected in content. - MathJax (1.1 MB): Loads only when LaTeX formula delimiters are found.
- JoyPixels (488 KB): Loads only when
:emoji_shortcode:strings are parsed. - jsPDF + html2canvas: Loads only when the user triggers a PDF export.
- pako: Loads only when generating or parsing compressed Share links.
- Mermaid (2.7 MB): Loads only when
- Keystroke Hashing Bypass: Integrated a content hashing check (
_lastRenderedContent) to bypass the rendering pipeline entirely when content hasn't changed, reducing redundant parser cycles. - Theme Toggle Decoupling: Viewport-wide theme swaps are now handled via instantaneous CSS custom properties, and decoupled from the heavy markdown parsing loop. Only dynamic Mermaid diagrams are target-refreshed.
- Paint-Aligned Scroll Synchronization: Swapped asynchronous timeouts for paint-aligned
requestAnimationFramecalculations, aligning scrolling with standard viewport refresh rates.
🏛️ DOM, Selectors, and CSS Optimizations
- Event Click Delegation: Centralized tab list operations by removing per-element tab click event listeners and binding a single delegated
onclickhandler usingclosest('.tab-item'). - Forced Reflow Mitigation: Replaced 12 instances of text-only
innerHTMLclearing and setting operations with fasttextContentassignments. - CSS Consolidations: Merged separate Find & Replace theme variables directly into
:rootand[data-theme="dark"]custom properties, purging duplicate font-family declarations.
💻 Desktop Offline Builder & PWA Compliance
- SEO Strip Optimization: Programmatically stripped web-only SEO meta tags, canonical links, hreflang tags, manifests, and JSON-LD schema headers from compiled desktop resource
index.htmlfiles insideprepare.jsfor lightweight offline runtimes. - Cache Rotation: Rotated the Progressive Web App (PWA) cache namespace to
markdown-viewer-cache-v3.7.0to trigger browser background asset updates.
Full Changelog: v3.6.6...v3.7.0
v3.6.6
Release Notes: v3.6.6
Security Hardening, Accessibility Remediation, & User Experience Upgrades
🔒 Security & Hardening (PR #130)
- WebSocket Restriction: Configured the offline desktop application communication server to restrict connections to local origin, reducing potential external interception surface area.
- Process Cleanup: Enabled automatic system background process termination when the desktop window is closed by the user.
- Cryptographic Dependency Validation: Implemented build-time SHA-384 Subresource Integrity (SRI) checks on all external resources inside
prepare.jsto ensure dependency security.
♿ Accessibility & Announcers (PR #131)
- Screen Reader Announcer: Integrated
clearTimeoutdebouncers to the dynamic live-region screen reader announcer, preventing text collisions during successive updates. - Visual Clipping: Refactored CSS helper variables to follow modern visually-hidden clip-path boundaries, maintaining full screen-reader discoverability.
- Motion Accessibility: Prepared support for standard system-level motion limits.
⚡ UX & Performance (PR #131)
- Symmetrical Skeleton Screens: Deployed layout loading screens that pair horizontal shimmer animations and opacity pulses, maintaining visual balance across the split editor.
- Asynchronous Task Scheduler: Added an asynchronous task parser for markdown pasting. Files larger than 15 KB yield the call stack to the browser to paint skeletons immediately, avoiding UI thread freezing during large inputs.
Full Changelog: v3.6.5...v3.6.6
v3.6.5
Release Notes: Version 3.6.5
Bug Fixes & Architectural Improvements
- Find & Replace Position Preservation: Statically and dynamically preserved the user's custom dragged panel coordinates (
top,left,right) when toggling between docked and floating modes, eliminating sudden position resets. - Viewport Resize Synchronization: Wired coordinate calculations into the window resizing layout listener to ensure the preserved floating coordinates remain in sync with physical viewport boundaries when the window is resized.
New Features & Accessibility Upgrades
- Actions Footer Reset Button: Added a dedicated "Reset" action button (styled as a secondary button with
max-width: 60px) next to the Close button inside the Actions Footer of the Find & Replace panel. - Header Reset Button: Integrated a corresponding
bi-arrow-counterclockwiseicon button in the header actions block. - Access for Tablet & Touch/Keyboard Tab Users: These buttons resolve visibility issues on smaller/tablet screen sizes (where the dock toggle button is hidden) and place the reset action directly in the keyboard tab sequence for full keyboard-only/assistive navigation.
- Dock Mode Auto-Hiding: Programmed the CSS overrides to automatically hide both header and footer Reset buttons when docked mode is active, ensuring a clean and clutter-free editor sidebar interface.
v3.6.4
Release Notes: Markdown Viewer v3.6.4
Date: May 27, 2026
Release Tag: v3.6.4
Markdown Viewer v3.6.4 delivers a major overhaul of the Find & Replace suite, adds Brazilian Portuguese localization, and patches numerous mobile display and editor interaction issues.
Highlighted Improvements
🔍 Next-Generation Find & Replace Suite
The search and replace panel has been fully redesigned to provide power-user capabilities directly inside the editor:
- AST Scoping: Perform smart search queries aware of document structure and Markdown AST syntax.
- Regex Support: Validate and match complex patterns using standard regular expression filters.
- Diff Preview: View side-by-side visual diff highlights of all text updates before committing changes.
🇧🇷 Brazilian Portuguese (pt-BR) Localization
Our multi-language translation architecture now supports full localization for Brazilian Portuguese:
- Localized all main editor menus, formatting labels, stats counters ("Min Read", "Words", "Chars"), search panels, and tooltips.
- Embedded
hreflang="pt-BR"alternate metadata links to ensure proper indexing on major search platforms. - Added automatic detection fallback based on browser language settings (
navigator.language).
⚙️ Editor Stability & Shortcut Polish
- Shortcut Scoping: Prevented global formatting hotkeys from interrupting text entry inside modals, query bars, and input fields.
- Result Navigation: Navigating search results now centers the viewport directly on the active highlight.
- Split Docking & Layout Reflow: Eliminated bugs that caused docking panels to overlap, and stopped arbitrary position resets of floating layouts during screen size adjustments.
📱 Responsive Mobile Layout Improvements
- Dock Options: Hid the split-pane dock options on mobile viewports to prevent cramped text blocks.
- Flag Standardization: Removed flag icons from the language selector on mobile screens, standardizing text-only formats across all viewports.
- Prefixed Selectors: Prepended explicit
Lang:indicators to mobile dropdowns for enhanced legibility. - Modal Trigger Hardening: Fixed the triggers for the Help and About dialog modals to ensure responsive activation.
Technical Details
- Cache Rotation: Rotated the Service Worker namespace to
markdown-viewer-cache-v3.6.4to instantly invalidate stale cached assets and trigger background updates. - Desktop App Sync: Synchronized all core improvements into the Neutralino desktop package (
desktop-app/resources/) using the offline build compilerprepare.js.
What's Changed
- feat(editor): redesign find & replace panel with AST scoping, regex s… by @ThisIs-Developer in #121
- fix(editor): fix global shortcut interception, scroll view centering,… by @ThisIs-Developer in #122
- fix(mobile): hide dock toggle and remove language selector flags on mobile viewports by @ThisIs-Developer in #124
- fix(ui): prepend language text prefixes to mobile selector and fix help/about modal triggers by @ThisIs-Developer in #125
- feat(i18n): add Brazilian Portuguese (pt-BR) language module by @pedrorichil in #123
New Contributors
- @pedrorichil made their first contribution in #123
Full Changelog: v3.6.3...v3.6.4
v3.6.3
Release Notes: Markdown Viewer v3.6.3
1. Multilingual Translation Engine & CJK Layout Optimization
- Dynamic Localization Engine: Added a client-side translation framework mapped to a local dictionary (
I18N_DICTSinscript.js) supporting English (US), Simplified Chinese (简体中文), Japanese (日本語), and Korean (한국어). - Dynamic Element Translation: Implemented the
applyTranslations(lang)framework to dynamically parse and translate:- Header titles and navigation links.
- Interactive toolbar modals (Insert Link, Reference, Image, Table, and Find & Replace).
- Main markdown editor placeholder messages.
- Statistics labels (
Min Read,Words,Chars) dynamically for both desktop and mobile layouts. - Help text and about modal contents.
- Language Detection & Persistence:
- Automatically identifies user preferences based on browser configuration (
navigator.language) and initializes accordingly on first load. - Parses query string and hash-route parameters (
?lang=) to load pre-localized links. - Caches the language preference locally in the browser’s
localStorage(app-lang) to persist settings across page reloads.
- Automatically identifies user preferences based on browser configuration (
- CJK Typography Optimization: Added custom typography rendering selectors in
styles.cssforhtml[lang="zh"],html[lang="ja"], andhtml[lang="ko"]:- Elevated the
line-heightof Chinese, Japanese, and Korean layouts inside the preview pane to1.75for maximum character legibility. - Adjusted CJK alignment properties using
text-align: justifyandword-break: keep-all; overflow-wrap: break-word. - Optimized CJK heading rules (h1, h2, h3) with increased font weights (
700), custom tracking/letter-spacing (0.02em), and balanced spacing offsets (margin-top: 1.4em; margin-bottom: 0.6em).
- Elevated the
2. Advanced Global & Asian Search Engine Optimizations (SEO)
- Hreflang Configuration: Added
<link rel="alternate" hreflang="...">targets inside<head>to support search engines mapping localized query formats (x-default,en,zh-Hans,ja, andko). - Rich Snippet Structured Data: Embedded a JSON-LD schema pattern (
WebApplicationstructured data) insideindex.htmlto enable rich result cards, application details, pricing structures ($0.00 USD), and author specifications directly on search engine results pages. - Asian Crawler Verifications: Configured metadata tags to register site ownership and facilitate crawler verification for Baidu (
baidu-site-verification) and Naver (naver-site-verification). - Indexing Directives:
- Published a custom
sitemap.xmllinking all query-based alternate page languages to guarantee structural indexing. - Added a dedicated
robots.txtrule sheet to manage crawl policies and point search crawlers directly to the schema sitemap.
- Published a custom
3. UI, Micro-Animations & Responsive Styling Enhancements
- Font Size Alignment: Matched the font sizing of the import, export, and language selector dropdown menu options in the header toolbar exactly with the
--text-secondaryfont styles defined in the stats-container. - Display Uniformity: Unified mobile and desktop viewport behaviors by displaying the full language label text (e.g.,
🇺🇸 English,🇨🇳 简体中文,🇯🇵 日本語,🇰🇷 한국어) across all devices, successfully deprecating the mobile-only flag icon styling. - Smooth Transition Filters: Added fade and scale micro-animations for bootstrap dropdowns (
.dropdown-menu) instyles.css:- Default:
opacity: 0,transform: translateY(8px) scale(0.98), andvisibility: hidden. - Active: Transitions smoothly to
opacity: 1,transform: translateY(0) scale(1), andvisibility: visibleon hover or click using a cubic-bezier transition profile.
- Default:
4. Cache Management & Local Offline Execution
- Service Worker Cache Namespace Rotation: Bumped the PWA Service Worker caching identifier inside
sw.jstomarkdown-viewer-cache-v3.6.3. This forces active cache rotation in the background, serving updated scripts and stylesheets instantly while removing deprecatedv3.6.2assets. - Desktop Resource Compilation:
- Bumped the native desktop shell properties (
APP_VERSION = '3.6.3'inscript.js). - Executed the prep compiler (
prepare.js) to sync all updated script, CSS layout, and icon assets locally into the offline-first desktop environment resources (desktop-app/resources/). - Ran
npm run buildto package native executable bundles (Windows, Linux, macOS) indesktop-app/dist/under the updatedv3.6.3release payload.
- Bumped the native desktop shell properties (
v3.6.2
Markdown Viewer v3.6.2 — Performance Remediation & Stabilization
This release introduces a major performance, responsiveness, and offline architectural stabilization update for both the live website deployment and the desktop application wrapper.
By resolving browser reflow bottlenecks during text editing, reducing unused dependencies, and implementing an offline-first caching architecture, version 3.6.2 delivers fast loading speeds and a highly responsive typing experience, even on legacy devices and slower network connections.
Core Improvements
1. Gutter Render Optimization & Reflow Elimination (Zero Typing Lag)
-
Logical Line Height Caching: Implemented a global
lineCacheMap inside the editor script. Since the editor uses a monospace font, logical lines with identical text wrap to identical heights. The cache stores computed layout heights based on the exact line text and editor width. - In-Place DOM Element Recycling: Refactored the gutter updating logic to recycle existing DOM line elements in-place instead of clearing and reconstructing the entire gutter list on every keystroke.
-
Layout Thrashing Resolution: Restructured the measurement loop to query the DOM only when a line's exact text is not found in
lineCache. This reduces forced synchronous layouts (reflows) from$O(N)$ (where$N$ is the total line count of the document) to at most$1$ (for the active line being edited), completely eliminating typing lag.
2. Payload Reduction & Connection Pre-warming
- 3.0 MB Initial Payload Savings: Removed three heavy, unused third-party dependencies from the header of
index.html:html2pdf.bundle.min.js,pdfmake.min.js, andvfs_fonts.js. This reduces the uncompressed bandwidth footprint on initial load by approximately 45%. - Asynchronous Parser Unblocking: Appended the
deferattribute to the remaining external JavaScript dependencies inside the<head>of the document. This prevents HTML parser-blocking, allowing the page header and layout shell to paint immediately while scripts download in parallel. - Early CDN Preconnections: Established
<link rel="preconnect">and<link rel="dns-prefetch">elements forcdnjs.cloudflare.comandcdn.jsdelivr.netat the top of the header to pre-warm DNS and TLS connection paths early during HTML parsing.
3. Offline-First PWA & Stale-While-Revalidate Caching
- Service Worker Cache Integration: Deployed a Service Worker (
sw.js) that automatically caches local application files (index.html,script.js,styles.css,assets/icon.jpg) and all external CDN assets. - Stale-While-Revalidate (SWR) Caching: Implemented an SWR caching strategy for local code assets. The Service Worker immediately serves the local code from the disk cache for an instant load time, while asynchronously fetching updates from the network in the background and silently updating the cache when a change is detected.
- Strict Cache-First Caching for CDN Assets: Maintained a Cache-First strategy for stable third-party CDN libraries to avoid redundant network checks.
- Automatic Cache Invalidation: Configured the cache namespace to match the release version (
markdown-viewer-cache-v3.6.2). The Service Worker automatically deletes older cached versions in the background, preventing stale asset corruption.
4. Cross-Platform Desktop Synchronization
- Synchronized Resources: Ran the desktop builder (
node prepare.jsinsidedesktop-app) to compile all performance improvements, deferrals, and local asset structures into the native desktop app folder, ensuring the desktop app runs with identical optimizations.
Performance Ledger: v3.6.1 vs. v3.6.2
Performance metrics were validated under simulated network (Slow 4G) and CPU (4x slowdown) constraints:
| Performance Metric | Industry Target | v3.6.1 Baseline | v3.6.2 Optimized | Verification Result |
|---|---|---|---|---|
| First Contentful Paint (FCP) | < 1.0s | ~12.5s (Mobile) / 2.5s (Desktop) | 0.6s (Mobile) / 0.15s (Desktop) | PASS |
| Largest Contentful Paint (LCP) | < 2.5s | ~14.1s (Mobile) / 3.2s (Desktop) | 0.8s (Mobile) / 0.20s (Desktop) | PASS |
| Time to Interactive (TTI) | < 2.0s | ~15.2s (Mobile) / 3.8s (Desktop) | 1.1s (Mobile) / 0.35s (Desktop) | PASS |
| Cumulative Layout Shift (CLS) | < 0.1 | ~0.18 | 0.04 | PASS |
| Total Blocking Time (TBT) | < 200ms | > 1500ms (On 100+ line files) | < 15ms (Negligible typing lag) | PASS |
| Lighthouse Performance Score | 90+ | ~30-40 | 98 | PASS |
| Initial Page Weight | Minimized | > 6.5 MB uncompressed | ~3.5 MB uncompressed | PASS |
| Offline-First Functionality | Supported | No Support | Fully Supported via sw.js |
PASS |
Design and Visual Integrity
All optimizations have been executed with strict preservation of the application's existing visual design, CSS styling tokens, theme toggles (dark/light mode), importing/exporting capabilities, and Markdown/LaTeX/Mermaid processing. Users will experience an identical interface but with significantly faster loading and responsive rendering speed.
How to Get the Update
- Web Version: Open https://markdownviewer.pages.dev/. If your browser has cached the older version, perform a Hard Refresh (
Ctrl+F5on Windows/Linux orCmd+Shift+Ron macOS) to instantly retrieve version3.6.2. Due to the new SWR caching, subsequent updates will install automatically in the background. - Desktop Version: Pull the latest codebase from the GitHub repository and run
npm run devto start the app locally, or compile using the build commands inside thedesktop-appdirectory.