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

Rethrow functions esbuild errors #5231

Merged
merged 2 commits into from
Jan 21, 2025

Conversation

isaacroldan
Copy link
Contributor

@isaacroldan isaacroldan commented Jan 17, 2025

WHY are these changes introduced?

We want ESBuild errors from functions to appear in the dev logs.

WHAT is this pull request doing?

If a javascript function throws an ESBuild error, re-throw as it is and the dev-session will automatically parse and format it.

How to test your changes?

  1. Create a javascript function extension
  2. Run dev
  3. Modify the function to have some syntax error.
  4. See that the error is properly shown in the dev log, with specific details on where it happened.

Measuring impact

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

Copy link
Contributor

github-actions bot commented Jan 17, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
75.2% (+0.01% 🔼)
8894/11827
🟡 Branches
70.44% (+0.02% 🔼)
4334/6153
🟡 Functions 75.01% 2335/3113
🟡 Lines
75.76% (+0.01% 🔼)
8405/11094

Test suite run success

2004 tests passing in 905 suites.

Report generated by 🧪jest coverage report action from 8938052

@isaacroldan isaacroldan marked this pull request as ready for review January 17, 2025 16:40
@isaacroldan isaacroldan requested a review from a team as a code owner January 17, 2025 16:40
Copy link
Contributor

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run "pnpm changeset add" to track your changes and include them in the next release CHANGELOG.

@isaacroldan isaacroldan force-pushed the 01-17-rethrow_functions_esbuild_errors branch from 23d656e to a1b5698 Compare January 17, 2025 17:15
Copy link
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/common/version.d.ts
@@ -1 +1 @@
-export declare const CLI_KIT_VERSION = "3.74.0";
\ No newline at end of file
+export declare const CLI_KIT_VERSION = "3.73.0";
\ No newline at end of file
packages/cli-kit/dist/public/node/notifications-system.d.ts
@@ -166,11 +166,25 @@ export type Notifications = zod.infer<typeof NotificationsSchema>;
  */
 export declare function showNotificationsIfNeeded(currentSurfaces?: string[], environment?: NodeJS.ProcessEnv): Promise<void>;
 /**
- * Get notifications list from cache (refreshed every hour) or fetch it if not present.
+ * Get notifications list from cache, that is updated in the background from bin/fetch-notifications.json.
  *
  * @returns A Notifications object.
  */
 export declare function getNotifications(): Promise<Notifications>;
+/**
+ * Fetch notifications from the CDN and chache them.
+ *
+ * @returns A string with the notifications.
+ */
+export declare function fetchNotifications(): Promise<Notifications>;
+/**
+ * Fetch notifications in background as a detached process.
+ *
+ * @param currentCommand - The current Shopify command being run.
+ * @param argv - The arguments passed to the current process.
+ * @param environment - Process environment variables.
+ */
+export declare function fetchNotificationsInBackground(currentCommand: string, argv?: string[], environment?: NodeJS.ProcessEnv): void;
 /**
  * Filters notifications based on the version of the CLI.
  *
packages/cli-kit/dist/public/node/system.d.ts
@@ -12,6 +12,7 @@ export interface ExecOptions {
     input?: string;
     signal?: AbortSignal;
     externalErrorHandler?: (error: unknown) => Promise<void>;
+    background?: boolean;
 }
 /**
  * Opens a URL in the user's default browser.

Base automatically changed from 01-17-don_t_start_the_dev_session_if_there_are_build_errors to main January 21, 2025 12:21
@isaacroldan isaacroldan added this pull request to the merge queue Jan 21, 2025
Merged via the queue into main with commit 850358c Jan 21, 2025
28 checks passed
@isaacroldan isaacroldan deleted the 01-17-rethrow_functions_esbuild_errors branch January 21, 2025 12:28
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