Skip to content
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

Fix weaverseData being cached when url search queries changes #375

Merged
merged 3 commits into from
Aug 15, 2024
Merged

Conversation

paul-phan
Copy link
Member

@paul-phan paul-phan commented Aug 15, 2024

Summary by CodeRabbit

  • New Features

    • Added changelog entries for version 3.4.1 across multiple packages, documenting updates and enhancements.
  • Bug Fixes

    • Improved caching behavior for weaverseData, ensuring it updates correctly with URL changes.
  • Chores

    • Incremented version numbers for @weaverse/core, @weaverse/hydrogen, @weaverse/react, and @weaverse/shopify packages to 3.4.1 for better version management.

@paul-phan paul-phan requested a review from hta218 August 15, 2024 09:53
Copy link

coderabbitai bot commented Aug 15, 2024

Important

Review skipped

Review was skipped due to path filters

Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The recent changes across the @weaverse packages involve minor version updates, primarily from 3.4.0 to 3.4.1, reflecting bug fixes and dependency updates. Key improvements include enhancements to caching behavior in @weaverse/hydrogen, ensuring accurate data retrieval based on URL changes. The changelogs for each package have been updated to document these changes, maintaining consistency and clarity in version tracking.

Changes

Files Change Summary
packages/core/CHANGELOG.md Added new section for version 3.4.1 to document updates and enhancements.
packages/core/package.json Version updated from 3.4.0 to 3.4.1.
packages/hydrogen/CHANGELOG.md Added section for version 3.4.1, noting fix for weaverseData caching behavior.
packages/hydrogen/package.json Version updated from 3.4.0 to 3.4.1; dependency on @weaverse/react also updated to 3.4.1.
packages/hydrogen/src/context.ts Enhanced logic in createCachedWeaverseInstance to improve instance creation based on request info.
packages/react/CHANGELOG.md New entry for version 3.4.1, documenting dependency update to @weaverse/[email protected].
packages/react/package.json Version updated from 3.4.0 to 3.4.1; dependency on @weaverse/core updated to 3.4.1.
packages/shopify/CHANGELOG.md New section for version 3.4.1, highlighting update of @weaverse/react dependency to 3.4.1.
packages/shopify/package.json Version updated from 3.4.0 to 3.4.1; dependency on @weaverse/react updated to 3.4.1.
templates/pilot Updated subproject commit identifier reflecting changes in the subproject state.

Poem

🐰 In the garden where we play,
Changes bloom, bright as day!
Version hops from three to four,
Bugs are fixed, and we explore!
With each patch, our code's a delight,
Come join the dance, it's a joyful sight! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7ce56f8 and 3768a20.

Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing (10)
  • packages/core/CHANGELOG.md (1 hunks)
  • packages/core/package.json (1 hunks)
  • packages/hydrogen/CHANGELOG.md (1 hunks)
  • packages/hydrogen/package.json (2 hunks)
  • packages/hydrogen/src/context.ts (1 hunks)
  • packages/react/CHANGELOG.md (1 hunks)
  • packages/react/package.json (2 hunks)
  • packages/shopify/CHANGELOG.md (1 hunks)
  • packages/shopify/package.json (2 hunks)
  • templates/pilot (1 hunks)
Files skipped from review due to trivial changes (9)
  • packages/core/CHANGELOG.md
  • packages/core/package.json
  • packages/hydrogen/CHANGELOG.md
  • packages/hydrogen/package.json
  • packages/react/CHANGELOG.md
  • packages/react/package.json
  • packages/shopify/CHANGELOG.md
  • packages/shopify/package.json
  • templates/pilot
Additional comments not posted (1)
packages/hydrogen/src/context.ts (1)

30-34: Enhance caching logic with additional conditions.

The updated logic in createCachedWeaverseInstance now checks if the pathname and search properties of requestInfo have changed. This ensures that a new WeaverseHydrogen instance is created when these properties differ, improving the accuracy of cached data retrieval based on URL changes. This change aligns with the PR objective to fix caching issues when the URL search query changes.

Copy link
Member

@hta218 hta218 left a comment

Choose a reason for hiding this comment

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

I remember doing this before, create new weaverse instance whenever the url changes (handle or request queries changes..). Then we update to just create 1 instance for each page data, and now looks like we're back. Don't know if any issues could occurs, lets just merged to test 😂🤟

@hta218 hta218 changed the title Fix weaverseData being cached when url search query changes Fix weaverseData being cached when url search query changes Aug 15, 2024
@hta218 hta218 changed the title Fix weaverseData being cached when url search query changes Fix weaverseData being cached when url search queries changes Aug 15, 2024
paul-phan and others added 2 commits August 15, 2024 20:13
@hta218 hta218 merged commit 9a4b72e into main Aug 15, 2024
2 checks passed
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.

2 participants