Skip to content

Conversation

@avivkeller
Copy link
Member

Description

This PR uses Node.js's native subpath imports in place of the tsconfig.json paths, since these are natively supported

Validation

Nothing should change, everything should build and test correctly

Related Issues

Fixes #7732

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run pnpm format to ensure the code follows the style guide.
  • I have run pnpm test to check if all tests are passing.
  • I have run pnpm build to check if the website builds without errors.

Copilot AI review requested due to automatic review settings May 8, 2025 21:38
@avivkeller avivkeller requested a review from a team as a code owner May 8, 2025 21:38
@vercel
Copy link

vercel bot commented May 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview May 9, 2025 10:48pm

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates all the import statements to use Node.js's native subpath imports instead of the legacy path aliases.

  • Replaced all instances of "@/..." with "#..." to leverage native subpath imports.
  • Updated test files, app routes, and documentation references consistently.

Reviewed Changes

Copilot reviewed 226 out of 226 changed files in this pull request and generated no comments.

Show a summary per file
File Description
apps/site/components/Blog/BlogPostCard/index.tsx Updated blog card component import paths.
apps/site/components/Blog/BlogPostCard/tests/index.test.jsx Updated blog post card test import paths.
apps/site/components/Blog/BlogHeader/index.tsx Updated blog header import paths.
apps/site/components/Blog/BlogHeader/tests/index.test.jsx Updated blog header test import paths.
apps/site/client-context.ts Updated client context imports.
apps/site/app/sitemap.ts Updated sitemap-related imports.
apps/site/app/global-error.tsx Updated global error page component imports.
apps/site/app/[locale]/page.tsx Updated page-level imports for client context, layout, and constants.
apps/site/app/[locale]/not-found.tsx Updated not-found page component imports.
apps/site/app/[locale]/next-data/* Updated various next-data route imports.
apps/site/app/[locale]/layout.tsx Updated layout imports including fonts, theme provider, and styles.
apps/site/app/[locale]/feed/[feed]/route.ts Updated imports for feed route.
apps/site/app/[locale]/error.tsx Updated error page imports.
apps/site/app/[locale]/[...path]/page.tsx Updated dynamic page imports for base page and constants.
COLLABORATOR_GUIDE.md Updated documentation paths referring to release types.

@github-actions
Copy link
Contributor

github-actions bot commented May 8, 2025

Lighthouse Results

URL Performance Accessibility Best Practices SEO Report
/en 🟢 99 🟢 100 🟢 100 🟢 91 🔗
/en/about 🟢 100 🟢 100 🟢 100 🟢 91 🔗
/en/about/previous-releases 🟢 99 🟢 100 🟢 100 🟠 83 🔗
/en/download 🟢 98 🟢 100 🟢 100 🟢 91 🔗
/en/blog 🟢 100 🟢 100 🟢 96 🟢 92 🔗

@codecov-commenter
Copy link

codecov-commenter commented May 8, 2025

Codecov Report

Attention: Patch coverage is 91.11111% with 8 lines in your changes missing coverage. Please review.

Project coverage is 74.84%. Comparing base (862c078) to head (f465df7).
Report is 4 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/site/reducers/releaseReducer.ts 0.00% 1 Missing ⚠️
apps/site/util/assignClientContext.ts 0.00% 1 Missing ⚠️
apps/site/util/blogUtils.ts 0.00% 1 Missing ⚠️
apps/site/util/detectOS.ts 0.00% 1 Missing ⚠️
apps/site/util/getUserPlatform.ts 0.00% 1 Missing ⚠️
...Common/BasePagination/PaginationListItem/index.tsx 0.00% 1 Missing ⚠️
...nents/Common/BasePagination/useGetPageElements.tsx 80.00% 1 Missing ⚠️
packages/ui-components/Icons/Logos/JsWhite.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7735      +/-   ##
==========================================
- Coverage   74.84%   74.84%   -0.01%     
==========================================
  Files          98       98              
  Lines        7888     7891       +3     
  Branches      200      200              
==========================================
+ Hits         5904     5906       +2     
- Misses       1983     1984       +1     
  Partials        1        1              

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@MattIPv4
Copy link
Member

MattIPv4 commented May 9, 2025

Perhaps bikeshedding, but personally I would prefer #/ rather than #, if that's an option?

@avivkeller
Copy link
Member Author

avivkeller commented May 9, 2025

I just tried that, assuming it would work, and it looks like / can not immediately follow the #. However, something like #@/ would work. (Or like #site/ and #ui/, etc)

https://github.com/nodejs/node/blob/daced4ab98be82953ef2fa73e0f81e2b1967be8b/test/es-module/test-esm-imports.mjs#L67

@avivkeller
Copy link
Member Author

I went with #site/ and #ui/ for the different parts of the repo.

@MattIPv4
Copy link
Member

MattIPv4 commented May 9, 2025

👍 That satisfies my brain -- I think I just didn't like the bare # on its own

Copy link
Member

@dario-piotrowicz dario-piotrowicz left a comment

Choose a reason for hiding this comment

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

Looks good to me 🙂

Copy link
Member

@bjohansebas bjohansebas left a comment

Choose a reason for hiding this comment

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

LGTM

@avivkeller avivkeller added this pull request to the merge queue May 10, 2025
Merged via the queue into main with commit bf334d9 May 10, 2025
16 checks passed
@avivkeller avivkeller deleted the chore/subpath-imports branch May 10, 2025 17:35
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.

Move from tsconfig.json paths to Subpath imports

7 participants