Skip to content

v2.4.0 - Browser Compatibility Fix

Latest

Choose a tag to compare

@JeromeErasmus JeromeErasmus released this 14 Dec 05:16
a1e3614

🌐 Browser Compatibility Fix

This release resolves the browser compatibility issue reported in #2 where the package failed to work in browser environments (React + Vite) due to Node.js-specific APIs.

🚀 What's Fixed

  • Browser Compatibility: Removed process.memoryUsage() calls that caused TypeError: process.memoryUsage is not a function in browsers
  • PerformanceMonitor Removed: The performance monitoring system has been completely removed to eliminate Node.js dependencies
  • StreamingParser Updated: Now uses buffer-size based memory limits instead of Node.js memory monitoring

✅ What's Preserved

  • Core Parsing Functionality: All ADF ↔ Markdown conversion features work exactly the same
  • All Parser Methods: markdownToAdf(), adfToMarkdown(), validation, etc. are unchanged
  • Test Coverage: All 519 tests still pass - no functionality lost
  • TypeScript Support: Full type definitions maintained

📦 Breaking Changes

  • Removed PerformanceMonitor class and related exports
  • Removed ./performance module export
  • Removed performance-related methods from Parser class:
    • getPerformanceStats()
    • getPerformanceReport()
    • validatePerformanceTargets()

🔧 Migration Guide

If you were using performance monitoring:

// Before (v2.3.x)
import { PerformanceMonitor } from 'extended-markdown-adf-parser/performance';

// After (v2.4.0+)
// Performance monitoring removed - use your own timing if needed
const start = Date.now();
const result = parser.markdownToAdf(markdown);
const duration = Date.now() - start;

🎯 Browser Usage

Now works perfectly in all browser environments:

// ✅ Works in React, Vue, Angular, vanilla JS
import { Parser } from 'extended-markdown-adf-parser';
const parser = new Parser();
const adf = parser.markdownToAdf('# Hello World');

Closes #2