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

254 在windows上搭建webview2或者electron客户端使用wangeditor和搜狗输入法执行特定步骤会出现异常 #260

Conversation

cycleccc
Copy link
Owner

@cycleccc cycleccc commented Oct 16, 2024

Changes Overview

Implementation Approach

Testing Done

Verification Steps

Additional Notes

Checklist

  • I have created a changeset for this PR if necessary.
  • My changes do not break the library.
  • I have added tests where applicable.
  • I have followed the project guidelines.
  • I have fixed any lint issues.

Related Issues

Summary by CodeRabbit

  • Documentation

    • Updated contribution guidelines to base new branches on the master branch.
    • Revised development setup documentation to reflect new tools.
    • Restructured publishing process for clarity and simplified steps.
  • Bug Fixes

    • Addressed issues with Windows setup for WebView2 or Electron clients using WangEditor.
  • Improvements

    • Enhanced handling of composition events in the text editor for better functionality and readability.

Copy link

changeset-bot bot commented Oct 16, 2024

⚠️ No Changeset found

Latest commit: 7b45205

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Oct 16, 2024

Caution

Review failed

The head commit changed during the review from 9629d5f to 0a3da14.

Walkthrough

The pull request includes updates to documentation and contribution guidelines, specifically instructing contributors to base new branches on the master branch. It revises the development setup documentation to reflect a shift from "lerna" to "turbo" and "changeset." The publishing process has been simplified and clarified. Additionally, several patches were applied to modules within the @wangeditor-next package, addressing an issue on Windows with WebView2 and Sogou Input Method. Finally, composition event handlers in the text editor were improved for better functionality and readability.

Changes

Files Modified Summary of Changes
docs/contribution-CN.md, docs/contribution-EN.md, docs/dev.md, docs/publish.md Updated contribution guidelines to base new branches on master, revised development setup documentation from "lerna" to "turbo" and "changeset," and restructured the publishing process with a new five-step outline for testing versions.
.changeset/gentle-goats-hang.md Introduced patches to various @wangeditor-next modules and noted an issue with WebView2 and Sogou Input Method on Windows that may cause exceptions.
packages/core/src/text-area/event-handlers/composition.ts Improved composition event handling by reordering imports, adding areBothTextNodes function, and refining handleCompositionEnd logic for better selection management and readability.

Possibly related PRs

  • fix: fix path resolve warning #258: This PR addresses path resolution warnings in various modules of the @wangeditor-next package, which may relate to the changes made in the main PR regarding module updates and documentation for the @wangeditor-next package.

Poem

🐇 In the garden of code, we hop and play,
With branches on master, we pave the way.
Turbo tools now guide our quest,
As we publish with ease, we do our best.
So gather 'round, contributors dear,
Together we code, with joy and cheer! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Outside diff range and nitpick comments (6)
docs/publish.md (2)

3-6: Consider adding more details about creating changesets.

The instructions for publishing a formal version are clear and concise. However, it might be helpful to provide more information about creating changesets, especially for new contributors. Consider adding:

  1. A brief explanation of what a changeset is and why it's important.
  2. Guidelines on what information should be included in a changeset.
  3. An example of a good changeset message.

This additional information would make the process more accessible to all contributors.


8-14: Enhance guidance for publishing testing versions.

The instructions for publishing a testing version are clear and well-structured. To further improve this section, consider adding:

  1. An explanation of when and why one might want to publish a testing version.
  2. Guidance on naming conventions for beta versions.
  3. Information on choosing between different pre-release identifiers (e.g., alpha, beta, rc) and when to use each.
  4. A note on the importance of communicating the release of testing versions to relevant stakeholders or testers.

These additions would provide more context and help contributors make informed decisions when publishing testing versions.

docs/dev.md (3)

Line range hint 13-26: LGTM: Clear instructions for Yarn 4.x setup.

The new instructions for setting up Yarn 4.x are clear and well-formatted. The use of code blocks enhances readability and makes it easy for users to copy and paste commands.

Consider adding a note about the minimum required Node.js version at the beginning of the "准备工作" (Preparation) section, as it's crucial information for setup.


Line range hint 27-38: LGTM: Updated build instructions are clear and accurate.

The new build instructions clearly differentiate between debug (yarn dev) and production (yarn build) builds, which is helpful for developers.

Consider adding a brief explanation of when to use yarn dev vs yarn build to provide more context for new contributors.


仍存在遗留的 'lerna' 引用

在以下文件中发现仍有 'lerna' 的引用,需要更新以反映当前的开发配置:

  • docs/dev.md:

    • lerna link 关联内部包
    • lerna add ... 之后,需要重新 lerna link 建立内部连接
  • docs/test.md:

    • 提及基于 lerna 的 monorepo 管理方式

请更新这些部分以使用新的工具链。

🔗 Analysis chain

Line range hint 40-58: Update remaining references to old tooling and revise instructions.

While most of the document has been updated to reflect the new tooling, there are still some inconsistencies:

  1. The instruction to use lerna link for internal package linking is outdated.
  2. The package size analysis instructions might need revision to align with the new tooling (turbo and changeset).

Please update these sections to reflect the current development setup:

  1. Remove or replace the lerna link instruction with the appropriate method for the new tooling.
  2. Verify and update the package size analysis instructions if necessary.

To ensure all references to the old tooling have been updated, please run the following command:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining references to 'lerna' in the docs directory
rg --type md 'lerna' docs/

Length of output: 342

docs/contribution-CN.md (1)

65-65: Consider rephrasing for better clarity in Chinese

The static analysis tool suggests a potential grammatical issue in the phrase "无论是大是小". While this is a common expression in Chinese, we could improve clarity and formality.

Consider rephrasing to:

