-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add API spec template and handling instructions (#84)
* Fix emdash in readme * API spec template * Update specs/README.md PR feedback Co-authored-by: Jevan Saks <[email protected]> * PR feedback * PR feedback * PR feedback Co-authored-by: Jevan Saks <[email protected]>
- Loading branch information
Showing
3 changed files
with
243 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# Project Reunion Specs | ||
|
||
This directory contains archived and in-progress spec documents for APIs in | ||
Project Reunion. | ||
|
||
Documents in this directory are used as part of a feature or API review | ||
for features in development and form the basis for public documentation | ||
and sample code. Write specs so they can be directly consumed by an | ||
app developer or document author. | ||
|
||
## Please DO: | ||
|
||
* Provide feedback by **commenting on active pull requests** tagged with | ||
[the "ApiReview" label.](https://github.com/microsoft/ProjectReunion/pulls?q=is%3Apr+is%3Aopen+label%3AApiReview) | ||
* Provide feedback by **opening [issues](https://github.com/microsoft/ProjectReunion/issues/new/choose) | ||
regarding spec documents in this folder**. Specs in this folder | ||
are ready for implementation or have already been added to Project Reunion. | ||
* Create pull requests for new or updated specs when requested to do so | ||
as part of an issue thread. | ||
|
||
## Please DO NOT: | ||
|
||
* Create unsolicited PRs that add or modify specs. To propose a new feature | ||
please follow the Project Reunion contribution process [described here](../docs/contributor-guide.md) | ||
and start by [opening a new issue](https://github.com/microsoft/ProjectReunion/issues/new/choose). | ||
|
||
## Spec workflow | ||
|
||
For Project Reunion team members, the spec and API design workflow is: | ||
|
||
1. Ensure your proposal is approved and in plan. | ||
|
||
2. Create a new working branch ```user/<username>/<feature>``` or work in | ||
your fork of the Project Reunion repo. | ||
|
||
3. Create a new folder for your spec under the ```specs``` folder: ```/specs/<feature>``` | ||
|
||
4. Author your spec using the [spec template](spec_template.md). | ||
Please use relative links for images or other assets in the folder. | ||
Be sure to read and follow the commented instructions in the template. | ||
|
||
5. When your spec is ready for review: | ||
|
||
* Open a new pull request to merge your spec to the ```master``` branch | ||
* Reference the issue thread in the pull request to link them together | ||
|
||
6. Provide adequate time for the community and Project Reunion members to | ||
review the API spec file. | ||
|
||
7. Review requested changes with Project Reunion members and the Windows | ||
API Design representative responsible for the area. | ||
|
||
8. Complete the pull request | ||
|
||
This workflow applies to modifying API designs as well. | ||
|
||
|
||
## Specification Notes | ||
|
||
**DO** write specification templates as if they will be read by a | ||
developer trying to understand how to use the API and feature. | ||
|
||
**DO** include links to existing types, pointers into https://docs.microsoft.com | ||
when providing converged features. | ||
|
||
**DO** describe how packaged, unpackaged, AppContainer and Full Trust | ||
applications will use the feature. | ||
|
||
**DO NOT** reference Windows-internal features, plans, or scheduling. This | ||
includes links to internal specifications. | ||
|
||
**DO** use "http://task.ms/12345" links if necessary to reference internal | ||
tasks or deliverable information. | ||
|
||
**DO** update existing specifications when adding new functionality, | ||
rather than creating a new-spec-per-change. Reviewers should read the | ||
changes to the specification in a pull request. | ||
|
||
**DO NOT** gratuitously reformat specification documents, as that can | ||
obscure real changes vs editorial, whitespace, or other changes. | ||
|
||
**DO** specify any additional requirements on application authors, such | ||
as "you must define an app.config" or "you must include this package | ||
manifest markup or this application manifest markup" to use a feature. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
<!-- | ||
Before submitting, delete all <!-- TEMPLATE marked comments in this file, | ||
and the following quote banner: | ||
--> | ||
> See comments in Markdown for how to use this spec template | ||
<!-- TEMPLATE | ||
The purpose of this spec is to describe a new feature and | ||
its APIs that make up a new feature in Project Reunion. | ||
There are two audiences for the spec. The first are people | ||
that want to evaluate and give feedback on the API, as part of | ||
the submission process. When it's complete | ||
it will be incorporated into the documentation for Project Reunion. | ||
Hopefully we'll be able to copy it mostly verbatim. | ||
So the second audience is everyone that reads there to learn how | ||
and why to use this API. | ||
--> | ||
|
||
# Background | ||
|
||
<!-- TEMPLATE | ||
Use this section to provide background context for the new API(s) | ||
in this spec. | ||
This section and the appendix are the only sections that likely | ||
do not get copied into any official documentation, they're just an aid | ||
to reading this spec. | ||
If you're modifying an existing API, included a link here to the | ||
existing page(s) or spec documentation. | ||
For example, this section is a place to explain why you're adding this | ||
API rather than modifying an existing API. | ||
If you're writing a "converged" API add links into docs.microsoft.com | ||
for the existing Win32 or WinRT APIs that are being converged. | ||
--> | ||
|
||
<!-- TEMPLATE | ||
For example, this is a place to provide a brief explanation of some dependent | ||
area, just explanation enough to understand this new API, rather than telling | ||
the reader "go read 100 pages of background information posted at ...". | ||
--> | ||
|
||
# Description | ||
|
||
<!-- TEMPLATE | ||
Use this section to provide a brief description of the feature. | ||
For an example, see the introduction to the PasswordBox control | ||
(http://docs.microsoft.com/windows/uwp/design/controls-and-patterns/password-box). | ||
--> | ||
|
||
# Examples | ||
|
||
<!-- TEMPLATE | ||
Use this section to explain the features of the API, showing | ||
example code with each description. The general format is: | ||
## FirstFeatureName | ||
Feature explanation text goes here, including why an app would use it, how it | ||
replaces or supplements existing functionality. | ||
```c# | ||
void SampleMethod() { | ||
var show = new AnExampleOf(); | ||
show.SomeMembers = AndWhyItMight(be, interesting) | ||
} | ||
``` | ||
## SecondFeatureName | ||
Feature explanation text goes here, including why an app would use it, how it | ||
replaces or supplements existing functionality. | ||
```c# | ||
void SampleMethod() { | ||
var show = new AnExampleOf(); | ||
show.SomeMembers = AndWhyItMight(be, interesting) | ||
} | ||
``` | ||
Code samples should be in C# and/or C++/WinRT. | ||
As an example of this section, see the Examples section for the PasswordBox | ||
control (https://docs.microsoft.com/windows/uwp/design/controls-and-patterns/password-box#examples). | ||
--> | ||
|
||
# Remarks | ||
|
||
<!-- TEMPLATE | ||
Explanation and guidance that doesn't fit into the Examples section. | ||
APIs should only throw exceptions in exceptional conditions; basically, | ||
only when there's a bug in the caller, such as argument exception. But if for some | ||
reason it's necessary for a caller to catch an exception from an API, call that | ||
out with an explanation either here or in the Examples | ||
--> | ||
|
||
# API Notes | ||
|
||
<!-- TEMPLATE | ||
Option 1: Give a one or two line description of each API (type and member), | ||
or at least the ones that aren't obvious from their name. These | ||
descriptions are what show up in IntelliSense. For properties, specify | ||
the default value of the property if it isn't the type's default (for | ||
example an int-typed property that doesn't default to zero.) | ||
Option 2: Put these descriptions in the below API Details section, | ||
with a "///" comment above the member or type. | ||
--> | ||
|
||
# API Details | ||
|
||
<!-- TEMPLATE | ||
The exact API, in MIDL3 format (https://docs.microsoft.com/en-us/uwp/midl-3/) | ||
when possible, or in C# if starting with an API sketch. GitHub's markdown | ||
syntax formatter does not (yet) know about MIDL3, so use ```c# instead even | ||
when writing MIDL3. | ||
Example: | ||
```c# (but really MIDL3) | ||
namespace Microsoft.AppModel | ||
{ | ||
/// Represents a package on the host system. See Windows.ApplicationModel.Package for more details | ||
runtimeclass Package | ||
{ | ||
/// Returns the current package, or null if the current process is not packaged | ||
static Package Current { get; }; | ||
/// Returns the package from the system store with this full name or null if not found | ||
static Package GetFromFullName(String fullName); | ||
/// Returns packages in the given family, by name | ||
static Package[] FindByFamilyName(String familyName); | ||
} | ||
} | ||
``` | ||
--> | ||
|
||
# Appendix | ||
|
||
<!-- TEMPLATE | ||
Anything else that you want to write down for posterity, but | ||
that isn't necessary to understand the purpose and usage of the API. | ||
For example, implementation details. | ||
--> |