Skip to content

Conversation

mfisher87
Copy link
Member

@mfisher87 mfisher87 commented Jun 30, 2025

Description

Many of our functional components had typed props, but did not type the entire component itself (this left the return value untyped). This PR types those components as React.FC, which implicitly adds the JSX element return type.

Thanks to GPT-4.1 agent for completing this task in <1 minute ;) GPT missed a lot and eventually went in to a wild spiral of wrongness (including deleting huge chunks of code and claiming it was already like that) trying to complete the task. Claude finished the job just fine, but took a bit longer. Good tradeoff IMO.

This PR may cause some conflicts for other open PRs, but I feel they will be simple conflicts to resolve as all changes are mechanical edits to existing function signatures. No behavior changes.

Checklist

  • PR has a descriptive title and content.
  • PR description contains references to any issues the PR resolves, e.g. Resolves #XXX.
  • PR has one of the labels: documentation, bug, enhancement, feature, maintenance
  • Checks are passing.
    Failing lint checks can be resolved with:
    • pre-commit run --all-files
    • jlpm run lint

📚 Documentation preview: https://jupytergis--791.org.readthedocs.build/en/791/
💡 JupyterLite preview: https://jupytergis--791.org.readthedocs.build/en/791/lite

Copy link
Contributor

Binder 👈 Launch a Binder on branch mfisher87/jupytergis/component-typing

Copy link
Contributor

github-actions bot commented Jun 30, 2025

Integration tests report: appsharing.space

@mfisher87
Copy link
Member Author

mfisher87 commented Jun 30, 2025

The integration test failure is occurring on the main branch :( Currently unclear on the cause.

mfisher87 added 2 commits July 1, 2025 10:05
GPT struggled to finish the job. Claude seems to be doing better.
@mfisher87 mfisher87 enabled auto-merge (squash) July 1, 2025 16:42
@mfisher87 mfisher87 changed the title Add react component typings Add React component typings Jul 1, 2025
@mfisher87 mfisher87 changed the title Add React component typings Add React component type annotations Jul 1, 2025
Copy link
Member

@martinRenou martinRenou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mfisher87 mfisher87 merged commit 5a93217 into geojupyter:main Jul 2, 2025
19 checks passed
@mfisher87 mfisher87 deleted the component-typing branch July 2, 2025 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants