Skip to content
This repository has been archived by the owner on May 3, 2023. It is now read-only.

Commit

Permalink
fix(deprecation): note that jetifier is deprecated, warn on translations
Browse files Browse the repository at this point in the history
react-native CLI is in discussions to stop using jetifier by default, as
AndroidX transition should be done
  • Loading branch information
mikehardy committed May 3, 2021
1 parent 2ab90d2 commit a027dd0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Expand Up @@ -11,6 +11,7 @@ const SEARCH_DIR = 'node_modules';
const classesMapping = getClassesMapping();
const files = readDir(SEARCH_DIR);

console.warn('Jetifier is deprecated. Future versions of react-native CLI may not run it by default.')
console.log(`Jetifier found ${files.length} file(s) to ${mode}-jetify. Using ${cpus} workers...`);

for (const filesChunk of chunk(files, cpus)) {
Expand Down
1 change: 1 addition & 0 deletions src/worker.js
Expand Up @@ -6,6 +6,7 @@ process.on('message', ({ filesChunk, classesMapping, mode }) => {
let data = readFileSync(file, { encoding: 'utf8' });
for (const [oldClass, newClass] of classesMapping) {
if (data.includes(mode === 'forward' ? oldClass : newClass)) {
console.warn(`Jetifier: propose an AndroidX conversion PR to this repository: ${file}`)
data = mode === 'forward' ?
data.replace(new RegExp(oldClass, 'g'), newClass) :
data.replace(new RegExp(newClass, 'g'), oldClass);
Expand Down

0 comments on commit a027dd0

Please sign in to comment.