From 30cccdf7154b6470e876464da9e412af10894dd5 Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Thu, 25 Mar 2021 00:00:22 -0700 Subject: [PATCH] add component state, top-level await support (#26) --- .../astro/components/BaseLayout.astro | 2 +- .../astro/components/MainLayout.astro | 3 - .../astro/components/PokemonLookup.astro | 16 ++ .../astro/layouts/content-with-cover.astro | 2 +- examples/snowpack/astro/pages/guides.astro | 3 - examples/snowpack/astro/pages/news.astro | 18 +- package-lock.json | 112 ++++++++++-- package.json | 10 +- snowpack-plugin.cjs | 2 +- src/@types/astro.ts | 2 +- src/@types/optimizer.ts | 2 +- src/{codegen/index.ts => compiler/codegen.ts} | 105 ++++++++--- src/compiler/index.ts | 172 +++++++++++++++++- src/{ => compiler}/optimize/index.ts | 4 +- src/{ => compiler}/optimize/styles.ts | 4 +- src/logger.ts | 2 +- src/micromark-collect-headers.ts | 1 - src/{compiler => parser}/README.md | 0 src/{compiler => parser}/Stats.ts | 0 src/{compiler => parser}/config.ts | 0 src/parser/index.ts | 1 + src/{compiler => parser}/interfaces.ts | 6 +- src/{compiler => parser}/parse/acorn.ts | 2 +- src/{compiler => parser}/parse/index.ts | 0 .../parse/read/context.ts | 0 .../parse/read/expression.ts | 2 +- src/{compiler => parser}/parse/read/script.ts | 0 src/{compiler => parser}/parse/read/style.ts | 0 .../parse/state/fragment.ts | 0 .../parse/state/mustache.ts | 4 +- src/{compiler => parser}/parse/state/setup.ts | 0 src/{compiler => parser}/parse/state/tag.ts | 6 +- src/{compiler => parser}/parse/state/text.ts | 0 .../parse/utils/bracket.ts | 0 .../parse/utils/entities.ts | 0 src/{compiler => parser}/parse/utils/html.ts | 0 src/{compiler => parser}/parse/utils/node.ts | 0 src/{compiler => parser}/utils/error.ts | 0 .../utils/full_char_code_at.ts | 0 src/{compiler => parser}/utils/fuzzymatch.ts | 0 .../utils/get_code_frame.ts | 0 src/{compiler => parser}/utils/link.ts | 0 src/{compiler => parser}/utils/list.ts | 0 src/{compiler => parser}/utils/names.ts | 0 src/{compiler => parser}/utils/namespaces.ts | 0 src/{compiler => parser}/utils/nodes_match.ts | 0 src/{compiler => parser}/utils/patterns.ts | 0 src/{compiler => parser}/utils/trim.ts | 0 src/runtime.ts | 2 +- src/transform2.ts | 172 ------------------ 50 files changed, 397 insertions(+), 258 deletions(-) create mode 100644 examples/snowpack/astro/components/PokemonLookup.astro rename src/{codegen/index.ts => compiler/codegen.ts} (77%) rename src/{ => compiler}/optimize/index.ts (94%) rename src/{ => compiler}/optimize/styles.ts (98%) rename src/{compiler => parser}/README.md (100%) rename src/{compiler => parser}/Stats.ts (100%) rename src/{compiler => parser}/config.ts (100%) create mode 100644 src/parser/index.ts rename src/{compiler => parser}/interfaces.ts (95%) rename src/{compiler => parser}/parse/acorn.ts (99%) rename src/{compiler => parser}/parse/index.ts (100%) rename src/{compiler => parser}/parse/read/context.ts (100%) rename src/{compiler => parser}/parse/read/expression.ts (99%) rename src/{compiler => parser}/parse/read/script.ts (100%) rename src/{compiler => parser}/parse/read/style.ts (100%) rename src/{compiler => parser}/parse/state/fragment.ts (100%) rename src/{compiler => parser}/parse/state/mustache.ts (99%) rename src/{compiler => parser}/parse/state/setup.ts (100%) rename src/{compiler => parser}/parse/state/tag.ts (99%) rename src/{compiler => parser}/parse/state/text.ts (100%) rename src/{compiler => parser}/parse/utils/bracket.ts (100%) rename src/{compiler => parser}/parse/utils/entities.ts (100%) rename src/{compiler => parser}/parse/utils/html.ts (100%) rename src/{compiler => parser}/parse/utils/node.ts (100%) rename src/{compiler => parser}/utils/error.ts (100%) rename src/{compiler => parser}/utils/full_char_code_at.ts (100%) rename src/{compiler => parser}/utils/fuzzymatch.ts (100%) rename src/{compiler => parser}/utils/get_code_frame.ts (100%) rename src/{compiler => parser}/utils/link.ts (100%) rename src/{compiler => parser}/utils/list.ts (100%) rename src/{compiler => parser}/utils/names.ts (100%) rename src/{compiler => parser}/utils/namespaces.ts (100%) rename src/{compiler => parser}/utils/nodes_match.ts (100%) rename src/{compiler => parser}/utils/patterns.ts (100%) rename src/{compiler => parser}/utils/trim.ts (100%) delete mode 100644 src/transform2.ts diff --git a/examples/snowpack/astro/components/BaseLayout.astro b/examples/snowpack/astro/components/BaseLayout.astro index 2e141a83f..040739515 100644 --- a/examples/snowpack/astro/components/BaseLayout.astro +++ b/examples/snowpack/astro/components/BaseLayout.astro @@ -3,7 +3,7 @@ import Banner from './Banner.astro'; import Nav from './Nav.astro'; --- - +