docs: add rationals for what we recommend

This commit is contained in:
Thomas Allmer
2019-01-24 03:16:10 +01:00
parent c09ae19c31
commit c49a541bc6
2 changed files with 66 additions and 2 deletions

View File

@@ -80,9 +80,8 @@ module.exports = {
'/demoing/': sidebar,
'/publishing/': sidebar,
'/automating/': sidebar,
'/setup/': [['/guide/', '⇐ back to Guide'], '', 'generator'],
'/faq/': ['', 'rerender'],
'/about/': [['/about/', 'About'], ['/about/contact', 'Contact']],
'/about/': [['/about/', 'About'], '/about/contact', '/about/rationales'],
},
nav: [
{ text: 'Home', link: '/' },

65
docs/about/rationales.md Normal file
View File

@@ -0,0 +1,65 @@
# Rationales
Our recommendations must fulfill certain criteria before we publish them.
1. Language or platform features/APIs must be released without a flag in the stable version of a least one browser
1. Libraries must offer an es module version
**Note**: <a name="bare-specifiers"></a>We currently have ONE exception to this rule and that is 'bare modules'.
This is such a powerful and widely-used pattern in the current JavaScript ecosystem, that if you don't use it you basically need to implement everything yourself.
We want to help you build your apps as easily and efficiently as possible, so for now we've adopted this practice as our only exception to the above rules.
The [import maps](https://github.com/WICG/import-maps) proposal aims to bring bare modules to the web browser. You can follow that repository to stay up to date.
## Workflows
We recommend implementing the following three workflows for specific tasks while developing your component or application.
You are encouraged to freely switch between them depending on what you are working on.
### Development Workflow
The ideal development environment uses no tools, just an up-to-date browser and a simple HTTP server.
::: warning
Unfortunately we are not fully there yet, because of the [bare modules exception](#bare-specifiers) you will need to have a server that at least supports them.
We recommend our [Open Web Components Dev Server](../developing/owc-dev-server.html) as it does nothing more/nothing less.
:::
When would you choose this workflow:
- When developing new features
Why would you choose this:
- Simple to setup
- As fast as it gets
### Bundling Workflow
Chances are that the web components you're building will need to run in more than just the latest browser.
In these cases it's time to open your toolbox and make sure everything works in all supported browsers.
When would you choose this workflow:
- To verify everything works in all supported browsers
- To debug legacy browsers
We recommend our [Open Web Components Building Setup](../building).
Why would you choose it:
- As good as it gets when you need to work with legacy browsers
- Auto-bundling/reloading
### Production Workflow
Once you're happy with your web components, it's time to put them somewhere more useful.
Most likely a publicly available web server.
Before you do that let's apply all the optimizations magic we can cook up.
When would you use this:
- Optimize your build
- Publishing to production
We recommend our [Open Web Components Building Setup](../building).
Why would you choose it:
- Multiple bundles for differential serving
- Conditional auto-loader for those bundles (without a special server)