Socket
Socket
Sign inDemoInstall

@girs/glib-2.0

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@girs/glib-2.0 - npm Package Compare versions

Comparing version 2.78.0-3.2.4 to 2.78.0-3.2.5

1

glib-2.0-ambient.d.ts
declare module 'gi://GLib?version=2.0' {

@@ -4,0 +3,0 @@ import GLib20 from '@girs/glib-2.0';

import GLib20 from '@girs/glib-2.0';

@@ -4,0 +3,0 @@

6

package.json
{
"name": "@girs/glib-2.0",
"version": "2.78.0-3.2.4",
"version": "2.78.0-3.2.5",
"description": "GJS TypeScript type definitions for GLib-2.0, generated from library version 2.78.0",

@@ -28,4 +28,4 @@ "type": "module",

"dependencies": {
"@girs/gjs": "^3.2.4",
"@girs/gobject-2.0": "^2.78.0-3.2.4"
"@girs/gjs": "^3.2.5",
"@girs/gobject-2.0": "^2.78.0-3.2.5"
},

@@ -32,0 +32,0 @@ "devDependencies": {

@@ -8,3 +8,3 @@

GJS TypeScript type definitions for GLib-2.0, generated from library version 2.78.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.2.4.
GJS TypeScript type definitions for GLib-2.0, generated from library version 2.78.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.2.5.

@@ -86,2 +86,15 @@ GLib provides the core application building blocks for libraries and applications written in C. It provides the core object system used in GNOME, the main loop implementation, and a large set of utility functions for strings and common data structures.

### ESM vs. CommonJS
GJS supports two different import syntaxes. The new modern ESM syntax and the old global imports syntax.
In TypeScript projects for GJS and GNOME Shell extensions, you have the flexibility to use `ESM` syntax and then decide the import syntax for your bundled file. If your bundler is configured to use `CommonJS`, it will convert to the GJS-specific global imports syntax, like `const moduleName = imports.gi[moduleName]`. This is different from the traditional `require` syntax seen in Node.js. The global imports syntax is chosen because it aligns with the CommonJS format supported by NPM, which is used for the generated type definitions and this package.
On the other hand, if you configure your bundler to use ESM, it will retain the ESM import syntax. It's crucial to ensure that your bundler is set up to correctly translate and bundle these imports into either CommonJS or ESM format, depending on your project's requirements.
This approach is particularly important due to the `@girs` types, which include both `*.cjs `files, using the GJS global imports syntax, and `*.js` files, which utilize the ESM syntax. By appropriately setting up your bundler, you can control which syntax—CommonJS or ESM—is used in your project. The choice of CommonJS in this context is also due to the similarity between the GJS-specific global imports and CommonJS syntax, allowing for easier management and bundling in these specific types of projects.
Since GNOME Shell 45, you should only use ESM, even for GNOME Shell extensions. Before that, extensions had to use the global import syntax, unlike normal GJS applications, where ESM has been available for some time.
### Bundle

@@ -88,0 +101,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc