D
Deno

help

how to avoid deprecation warnings in compiled binaries

Mmxcl1/30/2024
$ pkgx --version
warning: Use of deprecated "Deno.stderr.rid" API. This API will be removed in Deno 2. Run again with DENO_VERBOSE_WARNINGS=1 to get more details.
warning: Use of deprecated "Deno.isatty()" API. This API will be removed in Deno 2. Run again with DENO_VERBOSE_WARNINGS=1 to get more details.
warning: Use of deprecated "Deno.stdin.rid" API. This API will be removed in Deno 2. Run again with DENO_VERBOSE_WARNINGS=1 to get more details.
pkgx 1.1.6
$ pkgx --version
warning: Use of deprecated "Deno.stderr.rid" API. This API will be removed in Deno 2. Run again with DENO_VERBOSE_WARNINGS=1 to get more details.
warning: Use of deprecated "Deno.isatty()" API. This API will be removed in Deno 2. Run again with DENO_VERBOSE_WARNINGS=1 to get more details.
warning: Use of deprecated "Deno.stdin.rid" API. This API will be removed in Deno 2. Run again with DENO_VERBOSE_WARNINGS=1 to get more details.
pkgx 1.1.6
What I don’t get is that when I compile it locally I don’t get these warnings. Only in the CI/CD produced binaries. Which means I didn’t see this, but all my users did. Note, that I have fixed the deprecation warnings and intend to release a point release. I am just trying to ensure that in the future I don’t deliver my users a bunch of warnings they don't care about
DAHDeno AI Helper1/30/2024
To avoid deprecation warnings in compiled binaries, you should ensure that your code does not use any deprecated APIs. The warnings you're seeing (Deno.stderr.rid, Deno.isatty(), and Deno.stdin.rid) indicate that these APIs are deprecated and will be removed in Deno 2. Here are some steps you can take to address the deprecation warnings: 1. Update Your Code: Replace the deprecated APIs with their recommended alternatives. For example, instead of using Deno.stderr.rid, you can use the new Deno.stderr as a WritableStream. Similarly, replace Deno.isatty() with the new API if available. 2. Ensure Consistent Deno Versions: Make sure that the Deno version used in your local development environment is the same as the one used in your CI/CD pipeline. This will help you catch deprecation warnings early. 3. Run with Verbose Warnings: To get more details about the deprecation warnings, you can run your code with the DENO_VERBOSE_WARNINGS=1 environment variable set. This might provide additional information on what needs to be changed. 4. Check Release Notes: Refer to the Deno release notes for the version you are using to see if there are any breaking changes or deprecations that affect your code. The documentation mentions that Deno.File has been renamed to Deno.FsFile in Deno 1.19, for example, so you should check for similar notes regarding the APIs you are using. 5. Compile with the Latest Deno Version: Before compiling your code, make sure you are using the latest stable version of Deno. This ensures that you have all the latest features and deprecation notices. 6. Test Binaries Before Release: Test the compiled binaries in an environment similar to your users' to catch any warnings or issues that might not appear in your
DAHDeno AI Helper1/30/2024
development environment. If you've updated your code and are still seeing these warnings in the CI/CD pipeline but not locally, it's possible that the Deno version in the CI/CD environment is different from your local version, or there might be some environment-specific differences causing these warnings to show up. Ensure that the Deno version is consistent across environments and that you're testing the binaries in a clean environment that mimics your users' setups as closely as possible. Remember, it's important to address these warnings before Deno 2 is released, as the deprecated APIs will be removed, potentially breaking your application if it still relies on them. 🦕
Mmxcl1/30/2024
I cannot remove all the deprecated API usages. I need to use the dnt tool to publish to npm which does not yet support all the deprecated APIs basically you are saying using deno means we cannot avoid announcing to the user about deprecated APIs in a compiled binary Additionally we absolutely there is no way we can see to not use some of the deprecated APIs, eg. the unstable API for flock which we use has not been updated, it still requires a rid for now we will pin to 1.39
ARAyo Reis1/30/2024
I think there is something like --quiet, not sure, check the docs.
LLeokuma1/30/2024
deno compile --quiet main.ts
deno compile --quiet main.ts

Looking for more? Join the community!

Recommended Posts
Deno compile with "--no-terminal" don't workI'm trying to compile a very simple file named main.ts ```ts await Deno.writeTextFile('test.txt', 'Hdeno task start not runnning in Powershell.This is the link of the tutorial I am following https://github.com/googleanalytics/ga4-tutorials?tabDeployment ID not available after API deploymentHi - i'm calling the /deployments endpoint after creating a new project: ${API}/projects/${project.`Request` body reading functions: possible error types[This](https://docs.deno.com/runtime/manual/runtime/http_server_apis#inspecting-the-incoming-requestHow to call a JS function from Rust?Hi, I'd like to call a JS function from Rust but I can't seem to find an example that does so. I goView code in Subhosting projectHi there - i'm using the API to create a new project and deployment with Subhosting. Just wondering Stop deno deploy instanceHi everyone, I just deployed my first test deno project on deno deploy. Now I'm wondering how to stoHow can I flush a stream to a response?I'm trying to stream a response but it appears that data is only sent after either a newline is writHoping for a clean way to get an array of filenames in directoryTrying to do something like this: ```typescript const files = Deno.readDirSync(Deno.cwd()).map(x => Support for auto-accessorsI'm playing around with Decorators, it seems like with `"experimentalDecorators": false`, there's a Rust sdk register_actity_typeHey, I am using the core_sdk in rust. I registered an activity, which should be able to consume follIs there a feature allowing custom "Allow?" CLI inputs?For example, if you `deno run` some program that reads from the file system, you're prompted `Deno r"deno compile --no-terminal" is not workingI'm trying to compile a very simple file named main.ts ```ts await Deno.writeTextFile('test.txt', 'HUsing fresh inside an existing deno folderI have an existing deno project with deno.jsonc at the root and would like to add a web app as a subRemove Dependencies from `deno.lock` fileHello, Somewhere in the code, I did `import postgres from npm:postgres`. This import is the writtenGood scripts/tools to automate conversion of Node.js based projects to Deno?I'm wondering if there are commendations for tools like this? (I found something like this, but it VS Code Extension API development with Deno as a runtime?I'm dipping my toes into [VS Code extension development](https://code.visualstudio.com/api/get-startImporting submodulesHi, I am working for the first time with deno in my supabase edge functions. I am trying to import aVariable references causing lint errors across cells in Deno+JupyterIf you define a variable in one cell and then try to reference it in another cell, you get a "CannotVSCode starting Deno even if enabled=falseII use VSCode in a large project (with several JS packages, none of which use Deno), and after instal