-
Notifications
You must be signed in to change notification settings - Fork 0
fix: introduce build output for direct browser use #100
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
Conversation
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.
Hello @MinCrohn, 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!
Summary of Changes
Hello! Gemini here, providing a summary of this pull request authored by MinCrohn. This PR aims to introduce a build output specifically designed for direct use in a browser environment, addressing the need for a Universal Module Definition (UMD) bundle. This makes the library accessible via a simple <script> tag, which is useful for environments that don't use module bundlers. The changes involve updating the project's build configuration to generate this new output format.
Highlights
- UMD Build Output: The primary change is the addition of a UMD build target, allowing the library to be used directly in browsers without requiring a module loader or bundler.
- Build Configuration Update: The Rollup configuration has been updated to include the UMD output format, specifying the output file name, format, and a global variable name ('Patchmap') for browser access.
- Package.json Update: The
package.jsonfile is updated to include a newumdfield, pointing to the location of the generated UMD bundle. - Typo Fix: A minor typo (
exportesscorrected toexports) was fixed in the Rollup configuration for the CJS output.
Changelog
- package.json
- Added the
"umd": "dist/index.umd.js"field to specify the UMD build output path.
- Added the
- rollup.config.mjs
- Added a new output configuration block for the
umdformat. - Configured the UMD output file to be
pkg.umd(which resolves todist/index.umd.js). - Set the global variable name for the UMD build to
Patchmap. - Enabled
inlineDynamicImports: truefor the UMD build. - Corrected a typo from
exportesstoexportsin the CJS output configuration.
- Added a new output configuration block for the
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and 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 to provide feedback.
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.
Code built for the web,
Runs in browser, no complex setup,
UMD makes it free.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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 successfully introduces a UMD build output for the library, which is a valuable addition for enabling direct browser usage. The changes in package.json and rollup.config.mjs are clear and implement this new build format effectively. Additionally, a typo in the Rollup configuration has been corrected, improving the CJS build's reliability. Overall, these changes enhance the library's versatility and maintainability.
Summary of Findings
- Rollup Configuration Typo Corrected: A typo (
exportessinstead ofexports) in the Rollup configuration for the CJS build was corrected. This is an important fix to ensure the CJS module correctly uses named exports and avoids potential misconfigurations or warnings during the build process. - UMD Build Introduction: A UMD (Universal Module Definition) build output has been successfully added. This is configured for direct browser use, exposing
Patchmapas the global variable and inlining dynamic imports, which should make the library easier to use via a simple<script>tag.
Merge Readiness
The changes in this pull request look good. The introduction of the UMD build is well-implemented, and the correction of the typo in the Rollup configuration improves the existing CJS build. I believe these changes are ready for merging. As always, ensure any relevant CI checks pass and consider if further testing of the UMD bundle in a browser environment is warranted. I am not authorized to approve the pull request, so please have another reviewer approve it before merging.
closed: #99
To use this, you need to include both pixi.js and the locally built umd.js file from your patchmap build, as shown below: