UNPKG

3.22 kBMarkdownView Raw
1# Contributing to Composi
2
3Thank you for taking the time to read our contribution guidelines. You can start contributing in many ways like filing bug reports, improving the documentation, and helping others.
4
5## Style
6
7Composi is written in ES6. We do this to take better advantage of modern JavaScript features. We use ES6 import and export for structing the code. This is to enable proper bundling with Rollup.
8
91. Use let or const for variables.
102. Use destructuring where possible.
113. Use arrow functions where appropriate for block scoping and conciseness.
124. When using arrow functions, if there is one parameter, do not enclose it in parenthesis:
13
14```javascript
15 const announce = message => alert(message)
16```
175. Any classes should be in ES6. The older prototype-based classes will not be accepted.
186. Any ES6 features that cannot be polyfilled will not be accepted.
19
20
21## Bugs
22
23Before submitting a bug issue, search the Composi repository issues to make sure the same issue has not already been submitted.
24
25Be thorough in your title and report, don't leave out important details, describe your setup and [include any relevant code](https://en.wikipedia.org/wiki/Minimal_Working_Example) with your issue.
26
27When providing code samples in your issue, make sure to enclose them in Github markup block syntax:
28
29\`\`\`javascript
30
31code here...
32
33\`\`\`
34
35Possible code block tags are:
36
37\`\`\`javascript
38
39\`\`\`html
40
41\`\`\`css
42
43\`\`\`jsx
44
45## Performance Improvement
46
47If you feel you can improve the performance of any part of Composi, please provide a perf test with before and after results. This may require links to an online perf test site.
48
49Also, if you notice a performance issue affecting your app, please let us know about it. This might be something in Composi that we can address or it might be the result of how you are using Composi.
50
51## New Feature
52
53If you have an idea for a new feautre that you think would be useful for other users, please let us know. Make sure the title and description clearly explain what this feature is. Remember that examples are worth a thousand words, so try to provide one, at least as a code block.
54
55Please be aware that what might seem like a good idea to you might be out of scope for what we want Composi to be.
56
57## Documentation
58
59Please let us know if you find any typos or egrecious gramatical errors in the docs. The repository's documentation in in the `/docs` folder.
60
61We are also open to pull requests that improve the documentation for ease of comprehension, or that provide better examples or new examples where missing.
62
63## Tests
64
65Before making a pull request, do a build and then run the tests:
66
67```bash
68npm run build
69
70npm test
71```
72
73If you are proposing a new feature, you will propably need to create a test to make sure it is working as expected. We use Mocha and Chai for tests. These are run in the browser so that we can test actual DOM results. Depending on the feature you are proposing, you may not need actual access to the DOM but a mere test on a vNode might be sufficient.
74
75Examine the current tests to see how we use Mocha and Chai with Composi. Remember, if you've made a change to Composi's source code, you will need to build before running the tests.