Commit graph

226 commits

Author SHA1 Message Date
Matthew Phillips
d9084ff4ad
Implement fallback capability (#44)
* Implement fallback capability

This makes it possible for a dynamic component to render fallback content on the server.

The mechanism is a special `static` prop passed to the component. If `static` is true then the component knows it can render static content.

Putting aside the word `static`, is this the right approach? I think giving components the flexibility to make the decision themselves *is* the right approach.

However in this case we have a special property that is passed in non-explicitly. I think we have to do it this way because if the caller passes in a prop it will get serialized and appear on the client. By making this something we *add* during rendering, it only happens on the server (and only when using `:load`).

Assuming this is the right approach, is `static` the right name for this prop? Other candidates:

* `server`

That's all I have!

* Use `import.meta.env.astro` to tell if running in SSR mode.

* Run formatter
2021-03-31 16:10:27 -04:00
Matthew Phillips
3e82a0052d
Add minification (#42) 2021-03-30 16:07:12 -04:00
Drew Powers
ee6ef81cf3
Convert CSS Modules to scoped styles (#38)
* Convert CSS Modules to scoped styles

* Update README

* Move class scoping into HTML walker

* Fix SSR styles test

* Fix mustache tags

* Update PostCSS plugin name

* Add JSDoc comment

* Update test
2021-03-30 10:11:21 -06:00
Matthew Phillips
a79f7d4077
Bundling! 🤘 (#36)
* Bundling! 🤘

* Finalize build changes
2021-03-30 09:24:26 -04:00
Drew Powers
7def0463b1
Add Auto-format action (#33) 2021-03-26 13:45:53 -06:00
Drew Powers
3ddd3594f0
Absorb Snowpack config inside Astro (#32)
* Absorb Snowpack config inside Astro

* Add basic README

* Format tests

* Update esbuild

* Format tests
2021-03-26 13:14:32 -06:00
Nate Moore
18e7cc5af9
Scaffold language server (#25)
* wip: scaffold astro extension

* wip: scaffold astro extension

* WIP: vscode extension

* fix: autoCloseBefore

* chore: update package.json

* fix: use tsx instead of plain ts

* chore: remove dist files

* chore: remove comments

* chore: cleanup package build process, switch build to esbuild

* refactor: use shared esbuild config

Co-authored-by: Nate Moore <nate@skypack.dev>
2021-03-25 10:38:17 -05:00
Fred K. Schott
30cccdf715
add component state, top-level await support (#26) 2021-03-25 00:00:22 -07:00
Drew Powers
3f84bf3838
Update Snowpack to latest version (#20) 2021-03-23 18:05:09 -06:00
Matthew Phillips
e1c486b646 Add esbuild as a dependency 2021-03-23 15:37:34 -04:00
Drew Powers
e0353d50e7 Use <style lang>, add node_module resolution to Sass 2021-03-23 13:18:14 -06:00
Matthew Phillips
854d0feb34
Add support for React components. (#18)
* Add support for React components.

This adds support for react components via a new `extensions` config in astro.config.mjs. In the future we can extend this to do things like look at the import statements, as Snowpack does.

* Fix the tests
2021-03-23 13:47:54 -04:00
Drew Powers
1fdc1c799a
[wip] Add styles to Snowpack app (#13)
* Add styles to Snowpack app

* Bubble up file build errors

* Fix merge error
2021-03-22 18:06:58 -06:00
Fred K. Schott
d125d57b3a add typescript support for expressions 2021-03-22 00:26:59 -07:00
Fred K. Schott
e03afbd980 add fetch support 2021-03-21 16:16:18 -07:00
Fred K. Schott
417657f138 lots of improvements 2021-03-21 00:44:42 -07:00
Matthew Phillips
17c3c98f07
Initial tests set up (#10)
* Begin debugging

* Initial tests set up

This adds tests using uvu (we can switch if people want) and restructures things a bit so that it's easier to test.

Like in snowpack you set up a little project. In our tests you can say:

```js
const result = await runtime.load('/blog/hello-world')
```

And analyze the result. I included a `test-helpers.js` which has a function that will turn HTML into a cheerio instance, for inspecting the result HTML.

* Add CI

* Remove extra console logs

* Formatting
2021-03-19 17:07:45 -04:00
Drew Powers
5661b28914
Add style transforms (#7)
* Add style transforms

* Let crawler be sync
2021-03-18 11:25:19 -06:00
Drew Powers
458454dae5 Clean up TS types 2021-03-16 14:58:45 -06:00
Matthew Phillips
588b086a4d
Bring compiler into Astro (#4)
* include source compiler

* Import from JS

* Conditionally use the instance contents

Co-authored-by: Fred K. Schott <fkschott@gmail.com>
2021-03-16 16:08:11 -04:00
Drew Powers
8c45c4a856
Annoying Lint PR™ (#3)
* Add Prettier + ESLint

* Format files
2021-03-16 12:37:45 -06:00
Matthew Phillips
1f5c7c791f
Upgrade to latest snowpack pre (#2)
This contains a bunch of bug fixes for SSR we need.
2021-03-16 14:08:49 -04:00
Drew Powers
f7c2a55788 Add watch mode 2021-03-16 11:54:43 -06:00
Matthew Phillips
39ce064b5f Add a proper cli 2021-03-15 15:26:23 -04:00
Matthew Phillips
47d1c22449 magicthing -> astro 2021-03-15 14:18:39 -04:00
Matthew Phillips
af6b029e95 initial commit 2021-03-15 13:22:05 -04:00