* Honor user's hmr settings
This contains 2 fixes:
* If the user sets the hmrPort in their own snowpack config we use that port.
* If the user sets `window.HMR_WEBSOCKET_URL` we defer to that
* Adds the changeset
* Prevent postcss from crashing when scoping class without a body
For some reason postcss will keep running the plugin over and over on a class without a body if we modify the `selector` (this triggers it as being "dirty"). It doesn't do this for selectors with a body. But the fix was easy enough, only scope a rule once.
Closes#340
* Add a changeset
* Fix usage of arrow functions as components
This fixes the React and Preact component as arrow function use-case by checking for the prototype property (arrow functions don't)
* Check the prototype
* fix scoped selector when using escaped colon
* update scoped styles test
* add changeset
* update `scopeRule` test
* update `scopeRule` test
* update css minifier to account for windows-style line breaks
* Make doctype be case insensitive
Fixes#413
* Make doctype completely case insensitive
* Make check for style scoping doctype override be case insensitive
* Check for doctype in the right place
* Improved JSX framework detection
This improves the JSX detection and adds a bunch of test. The following is improved:
* If an error throws because of a coding mistake, those errors will be reported.
* We properly detect class components for both Preact and React. We don't have to "try to render" these.
It's still possible that error messages might be obscured in this scenario:
A Preact function component that uses hooks (or another preact specific feature) that has a coding mistake. The React renderer might throw when it uses the Preact hook. That error will be reported rather than the real coding mistake.
This is because we can't distinguish between errors that are due to the wrong framework and errors that the user caused.
I might reach out to the Preact community and see if they can think of a better solution to this problem. This will come up when other JSX based frameworks have renderers. I still think that having multiple frameworks in the same project is a feature worth trying to preserve.
* Move try/catch into the __astro_component
* Allow createCollection() to fetch remote data
Fixes#378
* Update docs
* revert isomorphic-fetch, see if ci passes
Co-authored-by: Fred K. Schott <fkschott@gmail.com>
* create initial docs site
* change copy for title and header to say Astro Docs
* create initial docs site
* remove text merge changes
* change workspaceRoot and remove yarn.lock from docs-www
* add docs-www to workspace
Co-authored-by: Kitto Khrangtong <kitto@queensboro.com>
* Apply favicon to the docs template
* Fix Sidebar category headers aren't clickable
Fixes#385
* Improve Docs example documentation
* Fix Documentation List on getting started page