Skip to content

Conversation

@jpoehnelt
Copy link
Member

@jpoehnelt jpoehnelt commented Dec 9, 2025

@changeset-bot
Copy link

changeset-bot bot commented Dec 9, 2025

🦋 Changeset detected

Latest commit: 535e7e8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@googleworkspace/drive-picker-react Minor
@googleworkspace/drive-picker-element Patch
react-example Patch
csp-example Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jpoehnelt, 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 significantly enhances the @googleworkspace/drive-picker-react component's compatibility with Server-Side Rendering (SSR) environments. The primary goal is to ensure the component functions correctly when rendered on the server by explicitly marking it for client-side execution and implementing dynamic loading for its browser-dependent parts. Concurrently, the documentation has been refined to guide developers on integrating these components effectively within SSR frameworks and to reflect the removal of an outdated Svelte demo.

Highlights

  • SSR Support for React Component: The @googleworkspace/drive-picker-react package now explicitly supports Server-Side Rendering (SSR) by enforcing client-side rendering using the "use client" directive and dynamically importing the underlying web component, ensuring compatibility with frameworks like Next.js.
  • Documentation Updates: The README.md files have been updated across both the @googleworkspace/drive-picker-element and @googleworkspace/drive-picker-react packages. The core element's README now points to an internal React section and removes the Svelte demo, while the React wrapper's README includes a new, detailed section on SSR usage, complete with a Next.js example.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 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

  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.

@jpoehnelt jpoehnelt changed the title fix/ssr fix: Add SSR support by enforcing client-side rendering and using dynamic imports Dec 9, 2025
Copy link
Contributor

@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

The pull request successfully introduces Server-Side Rendering (SSR) compatibility for the React Drive Picker components. This is achieved by correctly applying the "use client" directive and dynamically importing the underlying web component within a useEffect hook, ensuring browser-specific API usage is deferred to the client-side. The accompanying documentation updates in the README files clearly explain the SSR considerations and remove the outdated Svelte demo. Overall, the changes align with the stated objective.

@jpoehnelt
Copy link
Member Author

/gemini review

Copy link
Contributor

@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 adds Server-Side Rendering (SSR) support for the @googleworkspace/drive-picker-react component by using dynamic imports to ensure the underlying web component is only loaded on the client. It also introduces error handling for when the web component fails to load. The changes are logical and well-tested.

My main feedback is a critical fix for the new loader.ts file to prevent a potential infinite render loop in the DrivePicker component. While a general rule suggests avoiding promise-caching for idempotent script injection, it is necessary here to prevent a critical bug.

@jpoehnelt jpoehnelt merged commit 5d13681 into main Dec 9, 2025
22 checks passed
@jpoehnelt jpoehnelt deleted the fix/ssr branch December 9, 2025 17:02
@jpoehnelt
Copy link
Member Author

Decided to ignore error handling until further feedback is received.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant