An Open Letter to Web Developers

栏目: IT技术 · 发布时间: 4年前

Dear Web Developer(s),

While, as a software developer ourselves, we understand very well that new features are exciting to use and integrate into your work, we ask that you please consider not adopting Google WebComponents in your designs . This is especially important if you are a web developer creating frameworks for websites to use.

With Google WebComponents here we mean the use of CustomElements and Shadow DOM, especially when used in combination, and in dynamically created document structures (e.g. using module loading/unloading and/or slotted elements).

Why is this important?

For several reasons, but primarily because it completely goes against the traditional structure of the web being an open and accessible place that isn't inherently locked down to opaque structures or a single client. WebComponents used "in full" (i.e. dynamically) inherently creates complex web page structures that cannot be saved, archived or even displayed outside of the designated targeted browsers (primarily Google Chrome).

One could even say that this is setting the web up for becoming fully content-controlled.

The more additional "features" are tacked on to these components, the less likely it is for non-Google clients to be able to display sites in full or properly. It creates problems for people who are in limited environments, need special web clients for e.g. limited physical accessibility, or need to strictly protect their privacy. What of people on older hardware who don't have the computing power to basically run all these JavaScript applications fully off-loaded in their browser just to be able to render a page? Not to mention other software that needs to be able to parse web pages as a whole like alternative search engines (another thing one could consider unfair competition from Google).

It also creates problems for any browser that is not Google Chrome or a direct descendant of it (and that includes Mozilla's Firefox, despite being developed by a well-funded corporation), which is basically enforcing a full browser monoculture in the near future if web developers continue to adopt every latest new thing that comes out of the Google web labs in an "implementation-first" fashion, and continue to implement change for the sake of change. Once more, this is doubly-important for frameworks in use by thousands of websites that are at the heart of the Internet economy like on-line stores, bank sites, media sites, etc.

Full disclosure: While it is absolutely true that it is in our direct interest that web developers don't use something we are still working on implementing ourselves (considering our limited capacity as a smaller non-profit community, which is likely the same for any other true Open Source/Libre projects out there), the impact of what is outlined above is much more far-reaching than just our own projects; not only is it pushing for a proprietary web that is vendor-locked, it also, as stated, becomes something that will be impossible to archive, save or process.

"But I like the scoped styling I can do"

One of the main reasons people want to use shadow DOM these days is because it allows them to designate CSS styling that only applies to their little corner of the web page it is in (e.g. a widget). The thing is, we already had scoped styling in a much simpler (not script or DOM dependent) way that was actually asked for by web developers like yourself, that was actually standardized, and that got implemented by browsers, but then removed... basically because Chrome didn't implement it (despite resistance from designers[1]) to be replaced with the much more complex Shadow DOM alternative; it would be much more useful to ask for that to be returned to the spec. You can help by getting involved with the requested spec change on WhatWG issue 4508 [2] and/or Mozilla's implementation bug 1542645 [3].

The big question to framework and web developers

The biggest question you should all ask yourself when you are currently considering (or already using) Google WebComponents is: Do you really need it? Do you need the complexity, inherent slowness of megabytes of client-side scripting, or the specific features of Google WebComponents? What was wrong with your previous implementation that "couldn't be solved any other way"? In my opinion, the last actual scripting standards (ES6 and extensions) already allow anything that would be needed without completely re-architecturing what the web has been building on for decades. The few missing "tricks" that these components offer are not new, after all: (X)HTML has been fully extensible by design. Things like XBL have also existed for a long time doing the exact same things now touted as "new". You also shouldn't need JavaScript and DOM to style your pages, especially with the latest additions to CSS like flexible layouts.

We know that some developers will obviously not be amenable to this request to avoid WebComponents (e.g. I don't expect Angular, developed by Google, or YouTube, owned by Google, to do anything but push these things) but we ask that you please consider this request if you don't have a direct need to actually use them.

To conclude, I'm hoping that you, our web creators, will continue to keep the big picture in mind when it comes to the internet being primarily a public exchange of information, keeping it open and accessible to all with the software your users choose or need to use.

Thanks for listening,

Moonchild.

[1] https://github.com/whatwg/html/issues/552#issuecomment-178107702 and onwards

[2] https://github.com/whatwg/html/issues/4508

[3] https://bugzilla.mozilla.org/show_bug.cgi?id=1542645


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

编程语言实现模式

编程语言实现模式

Terence Parr / 李袁奎、尧飘海 / 华中科技大学出版社 / 2012-3-20 / 72.00元

《编程语言实现模式》旨在传授开发语言应用(工具)的经验和理念,帮助读者构建自己的语言应用。这里的语言应用并非特指用编译器或解释器实现编程语言,而是泛指任何处理、分析、翻译输入文件的程序,比如配置文件读取器、数据读取器、模型驱动的代码生成器、源码到源码的翻译器、源码分析工具、解释器,以及诸如此类的工具。为此,作者举例讲解已有语言应用的工作机制,拆解、归纳出31种易于理解且常用的设计模式(每种都包括通......一起来看看 《编程语言实现模式》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

html转js在线工具
html转js在线工具

html转js在线工具