summaryrefslogtreecommitdiff
path: root/src/compiler (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-04-30Migrate to `yarn` monorepo (#157)Gravatar Nate Moore 14-1750/+0
* chore: use monorepo * chore: scaffold astro-scripts * chore: move tests inside packages/astro * chore: refactor tests, add scripts * chore: move parser to own module * chore: move runtime to packages/astro * fix: move parser to own package * test: fix prettier-plugin-astro tests * fix: tests * chore: update package-lock * chore: add changesets * fix: cleanup examples * fix: starter example * chore: update changeset config * chore: update changeset config * chore: setup changeset release workflow * chore: bump lockfiles * chore: prism => astro-prism * fix: tsc --emitDeclarationOnly * chore: final cleanup, switch to yarn * chore: add lerna * chore: update workflows to yarn * chore: update workflows * chore: remove lint workflow * chore: add astro-dev script * chore: add symlinked README
2021-04-30Add portfolio example (#140)Gravatar Drew Powers 1-4/+4
* Add portfolio example * Feedback
2021-04-30Fix Svelte bundled behavior (#151)Gravatar Nate Moore 1-2/+7
* build: add svelte to dynamic component imports * fix: svelte bundling * fix: ensure svelte runtime is bundled with build * fix: svelte runtime in dev mode * fix: include svelte runtime in imports Co-authored-by: Duncan Healy <duncan.healy@gmail.com>
2021-04-27chore: update docs to new defaults (#133)Gravatar Nate Moore 1-2/+2
2021-04-27Move the `request` object from import.meta to Astro (#134)Gravatar Matthew Phillips 1-1/+6
* Move the `request` object from import.meta to Astro This moves the `request` object to the Astro "global" (really just a render-level variable). * Document Astro.request
2021-04-23Restore parse errors (#130)Gravatar Matthew Phillips 1-3/+16
2021-04-22Allow multiple JSX children appear in Mustache tag (#125)Gravatar Kevin (Kun) "Kassimo" Qian 3-11/+20
* fix(www): link styles (#100) Co-authored-by: Nate Moore <nate@skypack.dev> * Add `assets/` (#102) * chore: add assets * docs: update readme Co-authored-by: Nate Moore <nate@skypack.dev> * docs: fix readme * docs: fix readme * chore: remove github banner * Allow multiple JSX in mustache * Manually discard package-lock update (due to local use of npm v7) * Tidy up * Revert mode ts-ignore Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com> Co-authored-by: Nate Moore <nate@skypack.dev>
2021-04-19Fix dynamic React components (#111)Gravatar Matthew Phillips 1-6/+6
Another change in snowpack@3 caused this bug. It's not actually a bug in snowpack. Previously snowpack was keeping its list of installed packages in a global cache. In 3.3 it stopped doing so. We were accidentally relying on that global cache to be able to resolve dynamic components. This fixes it so that we use the frontend snowpack instance to resolve dynamic components. Doing so means they are available when we try to load them.
2021-04-15Support children inside of components (#72)Gravatar Nate Moore 1-0/+3
* chore(examples): add kitchen-sink * feat: support children in rendered components * feat: add support for rendering children in Svelte * fix: cleanup p/react fragment children * chore: add @ts-nocheck to svelte files * chore: update lockfiles * fix: types * feat: memoize frontend/renderer/utils * fix: disable eslint for compiled SvelteWrapper * fix: add missing dep Co-authored-by: Nate Moore <nate@skypack.dev>
2021-04-14Add Windows Support (#93)Gravatar Drew Powers 1-1/+2
* Add Windows to test suite * Try implicit URL
2021-04-14Improve Tailwind docs & Tailwind support (#92)Gravatar Drew Powers 1-2/+4
2021-04-13Add Astro.fetchContent API (#91)Gravatar Drew Powers 3-14/+33
2021-04-13fix: bundle client-side code for components used in .md pages (#78)Gravatar Matt Mulder 1-8/+13
2021-04-12Renaming to import.meta.fetchContent (#70)Gravatar Drew Powers 4-95/+229
* Change to import.meta.glob() Change of plans—maintain parity with Snowpack and Vite because our Collections API will use a different interface * Get basic pagination working * Get params working * Rename to import.meta.fetchContent * Upgrade to fdir
2021-04-12chore fix lint reduce errors generated (#83)Gravatar duncanhealy 5-2/+11
* add dep domhandler imported in in src/build/static * lint and jsDoc error * move domhandler to devDep * chore: add package lock * escape string jsDoc * chore: add astro dep in until prism import is refactored * chore: add snowpack example package lock
2021-04-10update package.jsonGravatar Fred K. Schott 1-2/+2
2021-04-09Use import specifier rather than filename (#71)Gravatar Drew Powers 1-1/+4
2021-04-09[ci] npm run formatGravatar matthewp 2-4/+4
2021-04-09Parse inner JSX as Astro (#67)Gravatar Matthew Phillips 8-72/+72
* Parse inner JSX as Astro This completes the compiler changes, updating the parser so that it parses inner "JSX" as Astro. It does this by finding the start and end of HTML tags and feeds that back into the parser. The result is a structure like this: ``` { type: 'MustacheTag', expression: [ { type: 'Expression', codeStart: 'colors.map(color => (', codeEnd: '}}' children: [ { type: 'Fragment', children: [ { type: 'Element', name: 'div' } ] } ] } ] } ``` There is a new Node type, `Expression`. Note that `MustacheTag` remains in the tree, all it contains is an Expression though. I could spend some time trying to remove it, there's just a few places that expect it to exist. * Update import to the transform * Transform prism components into expressions
2021-04-08[ci] npm run formatGravatar matthewp 1-1/+1
2021-04-08Add support for syntax highlighting of code blocks (#65)Gravatar Matthew Phillips 2-3/+89
* Add support for syntax highlighting of code blocks * Escape usage of backtick strings * Add workspace root for snowpack * Use prismjs/components as an external module
2021-04-06Blog Support 1/3: Data fetching (#62)Gravatar Drew Powers 1-9/+106
* Add example blog * Add author data * Improve navigation * Style nav * Add friendly error message * Throw error if import glob used for non-Markdown files * Use import.meta.collection() API instead * README fixes
2021-04-06[ci] npm run formatGravatar matthewp 1-1/+1
2021-04-06Compiler cleanup (#64)Gravatar Matthew Phillips 2-82/+77
* Compiler cleanup This is general compiler cleanup, especially around the codegen part. Goals here were too: 1. Make it possible to compile HTML recursively (needed for future astro-in-expressions work) by moving that work into its own function. 1. Get rid of collectionItems and have compiling the HTML return just a source string. Also not planned, this change gets rid of the different between components and pages. All Astro components compile to the same JavaScript. * Remove unused node types
2021-04-02Fix scoping issues (#58)Gravatar Drew Powers 2-9/+26
2021-04-02Add Tailwind support (#57)Gravatar Drew Powers 1-15/+63
2021-04-02Fix body from being scoped (#56)Gravatar Drew Powers 2-9/+30
2021-04-02Fix React import (#55)Gravatar Drew Powers 1-2/+2
* Fix React import * Change default export * Fix :visible dynamic component * Use colon to alias vue createElement Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2021-04-01[ci] npm run formatGravatar matthewp 2-8/+7
2021-04-01Fix complex MDX parsing (#50)Gravatar Matthew Phillips 5-4/+114
* Fix complex MDX parsing This allows fully MDX support using the micromark MDX extension. One caveat is that if you do something like use the less than sign, you need to escape it because the parser expects these to be tags otherwise. * Move micromark definition
2021-04-01Annoying Lint PR #2 (#47)Gravatar Drew Powers 7-15/+59
2021-04-01Add runtime mode (#48)Gravatar Drew Powers 3-23/+23
2021-03-31Implements import.meta.request (#46)Gravatar Matthew Phillips 1-4/+3
This adds `import.meta.request` to pages (not components).
2021-03-31Support for custom elements (#45)Gravatar Matthew Phillips 2-3/+49
* Support for custom elements Now you can use custom elements like so in Astro components: ```html <script type="module" src="./datepicker.js"> <date-picker></date-picker> ``` These will be resolve relative to the current astro component. In the build these modules are run through the same bundle/minify process as components. * Remove component from public * Formatting * Disable empty fn rule
2021-03-31Extract Astro styles to external stylesheets (#43)Gravatar Drew Powers 3-44/+41
* Extract Astro styles to external stylesheets * Require relative URLs in Markdown layouts
2021-03-30[ci] npm run formatGravatar matthewp 1-2/+2
2021-03-30Resolve component URLs during compilation (#40)Gravatar Matthew Phillips 2-13/+21
Previously dynamic component URLs were being resolved client-side in a weird way that only worked during dev. This change makes them handle during compilation, so it works in both (and improves readability of the dynamic import output).
2021-03-30Fix nested parens bug (#39)Gravatar Drew Powers 2-2/+7
2021-03-30Convert CSS Modules to scoped styles (#38)Gravatar Drew Powers 2-68/+117
* 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[ci] npm run formatGravatar matthewp 1-10/+11
2021-03-30Add support for doctype (#37)Gravatar Matthew Phillips 2-5/+41
* Add support for doctype * Automatically prepend doctype
2021-03-30Bundling! 🤘 (#36)Gravatar Matthew Phillips 1-3/+1
* Bundling! 🤘 * Finalize build changes
2021-03-26New hydration methods (#29)Gravatar Nate Moore 1-40/+56
* 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[ci] npm run formatGravatar drwpow 1-4/+2
2021-03-26Fix JSX CSS Modules classes (#31)Gravatar Drew Powers 1-12/+17
2021-03-25Improve styles (#30)Gravatar Drew Powers 1-12/+48
2021-03-25Add React component SSR (#28)Gravatar Drew Powers 2-21/+20
* Add React component SSR * Add React component SSR
2021-03-25First pass at the build (#27)Gravatar Matthew Phillips 3-31/+61
This updates `astro build` to do a production build. It works! No optimizations yet.
2021-03-25add component state, top-level await support (#26)Gravatar Fred K. Schott 34-4569/+902
2021-03-24hmx ☞ astro (#22)Gravatar Matthew Phillips 2-6/+6
This changes all hmx files to astro files and updates all code to not reference hmx any more.