Skip to content

feat: enhance error handling, and improve editor initialization logic#19

Merged
bthos merged 1 commit into
mainfrom
bug-initialization-error
Apr 29, 2025
Merged

feat: enhance error handling, and improve editor initialization logic#19
bthos merged 1 commit into
mainfrom
bug-initialization-error

Conversation

@bthos

@bthos bthos commented Apr 29, 2025

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings April 29, 2025 18:38
@bthos bthos merged commit d6f8edd into main Apr 29, 2025
2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances error handling and improves the initialization logic for the integrated Toast UI Editor.

  • Updates webpack configuration for source maps and dependency bundling in production
  • Implements dynamic script loading with improved error handling in test.html
  • Adds retry and error handling logic for editor initialization in src/main.ts and bumps version to 1.0.9

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
webpack/webpack.config.js Updated devtool settings and removed externals block for bundling Toast UI Editor
version.txt Incremented version from 1.0.8 to 1.0.9
test.html Replaced inline script loading with dynamic script insertion and enhanced error reporting
src/main.ts Added retry logic and try-catch around Toast UI Editor initialization with global observer cleanup
src/editor-bundle.ts Safely initialized window.toastui and exposed Editor globally
README.md Removed outdated version information
Comments suppressed due to low confidence (2)

README.md:4

  • The version information was removed from README.md; please update it to reflect the new version (1.0.9) for consistency with version.txt.
-**Current Version:** 1.0.7

webpack/webpack.config.js:19

  • The removal of the externals configuration for @toast-ui/editor may affect the bundling strategy in production; please confirm that bundling Toast UI Editor is now intended.
devtool: isProduction ? false : 'source-map',

Comment thread src/main.ts
}

function whenElementAppear(): void {
if (retryCount >= MAX_RETRIES) {

Copilot AI Apr 29, 2025

Copy link

Choose a reason for hiding this comment

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

While the max retry logic stops further attempts, consider adding explicit logging or user feedback in the case where no visible textarea is found to clarify the context of the initialization failure.

Copilot uses AI. Check for mistakes.
@bthos bthos deleted the bug-initialization-error branch April 29, 2025 18:38
@bthos bthos restored the bug-initialization-error branch April 29, 2025 18:42
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.

2 participants