-我们非常感激您的贡献,无论是大是小。您的努力帮助我们构建了一个更好的`wangEditor-next`。
+我们非常感激您的每一份贡献,无论大小。您的努力帮助我们构建了一个更好的`wangEditor-next`。

This maintains the meaning while addressing the potential grammatical concern.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~65-~65: 您不可用“是”来表达个形容词。大部分人都平常用“很”来代替“是”。您是不是想表达"很小"?
Context: ...与讨论,或在社交媒体上推广项目。 ## 感谢 我们非常感激您的贡献,无论是大是小。您的努力帮助我们构建了一个更好的wangEditor-next

(SHI_ADHECTIVE_ERROR)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c2abdb2 and f7356ce.

📒 Files selected for processing (6)
  • .changeset/gentle-goats-hang.md (1 hunks)
  • docs/contribution-CN.md (2 hunks)
  • docs/contribution-EN.md (2 hunks)
  • docs/dev.md (1 hunks)
  • docs/publish.md (1 hunks)
  • packages/core/src/text-area/event-handlers/composition.ts (9 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .changeset/gentle-goats-hang.md
🧰 Additional context used
🪛 LanguageTool
docs/contribution-CN.md

[uncategorized] ~65-~65: 您不可用“是”来表达个形容词。大部分人都平常用“很”来代替“是”。您是不是想表达"很小"?
Context: ...与讨论,或在社交媒体上推广项目。 ## 感谢 我们非常感激您的贡献,无论是大是小。您的努力帮助我们构建了一个更好的wangEditor-next

(SHI_ADHECTIVE_ERROR)

🔇 Additional comments (6)
docs/publish.md (1)

1-14: Approve changes and request clarification on PR objectives.

The updates to the publishing process documentation are clear, concise, and align with modern version management practices. The separation of formal and testing version publishing instructions, along with the introduction of automated publishing for formal versions, significantly improves the workflow.

However, it's not clear how these documentation changes relate to the PR objectives mentioned in the description, which refer to issues with WebView2 and Sogou Input Method on Windows. Could you please clarify:

  1. How do these publishing process changes address the reported issues?
  2. Are there any specific instructions or considerations for publishing versions that include fixes for the WebView2 and Sogou Input Method issues?

To ensure all relevant files have been updated, please run the following script:

docs/dev.md (1)

7-7: LGTM: Updated prerequisite accurately reflects new tooling.

The change from "lerna" to "turbo" and "changeset" aligns with the project's shift in development tools. This update ensures that new contributors are aware of the correct tools needed for development.

docs/contribution-CN.md (2)

65-65: Approved: Improved file formatting

The addition of a newline at the end of the file improves formatting and follows best practices for file endings.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~65-~65: 您不可用“是”来表达个形容词。大部分人都平常用“很”来代替“是”。您是不是想表达"很小"?
Context: ...与讨论,或在社交媒体上推广项目。 ## 感谢 我们非常感激您的贡献,无论是大是小。您的努力帮助我们构建了一个更好的wangEditor-next

(SHI_ADHECTIVE_ERROR)


20-20: Approved: Update to use 'master' as the base branch

The change from 'develop' to 'master' as the base branch for new contributions aligns with GitHub's default branch naming convention and simplifies the contribution workflow.

To ensure consistency across the project, please run the following script to check if there are any other references to the 'develop' branch that need to be updated:

Consider adding a note in the README or in this contribution guide about this workflow change to inform existing contributors.

docs/contribution-EN.md (2)

65-65: Good practice: Added newline at end of file.

Adding a newline at the end of the file is a good practice. It ensures that the file ends with a proper line terminator, which can prevent issues with certain tools and improve compatibility.


20-20: Verify consistency of base branch change across documentation and repository settings.

The change from 'develop' to 'master' as the base branch for new contributions is approved. This update likely reflects a shift in the project's branching strategy, possibly towards a trunk-based development model.

To ensure consistency, please run the following script to check for any remaining references to the 'develop' branch in other documentation files and verify the default branch setting in the repository:

✅ Verification successful

Base Branch Change to 'master' Verified Successfully

All references to the 'develop' branch have been removed from the documentation, and the repository's default branch is set to 'master'.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for 'develop' branch references and verify default branch

# Test 1: Search for 'develop' branch references in documentation
echo "Searching for 'develop' branch references in documentation:"
rg --type md -i 'develop.*branch' docs/

# Test 2: Check the default branch setting
echo "Checking default branch setting:"
gh repo view cycleccc/wangEditor-next --json defaultBranchRef --jq .defaultBranchRef.name

# Note: Ensure you have the necessary permissions to run the 'gh' command

Length of output: 350

packages/core/src/text-area/event-handlers/composition.ts Outdated Show resolved Hide resolved
packages/core/src/text-area/event-handlers/composition.ts Outdated Show resolved Hide resolved
packages/core/src/text-area/event-handlers/composition.ts Outdated Show resolved Hide resolved
packages/core/src/text-area/event-handlers/composition.ts Outdated Show resolved Hide resolved
@cycleccc cycleccc force-pushed the 254-在windows上搭建webview2或者electron客户端使用wangeditor和搜狗输入法执行特定步骤会出现异常 branch from 9629d5f to 0a3da14 Compare October 17, 2024 06:35
@cycleccc cycleccc merged commit 24696cc into master Oct 17, 2024
2 checks passed
cycleccc added a commit that referenced this pull request Oct 17, 2024
* style: refactor by new eslint

* fix: selection sync error

* docs: modify dev docs

* docs: modify publish docs

* Create gentle-goats-hang.md

* Update packages/core/src/text-area/event-handlers/composition.ts

254 在windows上搭建webview2或者electron客户端使用wangeditor和搜狗输入法执行特定步骤会出现异常

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* perf: variable naming correction & delete redundant judgment conditions

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant