Commit graph

4365 commits

Author SHA1 Message Date
matthewp
dbd764bdeb [ci] npm run format 2021-03-30 13:24:54 +00:00
Matthew Phillips
a79f7d4077
Bundling! 🤘 (#36)
* Bundling! 🤘

* Finalize build changes
2021-03-30 09:24:26 -04:00
Fred K. Schott
f11fd265f8 revert bad snowpack example changes 2021-03-29 13:48:27 -07:00
Fred K. Schott
d2d0ddad82 update landing page 2021-03-29 11:33:14 -07:00
Fred K. Schott
33c7b953b5 update site title 2021-03-29 10:46:35 -07:00
Fred K. Schott
ae8840bf8f clean up landing page 2021-03-29 10:43:46 -07:00
Fred K. Schott
4ff1822bb9 add example www site 2021-03-29 08:43:38 -07:00
Nate Moore
9ab1f52a1c
New hydration methods (#29)
* WIP: new hydration methods

* refactor: genericize load/idle/visible renderers

* fix: do not pass "data-astro-id" to component

* docs: add hydration section to README

* docs: update README

Co-authored-by: Nate Moore <nate@skypack.dev>
2021-03-26 17:09:28 -05:00
Drew Powers
202973291f
Add PR Template (#34)
* Add Auto-format action

* Add PR template
2021-03-26 14:03:07 -06:00
Drew Powers
88df57e690
Add SSR Styles test (#35) 2021-03-26 13:59:41 -06:00
drwpow
b92b9f66e5 [ci] npm run format 2021-03-26 19:46:26 +00:00
Drew Powers
7def0463b1
Add Auto-format action (#33) 2021-03-26 13:45:53 -06:00
Drew Powers
c7b03776ee
Fix JSX CSS Modules classes (#31) 2021-03-26 13:26:36 -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
Drew Powers
11637df579
Improve styles (#30) 2021-03-25 18:23:45 -06:00
Drew Powers
04a443a888
Add React component SSR (#28)
* Add React component SSR

* Add React component SSR
2021-03-25 16:59:38 -06:00
Matthew Phillips
3db5959377
First pass at the build (#27)
This updates `astro build` to do a production build. It works! No optimizations yet.
2021-03-25 14:06:08 -04: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
Fred K. Schott
a72ab10c62
Redesign pages, remove layout nesting (#24)
* wip

* new svelte-style prop declaration is working

* got it working!

* revert h changes

* format

* style lang update
2021-03-24 16:01:28 -07:00
Matthew Phillips
3c24faa8ca
hmx ☞ astro (#22)
This changes all hmx files to astro files and updates all code to not reference hmx any more.
2021-03-24 11:45:38 -04:00
Matthew Phillips
5c1cd5b1da
Fix snowpack test (#21)
Using the new `---` syntax, it must be at the top of the file. If it's not it will loop indefinitely.
2021-03-24 08:27:01 -04:00
Fred K. Schott
222e8e19c9 import regex 2021-03-23 20:32:53 -07:00
Fred K. Schott
638f48c2fc remove last script tag 2021-03-23 20:19:38 -07:00
Fred K. Schott
fee5e3064e fix typo 2021-03-23 20:17:45 -07:00
Fred K. Schott
195b131f43 add support for frontmatter scripts 2021-03-23 20:15:44 -07:00
Fred K. Schott
5492a2dc4e update package-lock 2021-03-23 19:45:03 -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
Matthew Phillips
ed85702581
Allow HMX components in markdown (#19)
* Allow HMX components in markdown

This adds support for HMX components in markdown. The mechanism for importing is via frontmatter. We could do this differently (setup script maybe?) but since this was the easiest to implement I thought it was a good first-pass option.

* Remove node-fetch from snowpack config

* Assert that the runtime is created successfully

* Add back in the micromark extension for encoding entities

* Encode both codeTextData and codeFlowValue

* Install snowpack app's deps
2021-03-23 15:20:03 -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
Fred K. Schott
3f16550765 fix broken test 2021-03-22 23:06:25 -07:00
Fred K. Schott
799db34d55 fix broken tests 2021-03-22 21:34:47 -07: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
9de1e8feab cleanup new parser handling 2021-03-22 00:40:29 -07:00
Fred K. Schott
d125d57b3a add typescript support for expressions 2021-03-22 00:26:59 -07:00
Fred K. Schott
f28590e640 add example of props in ts 2021-03-21 22:56:36 -07:00
Fred K. Schott
e1782f9dc9 fix markdown header issue 2021-03-21 22:43:28 -07:00
Fred K. Schott
6e4367fd49 another pass at head/body handling in pages 2021-03-21 20:34:11 -07:00
Fred K. Schott
e03afbd980 add fetch support 2021-03-21 16:16:18 -07:00
Fred K. Schott
558ef18b58 get test runner running 2021-03-21 15:13:38 -07:00
Fred K. Schott
417657f138 lots of improvements 2021-03-21 00:44:42 -07:00
Matthew Phillips
2082001ff8
Add snowpack as an example project. (#11)
* 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.

* Bring snowpack example in

* Formatting
2021-03-19 17:17:38 -04: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
8ebc077cb0
Inject styling in HTML AST (#9)
* Inject styling in HTML AST

* Restore optimize structure
2021-03-19 14:55:06 -06:00
Drew Powers
d75107a20e Respect comments when scanning imports
Use es-module-lexer for import scanning in HMX scripts
2021-03-18 18:10:08 -06:00
Matthew Phillips
d27bd74b05
Refactor to enable optimizer modules (#8)
* Refactor to enable optimizer modules

This refactors HMX compilation into steps:

1. Parse - Turn HMX string into an AST.
2. Optimize - Walk the AST making modifications.
3. Codegen - Turn the AST into hyperscript function calls.

There's still more logic in (3) than we probably want. The nice there here is it gives a Visitor API that you can implement to do optimizations. See src/optimize/styles.ts for an example.

* Allow multiple visitors per optimizer
2021-03-18 16:39:17 -04:00
Drew Powers
5661b28914
Add style transforms (#7)
* Add style transforms

* Let crawler be sync
2021-03-18 11:25:19 -06:00
Matthew Phillips
48d73e3ab3
Setup error logging and provide our first parse errors (#6)
This adds parse error in a nicely formatted way, and moves the existing console.logs into a fork of the Snowpack logger. The new logger is not a singleton and won't preformat the message.
2021-03-17 15:48:49 -04:00