Sunday, March 5, 2023
HomeITDeno provides bundle.json help | InfoWorld

Deno provides bundle.json help | InfoWorld


Deno 1.31, the most recent model of the Node.js rival runtime for JavaScript, TypeScript, and WebAssembly, provides bundle.json help. The brand new characteristic is certainly one of a number of enhancements designed to make it simpler for builders to transition from current Node.js tasks.

Deno now will routinely detect a bundle.json and use it to put in and resolve dependencies used. This additionally permits the operating of project-specific scripts outlined within the scripts part with deno job. Nonetheless, present help is restricted to easy scripts. Packages comparable to rimraf or cross-env won’t but work, however help for them will likely be added in an upcoming launch.

Deno 1.31 additionally stabilizes the Node-API (N-API). Builders now not want use the unstable flag when utilizing NPM packages that depend on this API. Many bug fixes had been utilized to Node-API and extra packages can be utilized with out challenge. Remaining bugs will likely be addressed in upcoming weeks.

As well as, Deno 1.31 strikes the compatibility layer for Node.js instantly into the Deno runtime. Beforehand, compatibility for Node.js was offered through the use of https:/deno.land/std.node, a set of polyfills in userland code within the Deno customary library. As a result of dependency on https://deno.land/std needed to be bumped with every launch of Deno, the compatibility layer needed to downloaded after every improve. Now the compatibility layer is embedded within the runtime and V8 JavaScript engine snapshots are used to cut back startup time. The tighter integration permits simpler polyfilling of lacking APIs and improves the efficiency of built-in Node.js modules. To make use of embedded polyfills, builders can import from node: specifiers

Unveiled February 24, Deno 1.31 might be accessed by way of deno improve for present customers. Different set up choices are listed on GitHub. Deno 1.31 follows final month’s launch of Deno 1.30, which improved help for Node.js modules.

Additionally in Deno 1.31:

  • In a breaking change, pointers now are represented as plain objects, or null for null pointers. These objects are created by V8 and supported by V8 Quick API, enhancing efficiency of FFI (Overseas Operate Interface) when working with “pointer” kind parameters and return values from earlier variations. Pointer objects are opaque and can’t be manipulated instantly from JavaScript. Thus, FFI turns into safer to make use of, with pointer spoofing now not as straightforward as writing a JavaScript quantity. Be aware that the FFI API is unstable.
  • The Deno.Command and Deno.osUptime() APIs now are stabilized. Builders are suggested emigrate from the Deno.run() API to Deno.Command.
  • The Deno.construct.os API now returns extra variants for working programs, comparable to "darwin", "linux", "home windows", and "solaris".
  • For the usual library, modules for https://deno.land/std/node have been eliminated. This code is now instantly embedded within the Deno runtime.
  • For the command interface, the deno bundle command is now not supported and won’t present up within the assist output.
  • Additionally for the CLI, deno benchcode now accepts a --json flag that may print benchmark outcomes as JSON.
  • The interactive permission immediate now accepts a brand new possibility, A. This feature permits granting of permission for subsequent calls to APIs utilizing the granted area.
  • deno compile now understands dynamic imports that may be resolved at compile time.

Copyright © 2023 IDG Communications, Inc.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments