Skip to content

Conversation

jingjing2222
Copy link
Contributor

No description provided.

Copy link

changeset-bot bot commented Jul 23, 2025

🦋 Changeset detected

Latest commit: d08c8bd

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

This PR includes changesets to release 22 packages
Name Type
@granite-js/plugin-radon Patch
babel-preset-granite Patch
create-granite-app Patch
@granite-js/cli Patch
@granite-js/devtools-frontend Patch
@granite-js/image Patch
@granite-js/jest Patch
@granite-js/lottie Patch
@granite-js/mpack Patch
@granite-js/native Patch
@granite-js/plugin-core Patch
@granite-js/plugin-env Patch
@granite-js/plugin-hermes Patch
@granite-js/plugin-micro-frontend Patch
@granite-js/plugin-router Patch
@granite-js/plugin-sentry Patch
@granite-js/react-native Patch
@granite-js/style-utils Patch
@granite-js/utils Patch
@granite-js/deployment-manager Patch
@granite-js/forge-cli Patch
@granite-js/pulumi-aws 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

@jingjing2222 jingjing2222 marked this pull request as draft July 23, 2025 09:47
Copy link

vercel bot commented Jul 23, 2025

Someone is attempting to deploy a commit to the Toss Team on Vercel.

A member of the Team first needs to authorize it.

@jingjing2222 jingjing2222 changed the title Feat/radon feat: radon Plugin Jul 23, 2025
Copy link

codecov bot commented Jul 23, 2025

Codecov Report

❌ Patch coverage is 0.06143% with 6507 lines in your changes missing coverage. Please review.
✅ Project coverage is 1.86%. Comparing base (1c6a3c2) to head (d08c8bd).

Files with missing lines Patch % Lines
.../lib/vendor/RNpolyfill/createReactDevtoolsAgent.js 0.00% 2391 Missing and 1 partial ⚠️
.../src/lib/vendor/RNpolyfill/createRendererConfig.js 0.00% 1826 Missing and 1 partial ⚠️
packages/plugin-radon/src/lib/wrapper.jsx 0.00% 438 Missing and 1 partial ⚠️
...rc/lib/granite_router/granite_navigation_plugin.js 0.00% 273 Missing and 1 partial ⚠️
packages/plugin-radon/src/lib/network.js 0.00% 194 Missing and 1 partial ⚠️
packages/plugin-radon/src/lib/instrumentation.js 0.00% 175 Missing and 1 partial ⚠️
packages/plugin-radon/src/babel.js 0.00% 163 Missing and 1 partial ⚠️
...adon/src/lib/granite_router/navigation_injector.js 0.00% 127 Missing and 1 partial ⚠️
...n/src/lib/granite_router/granite_router_helpers.js 0.00% 106 Missing and 1 partial ⚠️
...c/lib/vendor/RNpolyfill/react_devtools_polyfill.js 0.00% 98 Missing and 1 partial ⚠️
... and 20 more

❌ Your project check has failed because the head coverage (1.86%) is below the target coverage (100.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff            @@
##            main     #63      +/-   ##
========================================
- Coverage   6.43%   1.86%   -4.57%     
========================================
  Files        468     501      +33     
  Lines      21500   74425   +52925     
  Branches     734     767      +33     
========================================
+ Hits        1383    1387       +4     
- Misses     19767   72659   +52892     
- Partials     350     379      +29     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

}

const DEFAULT_OPTIONS: Required<Pick<RadonPluginOptions, 'enablePolyfill'>> = {
enablePolyfill: true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you use require.resolve to load react-native and read its version from package.json, then the system can determine the flag automatically instead of receiving it from the user.

config: {
babel: {
plugins: [
[path.resolve(__dirname, './lib/RNpolyfill/polyfill_babel.cjs'), mergedOptions]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since __dirname is prone to break due to mismatches between development and distribution targets, it should also be registered in the exports field and its exact path should be obtained using require.resolve.

"vitest": "^3.1.3"
},
"peerDependencies": {
"react": "*",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please review the peer configuration again.

format: ['cjs'],
dts: false,
minify: true,
external: ['fs', 'path', '@babel/core', '@babel/template', '@babel/types'],
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the peerDeps are configured correctly, external will be evaluated automatically, so that field is unnecessary.

const content = fs.readFileSync(routerGenPath, 'utf8');
const routes = [];

const importRegex = /import\s+\{\s*Route\s+as\s+_(\w+)Route\s*\}\s+from\s+['"]\.\.\/pages\/([^'"]+)['"]/g;
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you use the TypeScript API, you can retrieve this based on the AST. AST-based traversal seems like a better approach.

config: {
babel: {
plugins: [
[path.resolve(__dirname, './babel.cjs'), {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This part shouldn’t run at granite build, so make sure it’s not included in the build.

"import": "./dist/index.js",
"require": "./dist/index.cjs"
},
"./dist/*": "./dist/*",
Copy link
Collaborator

Choose a reason for hiding this comment

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

example

Suggested change
"./dist/*": "./dist/*",
"./polyfill.js": "./dist/~~/~~",

@gronxb
Copy link
Collaborator

gronxb commented Jul 25, 2025

please update spec

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