Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor changes in Diagnostics view, RNIDE tabs and InspectDataMenu #548

Merged
merged 22 commits into from
Sep 19, 2024

Conversation

p-malecki
Copy link
Contributor

@p-malecki p-malecki commented Sep 17, 2024

This PR includes the following changes:

  • Hides errors related to optional dependencies in the Diagnostics view
  • Marks expo as an optional dependency for projects that do not use it
  • Improves responsiveness of InspectDataMenu on smaller tabs
  • Modifies file opening to use tabs distinct from the RNIDE tab
  • Sets the go home button to always be enabled
  • Adds scroll to Modal

screenshots:
Screenshot 2024-09-16 at 11 39 53

Copy link

vercel bot commented Sep 17, 2024

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

Name Status Preview Comments Updated (UTC)
react-native-ide ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 19, 2024 8:08am

Copy link
Collaborator

@filip131311 filip131311 left a comment

Choose a reason for hiding this comment

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

I left some inline comments

Comment on lines 467 to 491
export function isExpoProject() {
// determine if a project is an Expo project based on dependencies and scripts in package.json
const appRoot = getAppRootFolder();
const config = getLaunchConfiguration();

if (config.isExpo) {
return true;
}

const packageJson = requireNoCache(path.join(appRoot, "package.json"));
let hasExpoCLInDependencies = false;
try {
hasExpoCLInDependencies =
Object.keys(packageJson.dependencies).some((dependency) => dependency === "expo") ||
Object.keys(packageJson.devDependencies).some((dependency) => dependency === "expo");
} catch (e) {}

let hasExpoCommandsInScripts = false;
try {
hasExpoCommandsInScripts = Object.values<string>(packageJson.scripts).some((script: string) =>
script.includes("expo ")
);
} catch (e) {}
return hasExpoCLInDependencies && hasExpoCommandsInScripts;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

there is a more reliable mechanism for that in metro.ts file called shouldUseExpoCLI()

const activeRNIDEColumn = window.tabGroups.all.find(
(group) => group.activeTab?.label === "React Native IDE"
)?.viewColumn;
const column = activeRNIDEColumn === ViewColumn.One ? ViewColumn.Beside : ViewColumn.One;
Copy link
Collaborator

Choose a reason for hiding this comment

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

what would happen if you always used Beside? wouldn't it perform the logic for you?

Copy link
Contributor Author

@p-malecki p-malecki Sep 18, 2024

Choose a reason for hiding this comment

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

The documentation says about Beside ViewColumn: A symbolic editor column representing the column to the side of the active one. but that side seems to always be on the right of Radon so it doesn't work with two tabs setup where Radon is on the right and code on the left, nor vertical two tabs layout, because Beside in those cases opens tab in new column.

Copy link
Collaborator

@filip131311 filip131311 left a comment

Choose a reason for hiding this comment

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

I approved but please adres inline comments

@@ -8,6 +8,7 @@ import { getAppRootFolder } from "../utilities/extensionContext";
import path from "path";
import { getIosSourceDir } from "../builders/buildIOS";
import { isExpoGoProject } from "../builders/expoGo";
import { shouldUseExpoCLI } from "../../src/project/metro";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please move this function to utils and import in booth places I don't see the reason for it to live i metro files specifically

@p-malecki p-malecki merged commit 1e44788 into main Sep 19, 2024
3 checks passed
@p-malecki p-malecki deleted the @p-malecki/minor-ui-fixes branch September 19, 2024 08:10
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.

2 participants