Skip to content

Conversation

tbouffard
Copy link
Member

@tbouffard tbouffard commented Feb 18, 2025

The old name was used to match the current name of OrthConnector, but as it's more readable not to use abbreviated names, it will be renamed to OrthogonalConnector in the future.

So, rename the configuration object now to limit future breaks (it's not included in any version yet).

Summary by CodeRabbit

  • Refactor

    • Streamlined global configuration settings by standardizing naming conventions and retiring legacy utility interfaces. Users should now leverage native language features for handling default values and optional access.
  • Documentation

    • Updated user documentation to reflect the revised configuration defaults and naming conventions.
  • Tests

    • Adjusted test cases to validate and support the new configuration structures.

The old name was used to match the current name of `OrthConnector`, but as it's more readable not to use abbreviated names, it will be renamed to `OrthogonalConnector` in the future.

So, rename the configuration object now to limit future breaks (it's not included in any version yet).
@tbouffard tbouffard added the refactor Code refactoring label Feb 18, 2025
Copy link

coderabbitai bot commented Feb 18, 2025

Walkthrough

This pull request introduces breaking changes to the maxGraph library. Several internal utility functions have been removed or marked as private, and the browser compatibility check (Client.isBrowserSupported) was removed. The Client.VERSION property has been relocated to constants.VERSION for immutability. Additionally, configuration objects for both ManhattanConnector and OrthConnector have been updated—the latter being renamed from OrthConnectorConfig to OrthogonalConnectorConfig along with corresponding reset functions, tests, and documentation updates.

Changes

File(s) Change Summary
CHANGELOG.md Removed/privatized internal utility functions (e.g., utils.isNullish, utils.getValue, stringUtils.getColor, etc.), removed Client.isBrowserSupported, and relocated Client.VERSION to constants.VERSION; updated ManhattanConnector and OrthConnector configurations.
packages/core/__tests__/.../config.test.ts,
packages/core/src/types.ts,
packages/core/src/view/style/config.ts,
packages/core/src/view/style/edge/Orthogonal.ts,
packages/html/.storybook/preview.ts,
packages/website/docs/usage/global-configuration.md
Renamed OrthConnectorConfig to OrthogonalConnectorConfig and updated the associated reset functions, test case names, import references, documentation, and configuration defaults accordingly.

Possibly related PRs

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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

Copy link

@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: 0

🧹 Nitpick comments (2)
packages/website/docs/usage/global-configuration.md (2)

25-25: Correct list item indentation for the renamed configuration object.
The unordered list item for OrthogonalConnectorConfig is indented by 4 spaces, while markdownlint expects 2 spaces at this nesting level.

Proposed diff:

-    - `OrthogonalConnectorConfig` (since 0.16.0): for `OrthConnector`.
+  - `OrthogonalConnectorConfig` (since 0.16.0): for `OrthConnector`.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

25-25: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


36-36: Correct list item indentation for the reset function entry.
The list entry for resetOrthogonalConnectorConfig is indented by 4 spaces, but should use 2 spaces to comply with the markdownlint MD007 recommendation.

Proposed diff:

-    - `resetOrthogonalConnectorConfig` (since 0.16.0)
+  - `resetOrthogonalConnectorConfig` (since 0.16.0)
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

36-36: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 82d2a80 and 62f5894.

📒 Files selected for processing (7)
  • CHANGELOG.md (1 hunks)
  • packages/core/__tests__/view/style/config.test.ts (1 hunks)
  • packages/core/src/types.ts (1 hunks)
  • packages/core/src/view/style/config.ts (2 hunks)
  • packages/core/src/view/style/edge/Orthogonal.ts (3 hunks)
  • packages/html/.storybook/preview.ts (2 hunks)
  • packages/website/docs/usage/global-configuration.md (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/core/src/types.ts
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
packages/website/docs/usage/global-configuration.md

25-25: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


36-36: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: build
  • GitHub Check: build (windows-2022)
  • GitHub Check: build (macos-14)
  • GitHub Check: build (ubuntu-22.04)
🔇 Additional comments (6)
packages/html/.storybook/preview.ts (1)

9-9: LGTM!

The import and usage of the renamed function are correctly updated.

Also applies to: 28-28

packages/core/__tests__/view/style/config.test.ts (1)

20-20: LGTM!

The test case and its dependencies are correctly updated to use the new naming convention.

Also applies to: 22-22, 26-26

packages/core/src/view/style/config.ts (1)

56-56: LGTM!

The configuration object and its dependencies are correctly updated to use the new naming convention.

Also applies to: 74-74, 82-83

packages/core/src/view/style/edge/Orthogonal.ts (1)

27-27: LGTM!

The import and usage of the renamed configuration are correctly updated.

Also applies to: 122-122, 207-207

packages/website/docs/usage/global-configuration.md (1)

25-36: Approved renaming update and enhanced clarity.
The changes correctly update the configuration object’s name from OrthConnectorConfig to OrthogonalConnectorConfig (and similarly update the reset function). This improves clarity and aligns with upcoming naming conventions.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

25-25: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


29-29: Unordered list indentation
Expected: 0; Actual: 2

(MD007, ul-indent)


30-30: Unordered list indentation
Expected: 0; Actual: 2

(MD007, ul-indent)


31-31: Unordered list indentation
Expected: 0; Actual: 2

(MD007, ul-indent)


32-32: Unordered list indentation
Expected: 0; Actual: 2

(MD007, ul-indent)


33-33: Unordered list indentation
Expected: 0; Actual: 2

(MD007, ul-indent)


34-34: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


35-35: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


36-36: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

CHANGELOG.md (1)

34-35: Clear renaming documentation in changelog.
The changelog now states:
"- OrthConnector is now configured with the global OrthogonalConnectorConfig object."
and explains that properties previously on EdgeStyle have been moved accordingly. This entry clearly documents the renaming update and is consistent with the overall objective.

@tbouffard tbouffard merged commit e15f34c into main Feb 18, 2025
7 checks passed
@tbouffard tbouffard deleted the refactor/rename_OrthConnectorConfig branch February 18, 2025 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant