Difference between revisions of "ExposureGuidelines"

From MozillaWiki
Jump to: navigation, search
(Intent to implement: link to enter devtools bug)
(Add links for intenttoship bot)
 
(46 intermediate revisions by 12 users not shown)
Line 1: Line 1:
=Guiding Principles=
+
<span style="float:right">__TOC__</span>
Mozilla aims to advance the state of the web platform with new features. In past years, Mozilla has shipped experimental features with a "moz" prefix to indicate their lack of standardization (e.g., <code>mozRequestAnimationFrame()</code>). Unfortunately, this approach turned out to be harmful to the web as experimental features ended up being used in some websites before they were ready. In many cases, this meant that we were unable to innovate on certain features because to change them would break content on the web. Browsers have in some cases also been forced to implement each other's prefixed features. Therefore, to allow us to continue innovating without negatively affecting content on the web, '''Mozilla will no longer ship new "moz"-prefixed features''' (see [https://groups.google.com/forum/#!topic/mozilla.dev.platform/34JfwyEh5e4 Henri Sivonen's proposal]).
+
'''Always ask: ''Is this good for the web?'''''
  
We will instead make experimental features available behind preferences which can be toggled through <code>about:config</code>. Once we feel there is an acceptable level of consensus in the web community about the stability of an feature and we feel it is ready, we will make it generally available to the web platform (more details below on this process). We feel this strikes the right balance between allowing developers to experiment with new features, while at the same time protecting the Web from being exposed to new functionality prematurely.
+
=Adding or changing features=
  
==Special Cases==
+
This process applies to all code contributions to Firefox that introduce, modify, or remove features that change how the web platform operates.
There may be special cases where we deviate from this goal. New user-facing products may need to ship features that have not yet been embraced by other browser engines or thoroughly discussed by standards bodies. This allows Mozilla to provide functionality that other browser engines aren't working on or the majority of the Web community isn't interested in at that time. We will avoid exposing such functionality to the web at large. Developing these features without much involvement from the Web community comes with the price of temporary proprietary features. This clearly indicates their lack of standardization at that time and limits the number of developers relying upon them. Mozilla will learn from such efforts and use this knowledge to inform various standardization efforts. Our aim is to standardize our proprietary features as soon as possible so they become available on a royalty-free basis for the benefit of the web community at large.
 
  
=Guidelines for Mozillians developing new features=
+
If you aim to expose a new feature to the web or change an existing feature, please follow these steps:
The following is put forward as a set of guidelines for Mozillians -- especially [[Modules|module owners and peers]] -- to refer to while developing new APIs for the Web.  The primary question that must be asked is:
 
  
::''Is this good for the web?''
+
# [[#New features|Evaluate the new feature]] or [[#Changing or evolving features|change to an existing features]].
 +
# Email [https://groups.google.com/a/mozilla.org/g/dev-platform dev-platform] declaring your [[#Intent to prototype|intent to prototype]]. (It is okay to skip this step for small changes*.)
 +
# Implement as normal. Code review rounds will take place, [https://github.com/w3c/web-platform-tests web-platform-tests] will be written, etc.
 +
# Email [https://groups.google.com/a/mozilla.org/g/dev-platform dev-platform] declaring your [[#Intent to ship|intent to ship]] on [[Release_Management/Release_Process|Firefox Release]].
 +
# If there's no negative feedback, ship it!
  
If the answer to that question is yes, look below for some guidance on how you should proceed with shipping your new feature. Note that trivial changes need not worry about these suggested guidelines.
+
<nowiki>*</nowiki>If you’re not sure, it’s unlikely to be a small change.
  
==When is an feature ready to be shipped by Gecko?==
+
=New features=
Features which Mozilla makes available by default to the web on the release channel should be "ready".  This can mean that they are de jure standards (e.g., a W3C Recommendation) or de facto standards. Indications that a feature is ready for shipping to the web include:
 
  
# other browser engines ship compatible implementations in their releases or behind a preference with clear signals it will graduate to being on by default
+
There’s a lot of nuance that goes into adding a feature to the web. Mozilla sets a high bar for any changes we make to the web.
# other browser engines state their ''intention'' to ship a compatible implementation
 
# a large number of web developers indicate their satisfaction with the feature design
 
# there exists a specification that is no longer at risk of significant changes, is on track to become a standard with a relevant standards body, and is acceptable to a number of applicable parties and other browser engines
 
  
==How do we know what other browser engines think?==
+
Making new features available requires some care and consideration.
* some of them participate in dev-platform discussions
+
 
* watch for positive signals on the specification's discussion forum (likely a GitHub repository)
+
==Establish that the feature is important==
* watch for "intent to implement" emails on mailing lists such as [https://groups.google.com/a/chromium.org/forum/#!forum/blink-dev blink-dev]
+
 
* lack of feedback will not delay our implementation as it may simply indicate lack of interest at that time from another browser engine
+
We have finite resources and we want to ensure that we develop features that are important.  Reasons might include:
 +
* It’s of strategic importance to Mozilla.
 +
* It contributes to [https://www.mozilla.org/en-US/about/manifesto/ Mozilla’s mission].
 +
* This will make us the second/third browser to ship this, enabling more web developers to use it. That is, this helps with web compatibility and moves the web forward by having another independent implementation.
 +
 
 +
==Ensure that the feature is standardized==
 +
 
 +
Mozilla is committed to standardization as the basis for evolving the Web.  We want to ensure that features are good for our users and have broad support from other browsers, web developers, and the broader community. The [[standards]] process is how we ensure that features meet these expectations.
 +
 
 +
Our goal is that all new web-facing features are based on a specification that is the product of a recognized standards body.
 +
 
 +
===Standardization requirements for prototypes===
 +
 
 +
If a specification for a feature is not the product of a standards body, your intent to prototype needs to identify what steps have been taken to ensure that it will be.  You should identify which standards body you believe should take the work on.  Include a link to a record from that standards body that tracks the feature becoming an official product.
 +
 
 +
What you minimally need to show might differ according to the processes of the standards body:
 +
 
 +
* '''W3C''' - an issue raised on a working group charter (not a community group)
 +
* '''WHATWG''' - an issue raised on the appropriate standard(s)
 +
* '''IETF''' - an explicit request for adoption by a working group
 +
* '''TC39''' - a link to a proposal at stage 1 or higher
 +
* For other bodies, a request for consideration according to the procedures of the body
 +
 
 +
Being able to prototype new features allows us to learn about them, but experimentation serves to inform our choices in standards bodies. Features that have not been discussed within the processes of a standards body will require extra scrutiny to ensure that it is safe to prototype. This applies especially to W3C work that is not the product of a working group or community group; the same applies to individual submissions to the IETF.
 +
 
 +
===Standardization requirements for shipping features===
 +
 
 +
An intent to ship must include an update on the standardization status of the feature.  We expect that shipping features will be further advanced in the standards process when they ship.
 +
 
 +
Your intent to ship should include information that shows not only that the standards body has adopted the work, but also that there is consensus that the feature is ready to be shipped.  What evidence is necessary will vary, but generally this will be:
  
==How do we know what web developers want?==
+
* '''W3C''' - the specification is at the Candidate Recommendation [https://www.w3.org/2021/Process-20211102/#maturity-levels maturity level] or more advanced; shipping from a Working Draft or a less advanced specification requires evidence of agreement within the working group that shipping is acceptable
* Mozilla's [[Engagement/Developer_Engagement|Developer Engagement]] coordinates a [https://openwebapps.uservoice.com/forums/258478-open-web-apps Open Web Apps UserVoice] forum
+
* '''WHATWG''' - the changes have been merged into a standard; an open pull request requires additional evidence of agreement among implementers that shipping is acceptable
* [http://chromestatus.com chromestatus.com] has a column for new features entitled "Documented or perceived web developer views"
+
* '''IETF''' - a working group draft that has been passed to the IESG for publication by the working group; a draft working group in an earlier state should show evidence that shipping is acceptable to the working group
 +
* '''TC39''' - the proposal is at stage 3 or higher
 +
* The product of other bodies will be assessed individually
  
==How do we let other browser engines know what we think?==
+
In all of these cases, try to show that there are no significant unresolved issues with a specification and that there are no objections to shipping it. Simply showing that there is support for a feature is less useful.
* participate in public discussions of proposed features
 
* blog and/or tweet about proposed features
 
* comment on "intent to implement" threads on [https://groups.google.com/a/chromium.org/forum/#!forum/blink-dev blink-dev]
 
  
==Suggested implementation process==
+
Shipping features that don’t meet these requirements is still possible, including features that don't show broad agreement that shipping is acceptable.  If your feature needs an exception to this rule, please reach out to [[Modules/Firefox_Technical_Leadership|Firefox Technical Leadership]]. Any intent regarding a non-standard feature might need to include additional safeguards such as experimentation and data collection plans, risk assessments, and rollback strategies.
If your work is going to expose a new feature to the web or non-trivially change an existing one, it is requested that you follow these steps:
 
  
# Email [https://lists.mozilla.org/listinfo/dev-platform dev-platform] declaring your [[#Intent to Implement|intent to implement]].  If you are implementing a feature that is working its way through a standards body process such as the W3C's, it's best to email as soon as possible (i.e., before [http://www.w3.org/2005/10/Process-20051014/tr#q74 W3C CR status] if possible).
+
==Ensure that Mozilla has a position on the feature==
# Implement as normal. Code review rounds will take place, etc. Module owners or their designated peers will provide a super-review for all interface changes.
 
# [https://blog.mozilla.org/security/2018/01/15/secure-contexts-everywhere/ Restrict the feature to secure contexts].
 
# Ensure the feature has [https://github.com/w3c/web-platform-tests web-platform-tests] coverage.
 
# Land potentially disruptive features behind a preference which is off by default.
 
  
==Turning a preference on by default==
+
[https://github.com/mozilla/standards-positions standards-positions] is where Mozilla formalizes positions on new featuresOpen an issue there if one does not already exist.
When you are satisfied that your new feature is stable enough for exposure to the web at large (see [[#When is a feature ready to be shipped by Gecko?|above]]), it is requested that implementers send another email to dev-platform declaring their [[#Intent to ship|intent to ship]]Among other things, this email serves to inform those that are interested in the new API but have not been closely following the implementation bug(s).
 
  
=Guidelines for removing features=
+
=Changing or evolving features=
  
Occasionally there is a need to remove features. These could be features that are proprietary to Mozilla, were standardized but never got adopted by all browsers, or features that are so bad that all browsers want to get rid of them together.
+
When making changes to existing features or even removing existing features many of the considerations stated for [[#New features|evaluating new features]] apply, but one thing that is quite different is that telemetry might be important here as in general Mozilla is pretty averse to shipping breaking changes. Coordination with the relevant standard and other browsers is usually the way to go.
  
In order to make this possible while impacting users as little as possible the following steps are to be taken:
 
  
* Gather telemetry on the feature.
+
=Email templates for new or changed features=
* Consult dev-platform with an "Intent to unship" that includes the telemetry data.
 
* Indicate in the developer console whenever the feature is used that it's deprecated and might be removed. It's best to avoid doing this until there's agreement that the feature can be removed (which requires telemetry) as otherwise developers are needlessly spammed in the console.
 
* Remove the feature when the telemetry data and dev-platform agreement indicate it can be.
 
  
=Decision making=
+
When announcing your intent to prototype or ship a feature, using these templates ensures that you don’t miss anything critical.
  
If the dev-platform thread results in a conflict, the respective module owner is responsible for resolving that conflict and making a decision on how to proceed.
+
==Intent to prototype==
  
=Email templates=
+
<blockquote>
==Intent to implement==
+
'''To''': <tt>dev-platform@mozilla.org</tt><br>
'''To''': <tt>dev-platform@lists.mozilla.org</tt><br />
+
'''Subject''': Intent to prototype: <your feature goes here>
'''Subject''': Intent to implement: <your feature goes here>
 
  
''Summary'': [https://en.wikipedia.org/wiki/Elevator_pitch elevator pitch] for the new functionality including benefits to web developers<br />
+
''Summary'': [https://en.wikipedia.org/wiki/Elevator_pitch elevator pitch] for the new functionality including benefits to users and web developers.<br>
''Bug'': link to main implementation tracking bug<br />
+
''Bug'': link to Bugzilla (tracking) bug.<br />
''Link to standard'': if no formal specification exists yet, link to public discussions with other browser vendors<br />
+
''Specification'': link to the specification (see [[#Standardization requirements for prototypes|details above]])<br />
''Platform coverage'': where will this be available? Android, Desktop, only exposed to privileged apps (certified app-only functionality does not require an email), etc.<br />
+
''Standards Body'': identify the standards body responsible for standardizing this feature if that is not obvious from the specification; if the specification is not already adopted by a standards body, link to the issue or a discussion about adoption of the work (if no discussion exists, please start that process before filing this intent)<br />
''Estimated or target release'': in which version do you want to/plan to release this?<br />
+
''Platform coverage'': where will this be available? Android, Desktop, only exposed to privileged apps (certified app-only functionality does not require an email), etc.<br />
''Preference behind which this will be implemented'': if applicable, how can interested parties test this before it ships pref'd on by default?<br />
+
''Preference'': if applicable, how can interested parties test this before it ships pref'd on by default?<br />
''Is this feature enabled by default in sandboxed iframes?'' If not, is there a proposed sandbox flag to enable it?  If allowed, does it preserve the current invariants in terms of what sandboxed iframes can do?<br/>
+
''DevTools bug'': link to a [https://bugzilla.mozilla.org/enter_bug.cgi?product=devtools Developer Tools bug] coordinating work with the DevTools team to build tools for this feature.<br />
''DevTools bug'': link to a [https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox&component=Developer%20Tools Firefox :: Developer Tools bug] coordinating work with the DevTools team to build tools for this feature.<br />
+
''Link to standards-positions discussion'': Link to an issue in [https://github.com/mozilla/standards-positions/ mozilla/standards-positions] about what we think about the specification.<br />
''Do other browser engines implement this?'' Answer with: shipped (since version X, behind what flags if any); intent to implement emailed (mailing list URL); considering (citation).<br />
+
''Other browsers'':
''web-platform-tests'': Please link to the test suite. If any part of the feature is not tested by web-platform-tests, please include links to one or more of:
+
* Blink: address with "shipped" (since version X, behind what flags if any), "intent emailed" (mailing list URL), or "considering" (citation).
 +
* WebKit: address with "shipped" (since version X, behind what flags if any), "intent emailed" (mailing list URL), or "considering" (citation).
 +
''web-platform-tests'': Please link to the test suite. If any part of the feature is not tested by web-platform-tests, or if you had to write gecko-only tests for parts of the feature, please include links to one or more of:
 
* A web-platform-tests issue explaining why a certain thing cannot be tested ([https://github.com/w3c/web-platform-tests/issues/3867 example]).
 
* A web-platform-tests issue explaining why a certain thing cannot be tested ([https://github.com/w3c/web-platform-tests/issues/3867 example]).
 
* A spec issue for some change that would make it possible to test ([https://github.com/whatwg/fullscreen/issues/70 example]).
 
* A spec issue for some change that would make it possible to test ([https://github.com/whatwg/fullscreen/issues/70 example]).
 
* A Bugzilla bug for the creating web-platform-tests.
 
* A Bugzilla bug for the creating web-platform-tests.
''Secure contexts'': Provide justification if this feature is not restricted to secure contexts. Otherwise, use "Yes".
+
</blockquote>
  
 +
===Suggested additions===
  
 +
The above is the minimum required that should be in an "Intent to prototype" email. If you've covered those, you're good, and brevity is a virtue.
  
=== Suggested additions ===
+
If you're looking for extra credit, or to preempt common questions, consider adding any or all of the following (all based on existing dev-platform examples, and questions asked on dev-platform in response to intent to ship emails).
The above is the minimum required that should be in an "Intent to implement" email. If you've covered those, you're good, and brevity is a virtue.
 
  
If you're looking for extra credit, or to preempt common questions, consider adding any or all of the following (all based on existing dev-platform examples, and questions asked on dev-platform in response to intent to ship emails).
 
 
* ''How stable is the spec'': Note that even if it's unstable that shouldn't stop us implementing; that mostly affects shipping.  So as long as we're pretty sure that the basic set of functionality is stable, even if the actual names of the values are not, implementing makes sense.
 
* ''How stable is the spec'': Note that even if it's unstable that shouldn't stop us implementing; that mostly affects shipping.  So as long as we're pretty sure that the basic set of functionality is stable, even if the actual names of the values are not, implementing makes sense.
 +
** +1 [[User:Tantek|Tantek]] ([https://tantek.com/ tantek.com]) 14:21, 12 August 2022 (UTC)
 +
** ... add yourself
 
* ''Security & Privacy Concerns'': consider providing a link to answers in [https://mikewest.github.io/spec-questionnaire/security-privacy/ this security/privacy questionnaire] for a spec feature, if the spec doesn't already answer it. In particular, consider if the spec exposes new information about a user's computer or behavior that can contribute to fingerprinting.
 
* ''Security & Privacy Concerns'': consider providing a link to answers in [https://mikewest.github.io/spec-questionnaire/security-privacy/ this security/privacy questionnaire] for a spec feature, if the spec doesn't already answer it. In particular, consider if the spec exposes new information about a user's computer or behavior that can contribute to fingerprinting.
* ''Web designer / developer use-cases'' AKA ''Why a developer would use Feature X?'': Provide a URL to at least briefly documented use-cases for web designers and developers that illustrate why and when they would use this feature.
+
** +1 [[User:Tantek|Tantek]] ([https://tantek.com/ tantek.com]) 14:21, 12 August 2022 (UTC)
 +
** ... add yourself
 +
* ''Web designer / developer use-cases'' AKA ''Why a developer would use Feature X?'': Provide a URL to at least briefly documented use-cases for web designers and developers that illustrate why and when they would use this feature. E.g. a link to an https://webwewant.fyi/wants/ entry with that information.
 +
** +1 [[User:Tantek|Tantek]] ([https://tantek.com/ tantek.com]) 14:21, 12 August 2022 (UTC)
 +
** ... add yourself
 
* ''Example'': Provide a brief code sample on how to use the API. Even with a formal specification, not everyone will know about the feature just from the name of the spec. An example will make it easier to understand how this feature can be used. This can either be an inline code sample, or a direct link to an example on the web.
 
* ''Example'': Provide a brief code sample on how to use the API. Even with a formal specification, not everyone will know about the feature just from the name of the spec. An example will make it easier to understand how this feature can be used. This can either be an inline code sample, or a direct link to an example on the web.
 +
** +1 [[User:Tantek|Tantek]] ([https://tantek.com/ tantek.com]) 14:21, 12 August 2022 (UTC)
 +
** ... add yourself
  
 
==Intent to ship==
 
==Intent to ship==
'''To''': <tt>dev-platform@lists.mozilla.org</tt><br />
+
 
 +
<blockquote>
 +
'''To''': <tt>dev-platform@mozilla.org</tt><br />
 
'''Subject''': Intent to ship: <your feature goes here>
 
'''Subject''': Intent to ship: <your feature goes here>
  
As of <target date> I intend to turn <feature> on by default [<on these platforms>]. It has been developed behind the <pref> preference. Other UAs shipping this or intending to ship it are <details>.
+
As of <target date> I intend to turn <feature> on by default [<on these platforms>]. It has been developed behind the <pref> preference. Status in other browsers is <details>.
  
''Bug to turn on by default'':  link to main relevant bug (https://bugzilla.mozilla.org/show_bug.cgi?id=) ['''note''': this bug should ideally have the ''dev-doc-needed'' keyword set]<br />
+
''Bug to turn on by default'':  link to main relevant bug (https://bugzilla.mozilla.org/show_bug.cgi?id=) Please set the ''dev-doc-needed'' keyword.
  
This feature was previously discussed in this "intent to implement" thread:  <https://groups.google.com/forum/#!forum/mozilla.dev.platform>. '''If anything changed since that thread please include that information in this email'''.
+
Standard: link to the standard; if the work is not yet part of a standard, also provide evidence that the responsible standards body has agreement that shipping the feature has broad support (see [[#Standardization requirements for shipping features|details above]])
  
==Intent to implement and ship==
+
This feature was previously discussed in this "Intent to prototype" thread: <https://groups.google.com/a/mozilla.org/g/dev-platform>. '''If anything changed since that thread please include that information in this email'''.
'''To''': <tt>dev-platform@lists.mozilla.org</tt><br />
+
</blockquote>
'''Subject''': Intent to implement and ship: <your feature goes here>
 
  
It's acceptable to combine the "intent to implement" and "intent to ship" emails as long as all the relevant requirements are met.
+
It's acceptable to merge the "intent to prototype" into the "intent to ship" email as long as all the relevant requirements are met.
  
 +
===Suggested additions===
 +
* ''TAG Review'': link to TAG review of the feature/spec. Note: Blink requires this in their intent process.
 +
** +1 [[User:Zcorpan]] (proposed)
 +
** +1 [[User:Tantek]]
 +
** ... add yourself
 +
 +
=Removing features=
 +
 +
All removals require special care.  In particular, most removals have a [[Compatibility/WebPlatform|significant web compatibility risk]] that needs to be carefully assessed.
 +
 +
If you aim to remove a feature from the web, please follow these steps:
 +
 +
# [[#Changing or evolving features|Evaluate the removal]].
 +
# Consult dev-platform with an [[#Intent to unship|intent to unship]] that includes any relevant data.
 +
# Indicate in the developer console whenever the feature is used that it's deprecated and might be removed. It's best to avoid doing this until there's agreement that the feature can be removed (which requires telemetry) as otherwise developers are needlessly spammed in the console.
 +
# Unship the feature when all is in order.
  
 
==Intent to unship==
 
==Intent to unship==
  
'''To''': <tt>dev-platform@lists.mozilla.org</tt><br />
+
<blockquote>
 +
'''To''': <tt>dev-platform@mozilla.org</tt><br />
 
'''Subject''': Intent to unship: <your feature goes here>
 
'''Subject''': Intent to unship: <your feature goes here>
  
<The body of the email should contain rationale, telemetry analysis, links to related discussions if any, and developer console suggestions.>
+
As of <target date> I intend to remove <feature> [<on these platforms>]. Status in other browsers is <details>.
 +
 
 +
''Bug to remove'':  link to main relevant bug (https://bugzilla.mozilla.org/show_bug.cgi?id=) Please set the ''dev-doc-needed'' keyword.
 +
 
 +
<Include rationale, telemetry analysis, links to related discussions if any, and developer console suggestions.>
 +
</blockquote>
 +
 
  
 
= See Also =
 
= See Also =
* [[WebAPI/DesignGuidelines]]
 
 
* [[WebAPI/WebIDL_Review_Checklist]]
 
* [[WebAPI/WebIDL_Review_Checklist]]
* [https://www.chromium.org/blink Chrome's (Blink) change process]
+
* [https://www.chromium.org/blink Chrome/Blink change process]
 +
** [https://www.chromium.org/blink/launching-features Chrome/Blink process for Launching Features] in particular
 +
** [https://bit.ly/blink-signals Signals from other implementations]
 +
* Intent To Ship bot: [https://botsin.space/@intenttoship Mastodon] [https://twitter.com/intenttoship Twitter] [https://github.com/autonome/intenttoship-bot Source code]
 +
 
 +
=FAQ=
 +
 
 +
==How do we know what web developers want?==
 +
 
 +
There's no good way to determine this currently, but feedback on GitHub, StackOverflow, workarounds in JavaScript libraries, MDN surveys, as well as use cases brought up during standardization help paint a picture.
 +
 
 +
==How do we know what other browser engines think?==
 +
 
 +
* Most of the time this should fall out of the standardization process (e.g., discussion in a GitHub repository)
 +
* Watch for "intent to *" emails on mailing lists such as [https://groups.google.com/a/chromium.org/forum/#!forum/blink-dev blink-dev]
 +
* By asking!
 +
** WebKit (Apple) can be asked on their [https://github.com/WebKit/standards-positions standards-positions repo]
 +
** Chrome: [https://source.chromium.org/chromium/chromium/src/+/main:docs/standards/positions/GoogleChrome/README.md Positions from Google Chrome Teams on Web Standards]
 +
 
 +
==How do we let other browser engines know what we think?==
 +
 
 +
* By documenting our position on [https://github.com/mozilla/standards-positions standards-positions].
 +
* Participating in public discussions of new features.
 +
* Comment on "Intent to *" threads on [https://groups.google.com/a/chromium.org/forum/#!forum/blink-dev blink-dev]. (Ideally this is not necessary, but it's a good last resort option.)
 +
 
 +
==What about prefixes?==
 +
 
 +
In the past, Mozilla has shipped experimental features with a "moz" prefix to indicate their lack of standardization (e.g., <code>mozRequestAnimationFrame()</code>). Unfortunately, this approach turned out to be harmful to the web as experimental features ended up being used in some websites before they were ready. In many cases, this meant that we were unable to innovate on certain features because to change them would break content on the web. Browsers have in some cases also been [https://compat.spec.whatwg.org/ forced to implement each other's prefixed features]. Therefore, to allow us to continue innovating without negatively affecting content on the web, '''Mozilla will no longer ship new "moz"-prefixed features''' (see [https://groups.google.com/forum/#!topic/mozilla.dev.platform/34JfwyEh5e4 Henri Sivonen's proposal]).
 +
 
 +
==Who decides?==
 +
 
 +
If the dev-platform thread results in a conflict, the respective [[Modules|module owner]] is responsible for resolving that conflict and making a decision on how to proceed.
 +
 
 +
== See Also ==
 +
* [[Standards]]

Latest revision as of 19:21, 26 June 2023

Always ask: Is this good for the web?

Adding or changing features

This process applies to all code contributions to Firefox that introduce, modify, or remove features that change how the web platform operates.

If you aim to expose a new feature to the web or change an existing feature, please follow these steps:

  1. Evaluate the new feature or change to an existing features.
  2. Email dev-platform declaring your intent to prototype. (It is okay to skip this step for small changes*.)
  3. Implement as normal. Code review rounds will take place, web-platform-tests will be written, etc.
  4. Email dev-platform declaring your intent to ship on Firefox Release.
  5. If there's no negative feedback, ship it!

*If you’re not sure, it’s unlikely to be a small change.

New features

There’s a lot of nuance that goes into adding a feature to the web. Mozilla sets a high bar for any changes we make to the web.

Making new features available requires some care and consideration.

Establish that the feature is important

We have finite resources and we want to ensure that we develop features that are important. Reasons might include:

  • It’s of strategic importance to Mozilla.
  • It contributes to Mozilla’s mission.
  • This will make us the second/third browser to ship this, enabling more web developers to use it. That is, this helps with web compatibility and moves the web forward by having another independent implementation.

Ensure that the feature is standardized

Mozilla is committed to standardization as the basis for evolving the Web. We want to ensure that features are good for our users and have broad support from other browsers, web developers, and the broader community. The standards process is how we ensure that features meet these expectations.

Our goal is that all new web-facing features are based on a specification that is the product of a recognized standards body.

Standardization requirements for prototypes

If a specification for a feature is not the product of a standards body, your intent to prototype needs to identify what steps have been taken to ensure that it will be. You should identify which standards body you believe should take the work on. Include a link to a record from that standards body that tracks the feature becoming an official product.

What you minimally need to show might differ according to the processes of the standards body:

  • W3C - an issue raised on a working group charter (not a community group)
  • WHATWG - an issue raised on the appropriate standard(s)
  • IETF - an explicit request for adoption by a working group
  • TC39 - a link to a proposal at stage 1 or higher
  • For other bodies, a request for consideration according to the procedures of the body

Being able to prototype new features allows us to learn about them, but experimentation serves to inform our choices in standards bodies. Features that have not been discussed within the processes of a standards body will require extra scrutiny to ensure that it is safe to prototype. This applies especially to W3C work that is not the product of a working group or community group; the same applies to individual submissions to the IETF.

Standardization requirements for shipping features

An intent to ship must include an update on the standardization status of the feature. We expect that shipping features will be further advanced in the standards process when they ship.

Your intent to ship should include information that shows not only that the standards body has adopted the work, but also that there is consensus that the feature is ready to be shipped. What evidence is necessary will vary, but generally this will be:

  • W3C - the specification is at the Candidate Recommendation maturity level or more advanced; shipping from a Working Draft or a less advanced specification requires evidence of agreement within the working group that shipping is acceptable
  • WHATWG - the changes have been merged into a standard; an open pull request requires additional evidence of agreement among implementers that shipping is acceptable
  • IETF - a working group draft that has been passed to the IESG for publication by the working group; a draft working group in an earlier state should show evidence that shipping is acceptable to the working group
  • TC39 - the proposal is at stage 3 or higher
  • The product of other bodies will be assessed individually

In all of these cases, try to show that there are no significant unresolved issues with a specification and that there are no objections to shipping it. Simply showing that there is support for a feature is less useful.

Shipping features that don’t meet these requirements is still possible, including features that don't show broad agreement that shipping is acceptable. If your feature needs an exception to this rule, please reach out to Firefox Technical Leadership. Any intent regarding a non-standard feature might need to include additional safeguards such as experimentation and data collection plans, risk assessments, and rollback strategies.

Ensure that Mozilla has a position on the feature

standards-positions is where Mozilla formalizes positions on new features. Open an issue there if one does not already exist.

Changing or evolving features

When making changes to existing features or even removing existing features many of the considerations stated for evaluating new features apply, but one thing that is quite different is that telemetry might be important here as in general Mozilla is pretty averse to shipping breaking changes. Coordination with the relevant standard and other browsers is usually the way to go.


Email templates for new or changed features

When announcing your intent to prototype or ship a feature, using these templates ensures that you don’t miss anything critical.

Intent to prototype

To: dev-platform@mozilla.org
Subject: Intent to prototype: <your feature goes here>

Summary: elevator pitch for the new functionality including benefits to users and web developers.
Bug: link to Bugzilla (tracking) bug.
Specification: link to the specification (see details above)
Standards Body: identify the standards body responsible for standardizing this feature if that is not obvious from the specification; if the specification is not already adopted by a standards body, link to the issue or a discussion about adoption of the work (if no discussion exists, please start that process before filing this intent)
Platform coverage: where will this be available? Android, Desktop, only exposed to privileged apps (certified app-only functionality does not require an email), etc.
Preference: if applicable, how can interested parties test this before it ships pref'd on by default?
DevTools bug: link to a Developer Tools bug coordinating work with the DevTools team to build tools for this feature.
Link to standards-positions discussion: Link to an issue in mozilla/standards-positions about what we think about the specification.
Other browsers:

  • Blink: address with "shipped" (since version X, behind what flags if any), "intent emailed" (mailing list URL), or "considering" (citation).
  • WebKit: address with "shipped" (since version X, behind what flags if any), "intent emailed" (mailing list URL), or "considering" (citation).

web-platform-tests: Please link to the test suite. If any part of the feature is not tested by web-platform-tests, or if you had to write gecko-only tests for parts of the feature, please include links to one or more of:

  • A web-platform-tests issue explaining why a certain thing cannot be tested (example).
  • A spec issue for some change that would make it possible to test (example).
  • A Bugzilla bug for the creating web-platform-tests.

Suggested additions

The above is the minimum required that should be in an "Intent to prototype" email. If you've covered those, you're good, and brevity is a virtue.

If you're looking for extra credit, or to preempt common questions, consider adding any or all of the following (all based on existing dev-platform examples, and questions asked on dev-platform in response to intent to ship emails).

  • How stable is the spec: Note that even if it's unstable that shouldn't stop us implementing; that mostly affects shipping. So as long as we're pretty sure that the basic set of functionality is stable, even if the actual names of the values are not, implementing makes sense.
  • Security & Privacy Concerns: consider providing a link to answers in this security/privacy questionnaire for a spec feature, if the spec doesn't already answer it. In particular, consider if the spec exposes new information about a user's computer or behavior that can contribute to fingerprinting.
  • Web designer / developer use-cases AKA Why a developer would use Feature X?: Provide a URL to at least briefly documented use-cases for web designers and developers that illustrate why and when they would use this feature. E.g. a link to an https://webwewant.fyi/wants/ entry with that information.
  • Example: Provide a brief code sample on how to use the API. Even with a formal specification, not everyone will know about the feature just from the name of the spec. An example will make it easier to understand how this feature can be used. This can either be an inline code sample, or a direct link to an example on the web.

Intent to ship

To: dev-platform@mozilla.org
Subject: Intent to ship: <your feature goes here>

As of <target date> I intend to turn <feature> on by default [<on these platforms>]. It has been developed behind the <pref> preference. Status in other browsers is <details>.

Bug to turn on by default: link to main relevant bug (https://bugzilla.mozilla.org/show_bug.cgi?id=) Please set the dev-doc-needed keyword.

Standard: link to the standard; if the work is not yet part of a standard, also provide evidence that the responsible standards body has agreement that shipping the feature has broad support (see details above)

This feature was previously discussed in this "Intent to prototype" thread: <https://groups.google.com/a/mozilla.org/g/dev-platform>. If anything changed since that thread please include that information in this email.

It's acceptable to merge the "intent to prototype" into the "intent to ship" email as long as all the relevant requirements are met.

Suggested additions

  • TAG Review: link to TAG review of the feature/spec. Note: Blink requires this in their intent process.

Removing features

All removals require special care. In particular, most removals have a significant web compatibility risk that needs to be carefully assessed.

If you aim to remove a feature from the web, please follow these steps:

  1. Evaluate the removal.
  2. Consult dev-platform with an intent to unship that includes any relevant data.
  3. Indicate in the developer console whenever the feature is used that it's deprecated and might be removed. It's best to avoid doing this until there's agreement that the feature can be removed (which requires telemetry) as otherwise developers are needlessly spammed in the console.
  4. Unship the feature when all is in order.

Intent to unship

To: dev-platform@mozilla.org
Subject: Intent to unship: <your feature goes here>

As of <target date> I intend to remove <feature> [<on these platforms>]. Status in other browsers is <details>.

Bug to remove: link to main relevant bug (https://bugzilla.mozilla.org/show_bug.cgi?id=) Please set the dev-doc-needed keyword.

<Include rationale, telemetry analysis, links to related discussions if any, and developer console suggestions.>


See Also

FAQ

How do we know what web developers want?

There's no good way to determine this currently, but feedback on GitHub, StackOverflow, workarounds in JavaScript libraries, MDN surveys, as well as use cases brought up during standardization help paint a picture.

How do we know what other browser engines think?

How do we let other browser engines know what we think?

  • By documenting our position on standards-positions.
  • Participating in public discussions of new features.
  • Comment on "Intent to *" threads on blink-dev. (Ideally this is not necessary, but it's a good last resort option.)

What about prefixes?

In the past, Mozilla has shipped experimental features with a "moz" prefix to indicate their lack of standardization (e.g., mozRequestAnimationFrame()). Unfortunately, this approach turned out to be harmful to the web as experimental features ended up being used in some websites before they were ready. In many cases, this meant that we were unable to innovate on certain features because to change them would break content on the web. Browsers have in some cases also been forced to implement each other's prefixed features. Therefore, to allow us to continue innovating without negatively affecting content on the web, Mozilla will no longer ship new "moz"-prefixed features (see Henri Sivonen's proposal).

Who decides?

If the dev-platform thread results in a conflict, the respective module owner is responsible for resolving that conflict and making a decision on how to proceed.

See Also