Skip to content

feat/import-alias#4868

Open
azizbecha wants to merge 4 commits intocallstack:mainfrom
azizbecha:feat/import-alias
Open

feat/import-alias#4868
azizbecha wants to merge 4 commits intocallstack:mainfrom
azizbecha:feat/import-alias

Conversation

@azizbecha
Copy link
Collaborator

Motivation

This PR migrates the entire codebase to use the @/ import alias for internal source files to replace noisy ../../../'s and improve maintainability.

// Before:
import { black } from './../../styles/themes/v2/colors';

// After
import { black } from '@/styles/themes/v2/colors';

Related issue

Closes #4861

Test plan

  • Tests Pass (yarn test)
  • Linting Pass (yarn lint)
  • TypeScript check pass (yarn typescript)
  • Building pass (yarn prepack)
  • Example app works well (yarn prepack && yarn example && cd example && yarn web)

@callstack-bot
Copy link

Hey @azizbecha, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

Copy link
Member

@satya164 satya164 left a comment

Choose a reason for hiding this comment

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

The compiled code likely still keeps the aliases, which will break the library for consumers. Please double-check this and test it.

If you want to use aliases, use package.json#imports instead, which is supported by most tools without configuration and localized to the specific package. However, using them means requiring a newer Metro/React Native version, which is a breaking change.

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.

Use import aliases

3 participants