Skip to content

feat: React Native SDK update for version 0.27.0#95

Merged
ChiragAgg5k merged 2 commits intomainfrom
dev
Mar 31, 2026
Merged

feat: React Native SDK update for version 0.27.0#95
ChiragAgg5k merged 2 commits intomainfrom
dev

Conversation

@ChiragAgg5k
Copy link
Copy Markdown
Member

@ChiragAgg5k ChiragAgg5k commented Mar 31, 2026

This PR contains updates to the React Native SDK for version 0.27.0.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 31, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7a79e0f0-e61a-4622-af6d-5bbd6e9dda25

📥 Commits

Reviewing files that changed from the base of the PR and between bb52078 and 1a24fa0.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • .gitignore
  • src/client.ts
✅ Files skipped from review due to trivial changes (1)
  • .gitignore

Walkthrough

This PR updates CI to use npm ci in the GitHub Actions workflow, adds a .gitignore, bumps package version to 0.27.0 in package.json, updates the default x-sdk-version header to 0.27.0 in src/client.ts, and adds a new public Client.getHeaders() method returning a shallow copy of the internal headers. CHANGELOG.md is updated documenting the new method and tracking package-lock.json.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change—a version update to 0.27.0 across the SDK with a new getHeaders() method, matching the changeset content.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@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: 1

🧹 Nitpick comments (1)
src/client.ts (1)

168-170: Consider adding JSDoc documentation for consistency.

The new getHeaders() method is correctly implemented with a shallow copy to prevent external mutation. However, other public methods in this class (e.g., setEndpoint, setProject) include JSDoc comments describing their purpose and return value.

Suggested documentation
+    /**
+     * Get Headers
+     *
+     * Returns a copy of the current request headers
+     *
+     * `@returns` {Headers}
+     */
     getHeaders(): Headers {
         return { ...this.headers };
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/client.ts` around lines 168 - 170, Add a JSDoc comment for the public
method getHeaders() to match the style used for setEndpoint and setProject:
include a short description (returns a shallow copy of the client's headers to
prevent external mutation), annotate the return type as Headers, and mention
that the copy is shallow so callers should not rely on deep cloning; place the
comment immediately above the getHeaders() method declaration.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.gitignore:
- Around line 2-6: The current .gitignore uses "dist/*" with negations
"!dist/cjs/" and "!dist/esm/" which causes Git to descend into those directories
and track generated files; replace the ignore rule with a recursive ignore like
"dist/**" (or "dist/") and only un-ignore the specific static files you want
tracked (e.g., "!dist/cjs/package.json" and "!dist/esm/package.json"), removing
the directory negations "!dist/cjs/" and "!dist/esm/" so only the package.json
files are included and generated build artifacts remain ignored.

---

Nitpick comments:
In `@src/client.ts`:
- Around line 168-170: Add a JSDoc comment for the public method getHeaders() to
match the style used for setEndpoint and setProject: include a short description
(returns a shallow copy of the client's headers to prevent external mutation),
annotate the return type as Headers, and mention that the copy is shallow so
callers should not rely on deep cloning; place the comment immediately above the
getHeaders() method declaration.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 76fe5db6-4ffe-4238-98ff-a80277a58c9d

📥 Commits

Reviewing files that changed from the base of the PR and between 7def0c8 and bb52078.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • .github/workflows/publish.yml
  • .gitignore
  • CHANGELOG.md
  • package.json
  • src/client.ts

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Mar 31, 2026

Greptile Summary

This PR bumps the React Native SDK to version 0.27.0, introducing a getHeaders() method on the Client class and committing the package-lock.json to version control (paired with a switch from npm install to npm ci in the publish workflow).

  • getHeaders() (src/client.ts) — Returns { ...this.headers }, a correct shallow copy. Because all Headers values are string primitives, the spread is effectively a deep copy and callers cannot mutate internal state. The JSDoc warning ("Handle with care") appropriately signals that the returned object contains live auth credentials.
  • package-lock.json — Lock file is new and its root metadata (name, version, license) correctly mirrors package.json.
  • npm ci in CI (.github/workflows/publish.yml) — Correct pairing with the committed lock file; ensures reproducible installs and will fail fast if package.json and package-lock.json drift out of sync.
  • .gitignore — Standard exclusions for built artifacts; the cascaded negation pattern correctly keeps only the package.json shims inside dist/cjs/ and dist/esm/.

Confidence Score: 5/5

Safe to merge — all changes are small, correct, and well-paired.

No P0 or P1 issues found. The one substantive code change (getHeaders()) is implemented correctly with an appropriate defensive copy, and the CI/lock-file improvements are straightforward and well-reasoned.

No files require special attention.

Important Files Changed

Filename Overview
src/client.ts Adds getHeaders() method that returns a shallow copy of current request headers; implementation is clean and correct since all header values are strings (primitives), making the shallow copy equivalent to a deep copy.
.github/workflows/publish.yml Switches npm install to npm ci in the publish workflow — correct improvement that pairs with adding package-lock.json and ensures deterministic, reproducible installs in CI.
.gitignore New .gitignore that excludes build artifacts (dist/, types/) while preserving the package.json shims inside dist/cjs/ and dist/esm/; pattern is correct for a dual-CJS/ESM npm package.
package-lock.json New lock file (lockfileVersion 3) committed to the repo; root metadata shows correct name, version, and license values matching package.json.
package.json Version bumped to 0.27.0; no other changes.
CHANGELOG.md New 0.27.0 section added documenting the two changes in this PR: the getHeaders() addition and the lock file inclusion.

Reviews (2): Last reviewed commit: "chore: update React Native SDK to 0.27.0" | Re-trigger Greptile

@ChiragAgg5k ChiragAgg5k merged commit 678d5f2 into main Mar 31, 2026
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