{"id":90954,"date":"2025-10-22T11:53:13","date_gmt":"2025-10-22T11:53:13","guid":{"rendered":"https:\/\/www.newsbeep.com\/il\/90954\/"},"modified":"2025-10-22T11:53:13","modified_gmt":"2025-10-22T11:53:13","slug":"deno-2-5-brings-support-for-permission-sets-and-test-api-hooks","status":"publish","type":"post","link":"https:\/\/www.newsbeep.com\/il\/90954\/","title":{"rendered":"Deno 2.5 Brings Support for Permission Sets and Test API Hooks"},"content":{"rendered":"<p><a href=\"http:\/\/deno.com\/\" rel=\"nofollow noopener\" target=\"_blank\">Deno<\/a>, the JavaScript runtime built by Ryan Dahl, has <a href=\"https:\/\/deno.com\/blog\/v2.5\" rel=\"nofollow noopener\" target=\"_blank\">launched version 2.5<\/a>, bringing improvements with the addition of Permission Sets, new testing hooks and\u00a0improvements to Websockets.\u00a0There is also a number of performance improvements as part of the release.<\/p>\n<p>Deno 2.5 upgrades the runtime environment to V8 14.0 and <a href=\"https:\/\/devblogs.microsoft.com\/typescript\/announcing-typescript-5-9\/\" rel=\"nofollow noopener\" target=\"_blank\">TypeScript 5.9.2<\/a>, unlocking access to newer JavaScript language features, performance improvements, and better TypeScript\u00a0support. The release also includes changes to\u00a0the <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Temporal\" rel=\"nofollow noopener\" target=\"_blank\">Temporal API<\/a> for date and time management, with the goal of making the &#8211;unstable-temporal flag unnecessary in future versions.<\/p>\n<p>One of the headline changes is support for <a href=\"https:\/\/docs.deno.com\/runtime\/fundamentals\/configuration\/#permissions\" rel=\"nofollow noopener\" target=\"_blank\">permission sets<\/a> in the configuration file, providing developers with more granular and declarative control over runtime permissions. By being able to define permission specifications in the deno.json config file, different predefined permissions can be applied at runtime based on the command being run. Permission sets can be applied using the new permission-set flag, for example:<br \/>&#13;<br \/>\n\u00a0<\/p>\n<p>&#13;<br \/>\ndeno run &#8211;permission-set=process-data main.ts<\/p>\n<p>&#13;<br \/>\nIn addition, Deno has enhanced its <a href=\"https:\/\/docs.deno.com\/runtime\/fundamentals\/testing\/\" rel=\"nofollow noopener\" target=\"_blank\">test API<\/a> by adding setup and teardown hooks, giving test authors lifecycle control directly in Deno.test. There are four new hooks:\u00a0Deno.test.beforeAll, Deno.test.beforeEach, Deno.test.afterAll and Deno.test.afterEach.<\/p>\n<p><a href=\"https:\/\/www.reddit.com\/r\/Deno\/comments\/1ndkq4e\/deno_25_permission_sets_in_config_setup_and\/\" rel=\"nofollow noopener\" target=\"_blank\">One user<\/a> on reddit showed excitement towards the new hooks available in the testing API, however <a href=\"https:\/\/www.youtube.com\/watch?v=AfOWy3uwnCA\" rel=\"nofollow noopener\" target=\"_blank\">a comment<\/a> over on YouTube argues the addition of beforeAll is a late addition, adding it should have had feature parity with node sooner.<\/p>\n<p>The bundle runtime API is also shipping, enabling programmatic bundling of modules at runtime. This feature enhances\u00a0the deno bundle command shipped in version 2.4. The bundle API is currently experimental and the flag \u2013unstable-bundle must be used.<\/p>\n<p><a href=\"https:\/\/deno.com\/blog\/v2.5#websocket-headers\" rel=\"nofollow noopener\" target=\"_blank\">WebSocket headers<\/a> have also been improved to allow for custom headers when initiating a new WebSocket connection, which can be beneficial for authentication or passing custom metadata and state. There is a note in the release blog that this new feature will not work in all browsers.<\/p>\n<p>Deno 2.5 also includes performance optimizations. The emit cache now persists between updates unless the underlying deno_ast version changes, reducing unnecessary recompilation. Memory usage has been lowered in CommonJS module wrappers, improving Node.js interoperability, while conditional JSX transpilation skips processing entirely when JSX is disabled. Core APIs have seen similar refinements: structuredClone now uses a faster internal implementation, and both Buffer.subarray and Buffer.prototype.utf8Slice have been optimized for binary data handling. Deno\u2019s Node-API layer has received performance tuning to minimize overhead when loading native Node modules.<\/p>\n<p>Deno is an open-source, secure JavaScript runtime, designed with first-class TypeScript support, integrated tooling, and purposeful default security. It has over 100k+ Stars on GitHub, 400k+ Active Community Users and 2M+ Community Modules. Deno v2.5 ships with a number of improvements and features, you are able to find the full list of changes over in the <a href=\"https:\/\/deno.com\/blog\/v2.5\" rel=\"nofollow noopener\" target=\"_blank\">release article<\/a> on the Deno website.<\/p>\n","protected":false},"excerpt":{"rendered":"Deno, the JavaScript runtime built by Ryan Dahl, has launched version 2.5, bringing improvements with the addition of&hellip;\n","protected":false},"author":2,"featured_media":90955,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[32335,437,434,435,436,61452,61453,61450,438,4407,146,85,46,3306,61451,44831,7390],"class_list":["post-90954","post","type-post","status-publish","format-standard","has-post-thumbnail","category-arts-and-design","tag-api","tag-arts","tag-arts-and-design","tag-artsanddesign","tag-artsdesign","tag-automated-testing","tag-deno","tag-deno-2-5-released","tag-design","tag-development","tag-entertainment","tag-il","tag-israel","tag-javascript","tag-node-js","tag-typescript","tag-web-development"],"_links":{"self":[{"href":"https:\/\/www.newsbeep.com\/il\/wp-json\/wp\/v2\/posts\/90954","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.newsbeep.com\/il\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.newsbeep.com\/il\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/il\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/il\/wp-json\/wp\/v2\/comments?post=90954"}],"version-history":[{"count":0,"href":"https:\/\/www.newsbeep.com\/il\/wp-json\/wp\/v2\/posts\/90954\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/il\/wp-json\/wp\/v2\/media\/90955"}],"wp:attachment":[{"href":"https:\/\/www.newsbeep.com\/il\/wp-json\/wp\/v2\/media?parent=90954"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.newsbeep.com\/il\/wp-json\/wp\/v2\/categories?post=90954"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.newsbeep.com\/il\/wp-json\/wp\/v2\/tags?post=90954"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}