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

fix: avoid top-level await #545

Closed
wants to merge 1 commit into from
Closed

fix: avoid top-level await #545

wants to merge 1 commit into from

Conversation

KnorpelSenf
Copy link
Member

Dropping the only instance of TLA

Copy link

codecov bot commented Mar 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 46.08%. Comparing base (c79df4a) to head (018210c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #545   +/-   ##
=======================================
  Coverage   46.08%   46.08%           
=======================================
  Files          19       19           
  Lines        6052     6052           
  Branches      320      320           
=======================================
  Hits         2789     2789           
  Misses       3260     3260           
  Partials        3        3           

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

Copy link
Contributor

@KnightNiwrem KnightNiwrem left a comment

Choose a reason for hiding this comment

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

@KnorpelSenf KnorpelSenf marked this pull request as draft March 22, 2024 17:42
Comment on lines +11 to 13
const res = Deno.permissions.querySync(env);
let namespace: string | undefined = undefined;
if (res.state === "granted") namespace = Deno.env.get(DEBUG);
Copy link
Contributor

@wojpawlik wojpawlik Mar 23, 2024

Choose a reason for hiding this comment

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

Suggested change
const res = Deno.permissions.querySync(env);
let namespace: string | undefined = undefined;
if (res.state === "granted") namespace = Deno.env.get(DEBUG);
const res = Deno.permissions.querySync?.(env);
let namespace: string | undefined = undefined;
if (!res || res.state === "granted") namespace = Deno.env.get(DEBUG);

to accomodate Deno Deploy

@KnorpelSenf
Copy link
Member Author

This is more complicated than I thought, and the benefits are small. I will abandon this.

@KnorpelSenf KnorpelSenf deleted the no-tla branch April 15, 2024 09:12
@KnightNiwrem
Copy link
Contributor

What happened?

@KnorpelSenf
Copy link
Member Author

TLA is not supported on all platforms, querySync is not supported on all platforms, and if we migrate to JSR, we will have to unify all the platform-specific code anyway. I don't see a lot of value in figuring out a good short-term solution here.

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.

3 participants