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

suggestion: Deno.permissions.querySync #15576

Closed
iuioiua opened this issue Aug 24, 2022 · 6 comments · Fixed by #17019
Closed

suggestion: Deno.permissions.querySync #15576

iuioiua opened this issue Aug 24, 2022 · 6 comments · Fixed by #17019
Labels
permissions related to --allow-* flags public API related to "Deno" namespace in JS runtime Relates to code in the runtime crate suggestion suggestions for new features (yet to be agreed)

Comments

@iuioiua
Copy link
Contributor

iuioiua commented Aug 24, 2022

Deno.permissions.query is currently async. A sync version would be useful in contexts where top-level await would otherwise break node. Refs:

In denoland/std#1495 in particular, @bartlomieju mentions that a sync version of this API might not be a good idea. Is this still the case? If so, is there a decent workaround for the above-mentioned refs?

@lucacasonato lucacasonato added permissions related to --allow-* flags public API related to "Deno" namespace in JS suggestion suggestions for new features (yet to be agreed) runtime Relates to code in the runtime crate labels Aug 24, 2022
@iuioiua
Copy link
Contributor Author

iuioiua commented Sep 7, 2022

@bartlomieju, do you have any thoughts?

@iuioiua
Copy link
Contributor Author

iuioiua commented Oct 7, 2022

@bartlomieju, just following up. Would love to hear your thoughts.

@lino-levan
Copy link
Contributor

I remember reading somewhere that this was planned and then scrapped by the core team but I can't seem to find that discussion right now. @bartlomieju did that happen or am I misremembering it?

@martin-braun
Copy link

martin-braun commented Nov 17, 2022

Solving this would help to finish denoland/std#2785, context here: denoland/std#2594 (comment)

Discussed this offline with ry, jumping to adding sync permissions API is not a good idea.

Originally posted by @bartlomieju in denoland/std#1495 (comment)

Could you please elaborate?

@iuioiua
Copy link
Contributor Author

iuioiua commented Dec 7, 2022

@bartlomieju, are you able to elaborate? I might just give this a crack anyway.

@bartlomieju
Copy link
Member

We have recently discussed it and @kt3k suggested that it might be needed in deno_std. I'm still in favor of adding sync version of permission APIs, if you want to give it a crack a PR would be good to discuss it further 👍

rivy added a commit to rivy-js/yargs that referenced this issue Oct 30, 2023
…0.0+)

- `Deno.permissions.querySync()` added in Deno v1.30.0 (on 2023-01-25)
- see [suggest: Deno.permissions.querySync](denoland/deno#15576)
- see [feat: Add sync APIs for "Deno.permissions"](denoland/deno#17019)
- see [v1.30.0](https://github.com/denoland/deno/releases/tag/v1.30.0) released on 2023-01-25
rivy added a commit to rivy-js/yargs that referenced this issue Oct 30, 2023
- `Deno.permissions.querySync()` added in Deno v1.30.0 (on 2023-01-25)
- see [suggest: Deno.permissions.querySync](denoland/deno#15576)
- see [feat: Add sync APIs for "Deno.permissions"](denoland/deno#17019)
- see [v1.30.0](https://github.com/denoland/deno/releases/tag/v1.30.0) released on 2023-01-25
rivy added a commit to rivy-js/yargs that referenced this issue Nov 20, 2023
- `Deno.permissions.querySync()` added in Deno v1.30.0 (on 2023-01-25)
- see [suggest: Deno.permissions.querySync](denoland/deno#15576)
- see [feat: Add sync APIs for "Deno.permissions"](denoland/deno#17019)
- see [v1.30.0](https://github.com/denoland/deno/releases/tag/v1.30.0) released on 2023-01-25
rivy added a commit to rivy-js/yargs that referenced this issue Nov 22, 2023
- `Deno.permissions.querySync()` added in Deno v1.30.0 (on 2023-01-25)
- see [suggest: Deno.permissions.querySync](denoland/deno#15576)
- see [feat: Add sync APIs for "Deno.permissions"](denoland/deno#17019)
- see [v1.30.0](https://github.com/denoland/deno/releases/tag/v1.30.0) released on 2023-01-25
rivy added a commit to rivy-js/yargs that referenced this issue Nov 23, 2023
- `Deno.permissions.querySync()` added in Deno v1.30.0 (on 2023-01-25)
- see [suggest: Deno.permissions.querySync](denoland/deno#15576)
- see [feat: Add sync APIs for "Deno.permissions"](denoland/deno#17019)
- see [v1.30.0](https://github.com/denoland/deno/releases/tag/v1.30.0) released on 2023-01-25
rivy added a commit to rivy-js/yargs that referenced this issue Nov 23, 2023
- `Deno.permissions.querySync()` added in Deno v1.30.0 (on 2023-01-25)
- see [suggest: Deno.permissions.querySync](denoland/deno#15576)
- see [feat: Add sync APIs for "Deno.permissions"](denoland/deno#17019)
- see [v1.30.0](https://github.com/denoland/deno/releases/tag/v1.30.0) released on 2023-01-25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
permissions related to --allow-* flags public API related to "Deno" namespace in JS runtime Relates to code in the runtime crate suggestion suggestions for new features (yet to be agreed)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants