refactor!: expose all exported functions in namespaces#740
Conversation
Introduce `guiUtils` and `requestUtils` to hold functions that previously lived alone. By convention, only the global configuration functions live outside a namespace. BREAKING CHANGES: some functions are now accessible via a namespace: - `get`, `getAll`, `load`, `submit` via `requestUtils` - `error`, `popup` via `guiUtils`
WalkthroughThe changes restructure the codebase by organizing utility functions into two new namespaces: Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant guiUtils
participant MaxWindow
Caller->>guiUtils: call popup(content, isInternalWindow)
alt isInternalWindow true
guiUtils->>MaxWindow: Create and display internal window with content
MaxWindow-->>guiUtils: Confirm window is displayed
else
guiUtils->>Browser: Attempt to open new browser window
Browser-->>guiUtils: Return window handle or error
end
sequenceDiagram
participant Caller
participant requestUtils
participant MaxXmlRequest
Caller->>requestUtils: call load(url)
requestUtils->>MaxXmlRequest: Create a request with URL
MaxXmlRequest-->>requestUtils: Return request instance
requestUtils-->>Caller: Provide instance for further processing
Possibly related PRs
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (5)
packages/core/src/util/MaxXmlRequest.ts (1)
24-26: Documentation references to removed functions are outdated.The documentation still references functions that have been moved to
requestUtilsnamespace (get,getAll,post, andload). While these references are now likely maintained in the new module, keeping them here could mislead developers.Consider updating the documentation to reference these functions through the new namespace:
- See also {@link get}, {@link getAll}, {@link post} and {@link load}. + See also {@link requestUtils.get}, {@link requestUtils.getAll}, {@link requestUtils.post} and {@link requestUtils.load}.packages/core/src/gui/guiUtils.ts (1)
33-87: Successfully relocated popup function.The
popupfunction has been properly moved fromMaxWindow.tsto the newguiUtilsnamespace. The function maintains its original behavior while now being part of a more logical grouping of GUI-related utilities.However, there's an inconsistency in the error message format between the branches of the conditional.
-wnd.document.writeln(`<pre>${htmlEntities(content)}</pre`); +wnd.document.writeln(`<pre>${htmlEntities(content)}</pre>`);packages/core/src/util/requestUtils.ts (3)
81-86: Consider using specific function types.The static analysis tool correctly identifies the use of generic
Functiontypes as a potential issue. Using more specific function types would improve type safety.Consider replacing generic
Functiontypes with more specific function signatures:- onload: Function | null = null, - onerror: Function | null = null, + onload: ((req: MaxXmlRequest) => void) | null = null, + onerror: ((req: MaxXmlRequest) => void) | null = null, - ontimeout: Function | null = null, + ontimeout: ((req: MaxXmlRequest) => void) | null = null,And similarly for the other functions in this file.
🧰 Tools
🪛 Biome (1.9.4)
[error] 81-81: Don't use 'Function' as a type.
Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.
(lint/complexity/noBannedTypes)
[error] 82-82: Don't use 'Function' as a type.
Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.
(lint/complexity/noBannedTypes)
[error] 85-85: Don't use 'Function' as a type.
Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.
(lint/complexity/noBannedTypes)
117-158: Comprehensive implementation of getAll function.The
getAllfunction properly handles multiple asynchronous requests and manages the response aggregation appropriately.Consider a small improvement to use strict equality operators for consistency:
- if (remain == 0) { + if (remain === 0) {- if (errors == 0 && onerror != null) { + if (errors === 0 && onerror != null) {- if (remain == 0) { + if (remain === 0) {
180-187: Properly implemented post function.The
postfunction correctly implements asynchronous POST requests, maintaining a fluent interface by returning the request object.Similar to the
getfunction, consider using more specific function types for improved type safety:- onload: Function, - onerror: Function | null = null + onload: (req: MaxXmlRequest) => void, + onerror: ((req: MaxXmlRequest) => void) | null = null🧰 Tools
🪛 Biome (1.9.4)
[error] 183-183: Don't use 'Function' as a type.
Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.
(lint/complexity/noBannedTypes)
[error] 184-184: Don't use 'Function' as a type.
Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.
(lint/complexity/noBannedTypes)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (16)
CHANGELOG.md(1 hunks)packages/core/src/editor/Editor.ts(3 hunks)packages/core/src/gui/MaxLog.ts(1 hunks)packages/core/src/gui/MaxWindow.ts(2 hunks)packages/core/src/gui/guiUtils.ts(1 hunks)packages/core/src/i18n/Translations.ts(1 hunks)packages/core/src/index.ts(1 hunks)packages/core/src/serialization/ObjectCodec.ts(1 hunks)packages/core/src/util/MaxXmlRequest.ts(1 hunks)packages/core/src/util/requestUtils.ts(1 hunks)packages/html/stories/FileIO.stories.ts(3 hunks)packages/html/stories/HelloPort.stories.ts(2 hunks)packages/html/stories/JsonData.stories.ts(2 hunks)packages/html/stories/Stencils.stories.ts(2 hunks)packages/html/stories/SwimLanes.stories.ts(1 hunks)packages/html/stories/UserObject.stories.ts(2 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
packages/core/src/util/requestUtils.ts (1)
packages/core/src/util/MaxXmlRequest.ts (2)
MaxXmlRequest(86-378)setRequestHeaders(311-315)
🪛 Biome (1.9.4)
packages/core/src/util/requestUtils.ts
[error] 81-81: Don't use 'Function' as a type.
Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.
(lint/complexity/noBannedTypes)
[error] 82-82: Don't use 'Function' as a type.
Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.
(lint/complexity/noBannedTypes)
[error] 85-85: Don't use 'Function' as a type.
Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.
(lint/complexity/noBannedTypes)
[error] 183-183: Don't use 'Function' as a type.
Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.
(lint/complexity/noBannedTypes)
[error] 184-184: Don't use 'Function' as a type.
Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.
(lint/complexity/noBannedTypes)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build (windows-2022)
🔇 Additional comments (30)
packages/core/src/util/MaxXmlRequest.ts (3)
22-22: Documentation updated to clarify MaxXmlRequest's role.The description now clearly states that MaxXmlRequest is an XML HTTP request wrapper, which better reflects its purpose.
38-41: Example code updated to use modern JavaScript syntax.Good use of modern JavaScript conventions with
constinstead ofvarand usingwindow.alertfor better clarity.
86-86: Class export declaration moved to the beginning.The class is now properly declared with
export defaultat its definition rather than at the end of the file, which is a better practice.packages/core/src/i18n/Translations.ts (1)
22-22: Import statement updated to use new namespace structure.The
getandloadfunctions are now imported fromrequestUtilsinstead ofMaxXmlRequest, aligning with the PR objective of moving utility functions into appropriate namespaces.packages/core/src/serialization/ObjectCodec.ts (1)
25-25: Import statement updated to use new namespace structure.The
loadfunction is now imported fromrequestUtilsinstead ofMaxXmlRequest, aligning with the PR objective of moving utility functions into appropriate namespaces.packages/core/src/gui/MaxLog.ts (1)
23-23: Import statements updated to use new namespace structure.The
popupfunction is now imported fromguiUtilsinstead ofMaxWindow, aligning with the PR objective of moving utility functions into appropriate namespaces.Also applies to: 28-28
packages/html/stories/UserObject.stories.ts (2)
32-32: Import updated to use the new namespace structure.The import has been updated to use the new
guiUtilsnamespace instead of directly importing thepopupfunction, which aligns with the PR's goal of reorganizing utility functions into namespaces.
186-186: Function call updated to use the new namespace.The
popupfunction call has been properly updated to use theguiUtils.popupnamespace access pattern, maintaining the same functionality while following the new code organization structure.packages/html/stories/SwimLanes.stories.ts (1)
65-65: Updated commented-out code to match new namespace structure.Even though this is commented-out code, it's good practice to keep it aligned with current code patterns. The reference has been updated from
utilstorequestUtils, which matches the namespace refactoring described in the PR objectives.packages/html/stories/Stencils.stories.ts (2)
31-31: Import updated to use the new namespace.The import statement now correctly references the
requestUtilsnamespace instead of directly importing theloadfunction, which aligns with the PR's goal of better organizing utility functions.
172-172: Function call updated to use the namespace access pattern.The
loadfunction call has been properly updated to use therequestUtils.loadnamespace pattern, maintaining the same functionality while following the new code organization structure.CHANGELOG.md (1)
16-18: Well-documented breaking changes in the CHANGELOG.The breaking changes section has been clearly updated to document that functions have been moved to namespaces. This provides users with the information needed to adapt their code to the new structure:
- HTTP request utilities (
get,getAll,load,submit) are now under therequestUtilsnamespace- GUI-related utilities (
error,popup) are now under theguiUtilsnamespaceThis documentation is essential for users upgrading to the new version.
packages/html/stories/FileIO.stories.ts (3)
28-28: Updated import to use the new requestUtils namespace.The import has been updated to use the new
requestUtilsnamespace instead of the standaloneloadfunction.
149-149: Function call updated to use requestUtils namespace.The
loadfunction is now being accessed through therequestUtilsnamespace.
195-195: Function call updated to use requestUtils namespace.The
loadfunction is now being accessed through therequestUtilsnamespace, consistent with the previous update.packages/core/src/editor/Editor.ts (3)
31-31: Updated import statement for MaxWindow.The import for
MaxWindowhas been modified to no longer import theerrorfunction, as it's now imported from a different module.
48-48: Updated import statement for request utilities.The import for
load,post, andsubmitfunctions has been updated to use the newrequestUtilsnamespace.
61-61: Added import for error function from guiUtils.The
errorfunction is now imported from theguiUtilsnamespace, consistent with the refactoring goal.packages/html/stories/JsonData.stories.ts (2)
25-25: Updated import to use guiUtils namespace.The import has been updated to use the new
guiUtilsnamespace instead of the standalonepopupfunction.
109-109: Function call updated to use guiUtils namespace.The
popupfunction is now being accessed through theguiUtilsnamespace.packages/html/stories/HelloPort.stories.ts (2)
25-25: Updated import to use guiUtils namespace.The import has been updated to use the new
guiUtilsnamespace instead of the standalonepopupfunction.
125-125: Function call updated to use guiUtils namespace.The
popupfunction is now being accessed through theguiUtilsnamespace, consistent with the PR's goal of organizing utility functions into namespaces.packages/core/src/index.ts (2)
182-182: New namespace export for GUI utilities.The new
guiUtilsnamespace properly groups related GUI utility functions, making them more discoverable and organized.
190-190: New namespace export for request utilities.The new
requestUtilsnamespace appropriately organizes HTTP request-related functions, aligning with the PR objectives to group exported functions into namespaces.packages/core/src/gui/MaxWindow.ts (1)
178-178: Export class as default correctly.The change to export
MaxWindowas a default export is appropriate and consistent with the modular approach being adopted in this PR. This maintains the class's accessibility while allowing the utility functions to be moved to their dedicated namespace.packages/core/src/gui/guiUtils.ts (2)
19-26: Appropriate imports for utility functions.The imports are correctly organized and include all necessary dependencies for the relocated functions. This ensures that the utility functions maintain their functionality in the new location.
99-157: Successfully relocated error function.The
errorfunction has been properly moved fromMaxWindow.tsto the newguiUtilsnamespace. The function maintains its original behavior for displaying error messages in a window.packages/core/src/util/requestUtils.ts (3)
19-20: Import MaxXmlRequest for request utilities.The import is properly set up to allow the utility functions to create and manipulate
MaxXmlRequestinstances.
40-44: Well-documented load function.The
loadfunction is well-documented with appropriate examples and correctly implements synchronous URL loading.
198-200: Correctly implemented submit function.The
submitfunction properly uses thesimulatemethod ofMaxXmlRequestto submit parameters via a form.
| export const get = ( | ||
| url: string, | ||
| onload: Function | null = null, | ||
| onerror: Function | null = null, | ||
| binary = false, | ||
| timeout: number | null = null, | ||
| ontimeout: Function | null = null, | ||
| headers: { [key: string]: string } | null = null | ||
| ) => { | ||
| const req = new MaxXmlRequest(url, null, 'GET'); | ||
| const { setRequestHeaders } = req; | ||
|
|
||
| if (headers) { | ||
| req.setRequestHeaders = (request, params) => { | ||
| setRequestHeaders.apply(this, [request, params]); | ||
| for (const key in headers) { | ||
| request.setRequestHeader(key, headers[key]); | ||
| } | ||
| }; | ||
| } | ||
|
|
||
| if (binary != null) { | ||
| req.setBinary(binary); | ||
| } | ||
|
|
||
| req.send(onload, onerror, timeout, ontimeout); | ||
| return req; | ||
| }; |
There was a problem hiding this comment.
Improved get function with header support.
The get function implementation enhances the original functionality with proper header handling. The function correctly overrides the setRequestHeaders method to include custom headers while maintaining the original behavior.
However, I noticed a potential issue with the this context in the headers handling code:
- setRequestHeaders.apply(this, [request, params]);
+ setRequestHeaders.apply(req, [request, params]);The current implementation uses this which is incorrect in this context. It should use req to ensure the method is called with the correct context.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| export const get = ( | |
| url: string, | |
| onload: Function | null = null, | |
| onerror: Function | null = null, | |
| binary = false, | |
| timeout: number | null = null, | |
| ontimeout: Function | null = null, | |
| headers: { [key: string]: string } | null = null | |
| ) => { | |
| const req = new MaxXmlRequest(url, null, 'GET'); | |
| const { setRequestHeaders } = req; | |
| if (headers) { | |
| req.setRequestHeaders = (request, params) => { | |
| setRequestHeaders.apply(this, [request, params]); | |
| for (const key in headers) { | |
| request.setRequestHeader(key, headers[key]); | |
| } | |
| }; | |
| } | |
| if (binary != null) { | |
| req.setBinary(binary); | |
| } | |
| req.send(onload, onerror, timeout, ontimeout); | |
| return req; | |
| }; | |
| export const get = ( | |
| url: string, | |
| onload: Function | null = null, | |
| onerror: Function | null = null, | |
| binary = false, | |
| timeout: number | null = null, | |
| ontimeout: Function | null = null, | |
| headers: { [key: string]: string } | null = null | |
| ) => { | |
| const req = new MaxXmlRequest(url, null, 'GET'); | |
| const { setRequestHeaders } = req; | |
| if (headers) { | |
| req.setRequestHeaders = (request, params) => { | |
| - setRequestHeaders.apply(this, [request, params]); | |
| + setRequestHeaders.apply(req, [request, params]); | |
| for (const key in headers) { | |
| request.setRequestHeader(key, headers[key]); | |
| } | |
| }; | |
| } | |
| if (binary != null) { | |
| req.setBinary(binary); | |
| } | |
| req.send(onload, onerror, timeout, ontimeout); | |
| return req; | |
| }; |
🧰 Tools
🪛 Biome (1.9.4)
[error] 81-81: Don't use 'Function' as a type.
Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.
(lint/complexity/noBannedTypes)
[error] 82-82: Don't use 'Function' as a type.
Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.
(lint/complexity/noBannedTypes)
[error] 85-85: Don't use 'Function' as a type.
Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.
(lint/complexity/noBannedTypes)
There was a problem hiding this comment.
This remarks seems valid.
However, here we are only moving existing code and we don't want to change any implementation which would be out of topic.
The suggestion may be taken into account in the future.
There was a problem hiding this comment.
@tbouffard I understand your approach. Focusing on code reorganization first while maintaining the exact implementation is a sound strategy. It keeps the PR's scope clear and makes changes easier to review. Thanks for explaining the context.
✏️ Learnings added
Learnt from: tbouffard
PR: maxGraph/maxGraph#740
File: packages/core/src/util/requestUtils.ts:79-106
Timestamp: 2025-03-31T08:32:16.906Z
Learning: PR #740 is focused on reorganizing code into namespaces (guiUtils and requestUtils) without changing any implementations. Implementation improvements should be suggested for future PRs.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
CHANGELOG.md (1)
16-18: Clarify Namespace Refactoring in Breaking ChangesThe new changelog section clearly states that several utility functions are now accessible through the
requestUtilsandguiUtilsnamespaces. This documentation aligns with the PR objectives by informing users of the breaking change and the new access paths. Consider adding the version number or date when these changes were introduced for further clarity, which would help users track when to update their code references.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
CHANGELOG.md(1 hunks)packages/core/src/util/MaxXmlRequest.ts(1 hunks)
🔇 Additional comments (12)
packages/core/src/util/MaxXmlRequest.ts (12)
22-22: Improved class description clarity.The updated description more clearly describes the purpose of this class as an XML HTTP request wrapper.
32-36: Documentation formatting improvements.The HTML example is now properly formatted as a code block, which improves readability.
38-41: Modernized example code.The example code has been updated to use
constinstead ofvarandwindow.alertinstead ofmxUtils.alert, which aligns with modern JavaScript practices.
43-45: Modernized error handler example.Similar to the previous example, this code has been updated to use modern JavaScript conventions.
49-50: Improved documentation section header formatting.The "Sending requests" section header is now properly formatted, which improves readability.
54-58: Modernized synchronous request example.The example has been updated to use
constinstead ofvarandwindow.alert, following modern JavaScript practices.
63-68: Updated encoder example with modern syntax.The example has been modernized to use
constinstead ofvarand template literals, which aligns with current JavaScript best practices.
79-81: Improved Java example for XML processing.The Java example now correctly shows how to handle XML entities when processing the response, replacing newlines with the appropriate XML entity.
83-84: Clarified comment about linefeed replacement.The comment now clearly explains when linefeed replacements should be applied in Java processing scenarios.
85-85: Changed export declaration style.The class
MaxXmlRequestis now exported using theexport default classsyntax at the class declaration instead of at the end of the file, which is a more modern and consistent approach.
1-377:Details
✅ Verification successful
Verify all uses of removed functions have been updated.
Based on the PR objectives and AI summary, functions like
load,get,getAll,post, andsubmithave been moved to the newrequestUtilsnamespace. Let's verify that all imports in dependent files have been updated to reference these functions from the new namespace.
🏁 Script executed:
#!/bin/bash # Search for any remaining direct imports from MaxXmlRequest that might need to be updated echo "Checking for imports from MaxXmlRequest..." rg -A 3 "import.*from ['\"]\.\./util/MaxXmlRequest['\"]" --glob "*.ts" --glob "*.tsx" # Check for any uses of the old functions that might not have been updated echo "Checking for potentially missed function usages..." rg "\b(get|getAll|load|submit|post)\(" --glob "*.ts" --glob "*.tsx" | grep -v "requestUtils" | grep -v "MaxXmlRequest.ts"Length of output: 10727
All network request function updates verified
The verification confirms that the removed functions from MaxXmlRequest (i.e.,
load,get,getAll,post, andsubmit) have been correctly migrated. In particular:
- In packages/core/src/i18n/Translations.ts, the old direct import from MaxXmlRequest is now a type import, and the functional imports (
get,load) are correctly sourced from the newrequestUtilsnamespace.- The search did not uncover any remaining call sites referencing the removed functions in a problematic way—most instances of methods like
get()andload()in other files belong to unrelated, context-specific utilities or local implementations.No further changes appear necessary.
🧰 Tools
🪛 Biome (1.9.4)
[error] 121-121: Expected an identifier, a string literal, a number literal, a private field name, or a computed name but instead found ':'.
Expected an identifier, a string literal, a number literal, a private field name, or a computed name here.
(parse)
[error] 253-253: Don't use 'Function' as a type.
Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.
(lint/complexity/noBannedTypes)
[error] 254-254: Don't use 'Function' as a type.
Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.
(lint/complexity/noBannedTypes)
[error] 256-256: Don't use 'Function' as a type.
Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.
(lint/complexity/noBannedTypes)
24-26:Details
✅ Verification successful
Verify that the referenced utility functions exist in requestUtils.
The documentation still references
get,getAll,post, andloadfunctions which were removed from this file. Since this PR moves these functions to a newrequestUtilsnamespace, ensure they're properly implemented there.
🏁 Script executed:
#!/bin/bash # Check if the removed functions exist in the requestUtils.ts file echo "Checking for requestUtils.ts file..." fd -t f "requestUtils.ts" --exec grep -E "export function (get|getAll|post|load|submit)" {} \;Length of output: 180
Please run the above script to verify if the utility functions (get, getAll, post, load) are exported from the
requestUtils.tsfile using alternative export syntaxes (e.g., as arrow functions or const assignments). If this script still produces no output, then manual verification is required to confirm that these functions are implemented as part of the newrequestUtilsnamespace.
🏁 Script executed:
#!/bin/bash echo "Searching for exported functions (using various export syntaxes) for get, getAll, post, load in requestUtils.ts..." fd -t f "requestUtils.ts" --exec grep -E "export\s+(function|const|let)\s+(get|getAll|post|load)\b" {} \;Length of output: 468
Verified: The utility functions are now correctly implemented in the
requestUtils.tsfile.
- The functions
get,getAll,post, andloadare all properly exported as shown by the grep output.- Please ensure that the documentation references (e.g., the
@linkannotations) inMaxXmlRequest.tsare updated if necessary to point to their new location in therequestUtilsnamespace.
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
packages/core/src/gui/guiUtils.ts (2)
33-86: Refine thepopupfunction handling & consider merging the duplicated window logic.Overall, the logic for displaying content in an internal or external window is clean. However, both code paths (lines 69–75 vs. 76–85) contain nearly identical steps for opening a window and inserting content. In a future refactor, consolidating the repeated logic could simplify maintenance. Additionally, some styling details (e.g., fixed widths and heights, scrollbar usage) may benefit from a more responsive or configurable approach.
99-157: Use CSS instead of the non-standardvalignHTML attribute & consider small naming adjustments.The error display function is well-structured, with proper image and optional close button logic. However, note that
'valign'is not a standard HTML5 attribute (line 110). Replacing it with a CSS approach (e.g.,vertical-align: bottom;) preserves cross-browser compatibility. Also, you might consider renamingwarnto something more descriptive likeerrorWindowfor clarity. Implementation updates can be safely tackled in a later PR, as the function is otherwise correct.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/core/src/gui/guiUtils.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: tbouffard
PR: maxGraph/maxGraph#740
File: packages/core/src/util/requestUtils.ts:79-106
Timestamp: 2025-03-31T08:32:17.055Z
Learning: PR #740 is focused on reorganizing code into namespaces (guiUtils and requestUtils) without changing any implementations. Implementation improvements should be suggested for future PRs.



Introduce
guiUtilsandrequestUtilsto hold functions that previously lived alone.By convention, only the global configuration functions live outside a namespace.
BREAKING CHANGES: some functions are now accessible via a namespace:
get,getAll,load,post,submitviarequestUtilserror,popupviaguiUtilsSummary by CodeRabbit