Linux 用户注意！GNOME 45 将影响所有扩展！
GNOME
![](/data/attachment/album/202309/05/153130xbp37iw9i3cc77m7.jpg)



> 
> GNOME 45 是一次重要的升级，但对扩展的影响并不令人满意！
> 
> 
> 


每当 GNOME 升级，总会有一些扩展遭遇问题，这点并不新鲜。但如今，到了 GNOME 45，每个扩展都将面临问题！ ?


那么，究竟是什么原因呢？让我为你解释一番。


### GNOME 45 扩展的变化


每次升级，都意味着某种技术上的提升或者变化。


而 [GNOME 45](https://news.itsfoss.com/gnome-45/) 带来了许多激动人心的更新，除了这一项。



> 
> **[GNOME 45 引入激动人心的更新](/article-16150-1.html)**
> 
> 
> 


**GNOME Shell 的 JavaScript 部分发生了变化**。如果你还不清楚的话，你需要知道的是，JavaScript（以及相关的模块）负责扩展的用户界面，包括面板、菜单、对话框等。


技术上的变更主要在于，GNOME Shell 和扩展开始使用 ESModules，而不是 GJS 的自定义导入系统。


虽然这个变革旨在鼓励开发人员用更加标准化的方式来处理 GNOME Shell 和扩展的代码，但可能会造成大量困扰。


**为什么呢？**


那是因为旧有系统与新的模块系统存在不兼容问题。


以下是 **Florian Müllner** 在谈及这个技术问题时 [提到](https://blogs.gnome.org/shell-dev/2023/09/02/extensions-in-gnome-45/) 的：



> 
> 模块加载的方式与脚本有所不同，有些语句，特别是 `import` 和 `export`，只在模块中有效。这就意味着，如果一个模块使用了这些语句（几乎是必然的），那么用旧系统导入这个模块就会出现语法错误。
> 
> 
> 


那么问题影响范围呢？**所有 GNOME 扩展都将受影响。**


* 所有针对老版本 GNOME 设计的扩展将无法在 GNOME 45 上运行（除非迁移）。
* 专门为 GNOME 45 设计的新扩展，也无法在老版本上运行。


好消息是，GNOME 扩展的开发人员可以支持多版本的 GNOME，但他们将需要付出更多努力，为 GNOME 45 之前和之后的版本分别上传新的版本。


因此，即使开发人员选择了这样做，并使用 [迁移指南](https://gjs.guide/extensions/upgrading/gnome-shell-45.html#esm) 将他们的扩展移植到新系统中，这仍将花费他们更多的时间，而在此期间，终端用户（也就是我们）在使用 GNOME 45 时会遇到扩展无法运行的情况。


**这并不是一个好的用户体验，对不对？** ?


GNOME 的升级从未能完美处理扩展的兼容问题，现在，**情况变得更糟**。


虽然我并不太依赖现有的任何 [GNOME 扩展](https://itsfoss.com/gnome-shell-extensions/)，但很多用户在日常使用中都会用到。对他们来说，一个可能破坏使用体验的升级绝非喜事。


? 你如何看待 GNOME 45 中对扩展的变动？在下方评论中分享你的想法吧。


*（题图：MJ/d67e0592-2395-4a7d-bda6-0ec3136e40db）*




---


via: <https://news.itsfoss.com/gnome-45-extensions/>


作者：[Ankush Das](https://news.itsfoss.com/author/ankush/) 选题：[lujun9972](https://github.com/lujun9972) 译者：ChatGPT 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
![](/assets/images/pikapods-banner-v3.webp)


![](/assets/images/pikapods-banner-v3.webp)

With every GNOME upgrade, some extensions break; that's not new. But, with GNOME 45, every extension will break 😱

And why is that? Let me tell you more about it.

## GNOME 45 Extension Changes

With every upgrade, there is always a technical improvement or change.

And, [GNOME 45](https://news.itsfoss.com/gnome-45/) comes with pretty exciting changes, except this one.

[GNOME 45 Packs in Exciting Upgrades: Here’s What’s NewThe features and improvements that you can expect with GNOME 45. We’ve listed them here.](https://news.itsfoss.com/gnome-45/)![](https://news.itsfoss.com/content/images/2023/08/gnome-45-features-ft.png)


![](https://news.itsfoss.com/content/images/2023/08/gnome-45-features-ft.png)

**GNOME Shell's JavaScript has had a change**. If you are curious, the JavaScript part (and the modules) is responsible for the extension's user interface, including the panel, menus, dialogs, etc.

The technical change is that GNOME Shell and Extensions use ESModules instead of GJS' custom import system.

While this modification was intended to encourage developers to use a more standardized approach for GNOME Shell and Extensions codebase, it might have added a big hassle.

**Why?**

This is because the legacy system and the new modules approach are incompatible.

Here's what **Florian Müllner** had to [mention](https://blogs.gnome.org/shell-dev/2023/09/02/extensions-in-gnome-45/?ref=news.itsfoss.com) for the technical bits:

Modules are loaded differently than scripts, and some statements — namely`import`

and`export`

— are only valid in modules. That means that trying to import a module with the legacy system will result in a syntax error if the module uses one of those statements (about as likely as a pope being Catholic).

And the hassle? **All GNOME extensions break.**

- All the extensions targeted for older GNOME versions will no longer work on GNOME 45 (unless ported).
- New extensions tailored for GNOME 45 will not work on older versions.

The good thing is that a GNOME extension developer can support multiple versions of GNOME. But they will have more work to do and re-upload versions for pre and post-GNOME 45.

So, even if a developer chooses to do that and utilizes the [porting guide](https://gjs.guide/extensions/upgrading/gnome-shell-45.html?ref=news.itsfoss.com#esm) to migrate to the new system, it will take extra time for them while the end-users (us) encounter broken extensions when using GNOME 45.

**Not a pretty user experience. Is it? **😒

GNOME upgrades were not perfect for extension compatibility; now, **it is worse**.

While I do not rely much on any available [GNOME extensions](https://itsfoss.com/gnome-shell-extensions/?ref=news.itsfoss.com), many users do. And, for them, an upgrade that breaks the experience is not good news.

📰 **Want our news updates on your Google News feed? Follow us here:**

[It’s FOSS - Google NewsRead full articles from It’s FOSS and explore endless topics, magazines and more on your phone or tablet with Google News.](https://news.google.com/publications/CAAiENHoh-T8yP9Q8Qywor2dwGkqFAgKIhDR6Ifk_Mj_UPEMsKK9ncBp?ref=itsfoss.com)![](https://lh3.googleusercontent.com/8BtTTnoAEYry0KuwC0nPq5U_GERPzo_DTNxmR3FEzmJQxtUaUndM6ydGtZSnIorEoCSILMmf9g=rj-c-w300-h300-l95-c0xffffff)


*💬 What do you think about the change for extensions in GNOME 45? Share your thoughts on it in the comments below.*

## More from It's FOSS...

- Support us by opting for
[It's FOSS Plus](https://itsfoss.com/#/portal/signup)membership. - Join our
[community forum](https://itsfoss.community/). - 📩 Stay updated with the latest on Linux and Open Source. Get our
[weekly Newsletter](https://itsfoss.com/newsletter/).