Commit graph

11 commits

Author SHA1 Message Date
github-actions[bot]
28c2d74dc3
Version Packages (#446)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2021-06-15 08:25:29 -04:00
Matthew Phillips
af03c90c2b
Fix usage of arrow functions as components (#426)
* 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
2021-06-14 13:24:37 -04:00
github-actions[bot]
0ef0c99b10
Version Packages (#418)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2021-06-14 08:43:03 -04:00
matthewp
a5d6e434ab [ci] yarn format 2021-06-14 12:36:32 +00:00
Matthew Phillips
271cfe6ce3
Improved JSX framework detection (#382)
* 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
2021-06-14 08:35:25 -04:00
Fred K. Schott
ab2972be83
add engines for esm support (#415) 2021-06-14 08:20:14 -04:00
github-actions[bot]
436a016408
Version Packages (#285)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2021-06-02 12:49:05 -04:00
natemoo-re
45c508fa46 [ci] yarn format 2021-05-28 23:26:50 +00:00
github-actions[bot]
092d201aee
Version Packages (next) (#227)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2021-05-28 18:25:36 -05:00
natemoo-re
94a053c99c [ci] yarn format 2021-05-28 22:20:42 +00:00
Nate Moore
3df41d2308
Bugbash! (#263)
* fix(vscode): Markdown frontmatter should use TSX, not YAML

* test: add test for #153

* chore: bump deps

* chore: update to use @astrojs scope

* fix: Markdown parse error when only child is `{expression}`

* fix: update renderer edge cases

* fix: failing test

* fix: update renderer
2021-05-28 17:19:40 -05:00