Skip to content

chore(react): export process in exports internal#1719

Merged
hzy merged 1 commit intolynx-family:mainfrom
hzy:p/hzy/internal-export-process
Sep 11, 2025
Merged

chore(react): export process in exports internal#1719
hzy merged 1 commit intolynx-family:mainfrom
hzy:p/hzy/internal-export-process

Conversation

@hzy
Copy link
Copy Markdown
Collaborator

@hzy hzy commented Sep 11, 2025

Summary by CodeRabbit

  • New Features
    • Exposes an additional runtime API for advanced integrations, improving compatibility with libraries that expect environment/process access.
    • Backward compatible: no changes to existing options or behavior; current integrations continue to work as before.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).
  • Changeset added, and when a BREAKING CHANGE occurs, it needs to be clearly marked (or not required).

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Sep 11, 2025

⚠️ No Changeset found

Latest commit: 6b0d731

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Sep 11, 2025

📝 Walkthrough

Walkthrough

Adds the preact symbol process to the React runtime internal export surface in both the TypeScript source and the lazy runtime bridge without other logic changes.

Changes

Cohort / File(s) Summary
React runtime internals export update
packages/react/runtime/src/internal.ts, packages/react/runtime/lazy/internal.js
Include process in exported members: TS source now re-exports { options, Component, process } from preact; lazy internal destructure adds process alongside existing members. No other edits.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

framework:React

Suggested reviewers

  • colinaaa

Poem

A twitch of whiskers, hop of delight,
We added “process” to shine in the light.
Exports aligned, no fuss, no mess—
Little carrots of cleanliness. 🥕
Now runtime paths are neatly in sync,
A happy hare gives a knowing wink. 🐇✨

Pre-merge checks (3 passed)

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The current title "chore(react): export process in exports internal" accurately describes the primary change — adding a process export to the React runtime internal exports (packages/react/runtime/src/internal.ts and packages/react/runtime/lazy/internal.js). It is concise, uses a standard "chore(react):" prefix, and points reviewers to the affected area. The wording could be slightly clearer grammatically but still conveys the main intent.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

@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

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d618304 and 6b0d731.

📒 Files selected for processing (2)
  • packages/react/runtime/lazy/internal.js (1 hunks)
  • packages/react/runtime/src/internal.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: colinaaa
PR: lynx-family/lynx-stack#1238
File: packages/react/runtime/src/debug/component-stack.ts:70-90
Timestamp: 2025-07-18T04:27:18.291Z
Learning: The component-stack.ts file in packages/react/runtime/src/debug/component-stack.ts is a direct fork from https://github.com/preactjs/preact/blob/main/debug/src/component-stack.js. The team prefers to keep it aligned with the upstream Preact version and may contribute improvements back to Preact in the future.
📚 Learning: 2025-07-18T04:27:18.291Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#1238
File: packages/react/runtime/src/debug/component-stack.ts:70-90
Timestamp: 2025-07-18T04:27:18.291Z
Learning: The component-stack.ts file in packages/react/runtime/src/debug/component-stack.ts is a direct fork from https://github.com/preactjs/preact/blob/main/debug/src/component-stack.js. The team prefers to keep it aligned with the upstream Preact version and may contribute improvements back to Preact in the future.

Applied to files:

  • packages/react/runtime/src/internal.ts
🔇 Additional comments (2)
packages/react/runtime/lazy/internal.js (1)

25-25: Avoid shadowing the global process (alias and re-export instead)

Destructuring process creates a local binding that shadows Node’s global — alias the imported value and re-export it to preserve the public export without a local process identifier.

Apply:

-  process,
+  process: preactProcess,

Then add:

export { preactProcess as process };

Confirm that target[sExportsReactInternal] actually exposes a process property at runtime (otherwise the export will be undefined).

packages/react/runtime/src/internal.ts (1)

37-42: LGTM: internal surface parity with lazy bridge.

Adding process alongside options/Component aligns the TS surface with the lazy internal export; no logic changes.

Comment thread packages/react/runtime/src/internal.ts
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Sep 11, 2025

CodSpeed Performance Report

Merging #1719 will not alter performance

Comparing hzy:p/hzy/internal-export-process (6b0d731) with main (d618304)

Summary

✅ 53 untouched benchmarks

@relativeci
Copy link
Copy Markdown

relativeci Bot commented Sep 11, 2025

Web Explorer

#5103 Bundle Size — 362.79KiB (0%).

6b0d731(current) vs 2800dce main#5090(baseline)

Bundle metrics  Change 1 change
                 Current
#5103
     Baseline
#5090
No change  Initial JS 145.21KiB 145.21KiB
No change  Initial CSS 31.89KiB 31.89KiB
No change  Cache Invalidation 0% 0%
No change  Chunks 8 8
No change  Assets 8 8
No change  Modules 219 219
No change  Duplicate Modules 16 16
Change  Duplicate Code 3.34%(+0.3%) 3.33%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#5103
     Baseline
#5090
No change  JS 236.88KiB 236.88KiB
No change  Other 94.02KiB 94.02KiB
No change  CSS 31.89KiB 31.89KiB

Bundle analysis reportBranch hzy:p/hzy/internal-export-proces...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented Sep 11, 2025

React Example

#5110 Bundle Size — 238.2KiB (0%).

6b0d731(current) vs 2800dce main#5097(baseline)

Bundle metrics  no changes
                 Current
#5110
     Baseline
#5097
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 163 163
No change  Duplicate Modules 67 67
No change  Duplicate Code 46.88% 46.88%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#5110
     Baseline
#5097
No change  IMG 145.76KiB 145.76KiB
No change  Other 92.45KiB 92.45KiB

Bundle analysis reportBranch hzy:p/hzy/internal-export-proces...Project dashboard


Generated by RelativeCIDocumentationReport issue

@hzy hzy requested review from Yradex and colinaaa September 11, 2025 09:43
@hzy hzy enabled auto-merge (squash) September 11, 2025 12:07
@hzy hzy merged commit 4200c29 into lynx-family:main Sep 11, 2025
82 of 86 checks passed
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