Skip to content

Conversation

@MinCrohn
Copy link
Collaborator

@MinCrohn MinCrohn commented May 29, 2025

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:

<script src="https://pixijs.download/v8.9.2/pixi.min.js"></script>
<script src="./dist/index.umd.js"></script>

Copy link

@gemini-code-assist gemini-code-assist bot left a 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.json file is updated to include a new umd field, pointing to the location of the generated UMD bundle.
  • Typo Fix: A minor typo (exportess corrected to exports) 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.
  • rollup.config.mjs
    • Added a new output configuration block for the umd format.
    • Configured the UMD output file to be pkg.umd (which resolves to dist/index.umd.js).
    • Set the global variable name for the UMD build to Patchmap.
    • Enabled inlineDynamicImports: true for the UMD build.
    • Corrected a typo from exportess to exports in the CJS output configuration.
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

  1. 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.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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 (exportess instead of exports) 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 Patchmap as 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.

@MinCrohn MinCrohn merged commit 1ec6ddf into main May 29, 2025
@MinCrohn MinCrohn deleted the fix/browser-format branch May 29, 2025 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Direct browser script inclusion fails

2 participants