-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix: alias path #4868
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
base: master
Are you sure you want to change the base?
fix: alias path #4868
Conversation
Summary of ChangesHello @lxfu1, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a minor but impactful configuration change to the Vite setup for the project's examples. By adding a new alias, Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a new path alias '@' in the Vite configuration for the examples. While this is a common practice, it could lead to inconsistencies in module imports and allow examples to depend on internal, non-public parts of the library. My review feedback focuses on maintaining a single, clear method for imports in the examples to ensure they accurately represent how a consumer would use the library.
| }, | ||
| resolve: { | ||
| alias: { | ||
| '@': path.resolve(__dirname, '../src'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding the '@' alias, which points to the src directory, introduces a second way to import library modules and allows for deep-linking into the source code (e.g., import ... from '@/graph'). This can lead to inconsistencies and create examples that are not representative of how a consumer would use the published package.
To ensure examples reflect real-world usage and rely only on the public API, it's better to exclusively use the '@antv/x6' alias, which correctly simulates a package import. This prevents accidental reliance on internal implementation details. It is recommended to remove this new alias.
Summary of ChangesHello @lxfu1, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses module resolution within the examples project by adding a new alias in the Vite configuration. The "@" alias now points directly to the main source directory, simplifying import paths and enhancing the maintainability of the example codebases. This change ensures that components and utilities from the core library can be easily accessed within the examples without complex relative paths. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a new path alias '@' in the Vite configuration for the examples, which points to the src directory. While this simplifies import paths, using a generic alias like '@' can be ambiguous. My review includes a suggestion to use a more descriptive alias to enhance clarity and prevent potential conflicts.
Description
Motivation and Context
Types of changes
Self Check before Merge