Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@girs/glib-2.0

Package Overview
Dependencies
Maintainers
5
Versions
39
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.80.0-4.0.0-beta.2 to 2.80.0-4.0.0-beta.3

6

package.json
{
"name": "@girs/glib-2.0",
"version": "2.80.0-4.0.0-beta.2",
"version": "2.80.0-4.0.0-beta.3",
"description": "GJS TypeScript type definitions for GLib-2.0, generated from library version 2.80.0",

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

"dependencies": {
"@girs/gjs": "^4.0.0-beta.2",
"@girs/gobject-2.0": "^2.80.0-4.0.0-beta.2"
"@girs/gjs": "^4.0.0-beta.3",
"@girs/gobject-2.0": "^2.80.0-4.0.0-beta.3"
},

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

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

GJS TypeScript type definitions for GLib-2.0, generated from library version 2.80.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.2.
GJS TypeScript type definitions for GLib-2.0, generated from library version 2.80.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.3.

@@ -26,7 +26,2 @@

Or if you prefer CommonJS, you can also use this:
```ts
const GLib = require('@girs/glib-2.0');
```
### Ambient Modules

@@ -86,15 +81,2 @@

### 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

@@ -101,0 +83,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