Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component documentation #20

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions active-rfcs/0000-component-documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Overview

- Start Date: 2020-02-19
- Target Major Version: (2.x, 3.x) 3.x
- Reference Issues: (Github, Stack Overflow, etc)
- [https://github.com/vuejs/vue/issues/7186](https://github.com/vuejs/vue/issues/7186)
- [https://github.com/vuejs/rfcs/pull/16](https://github.com/vuejs/rfcs/pull/16)
- Implementation PR: (leave this empty)

## Summary

We need to investigate ways to standardize how we document components for 3.0.

This includes:

- Props
- name
- type
- default value
- description
- Events
- name
- arguments and their type
- description
- Slots
- name
- props and their type
- description

## Basic example

If the proposal involves a new or changed API, include a basic code example.
Omit this section if it's not applicable.

```js
// Example code implementation
```

## Motivation

There are two main uses for compiling this data

- For display in our documentation
- For generating vetur and web-types compatible json files

Our current semi-automatic solution that extracts props but requires manual typing of events and slots can and does easily lead to mismatched or missing information between actual component definition and what is shown in docs.

## Detailed design

This is the bulk of the RFC. Explain the design in enough detail for somebody
familiar with Vue to understand, and for somebody familiar with the
implementation to implement. This should get into specifics and corner-cases,
and include examples of how the feature is used. Any new terminology should be
defined here.

## Drawbacks

Why is this change necessary? What does it improve within the framework?

- implementation cost, both in term of code size and complexity
- whether the proposed feature can be implemented in userland
- integration of this feature with other existing and planned features
- cost of migrating existing Vuetify applications (is it a breaking change?)

There are tradeoffs to choosing any path. Attempt to identify them here.

## Alternatives

What other designs have been considered? What is the impact of not doing this?

## Adoption strategy

If this proposal is implemented, please consider the following:

- What steps would existing Vuetify users need to take in order to upgrade their project?
- How does this RFC affect projects in the Vuetify ecosystem?
- Can we implement a change into [eslint-plugin-vuetify](https://github.com/vuetifyjs/eslint-plugin-vuetify)

## Unresolved questions

If applicable, what aspects of this proposal are still TBD?

---

All questions pertaining to this template should be directed to the Vuetify commmunity [#rfc-discussions](https://discord.gg/eXubxyJ) channel.