summaryrefslogtreecommitdiff
path: root/src/compiler/index.ts (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-04-30Migrate to `yarn` monorepo (#157)Gravatar Nate Moore 1-176/+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-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-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 1-1/+3
* 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-09Parse inner JSX as Astro (#67)Gravatar Matthew Phillips 1-4/+4
* 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-06Compiler cleanup (#64)Gravatar Matthew Phillips 1-14/+6
* 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-01Fix complex MDX parsing (#50)Gravatar Matthew Phillips 1-4/+6
* 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 1-1/+15
2021-04-01Add runtime mode (#48)Gravatar Drew Powers 1-8/+2
2021-03-31Implements import.meta.request (#46)Gravatar Matthew Phillips 1-4/+3
This adds `import.meta.request` to pages (not components).
2021-03-31Extract Astro styles to external stylesheets (#43)Gravatar Drew Powers 1-9/+6
* Extract Astro styles to external stylesheets * Require relative URLs in Markdown layouts
2021-03-30Resolve component URLs during compilation (#40)Gravatar Matthew Phillips 1-6/+3
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-25Add React component SSR (#28)Gravatar Drew Powers 1-7/+5
* Add React component SSR * Add React component SSR
2021-03-25First pass at the build (#27)Gravatar Matthew Phillips 1-2/+2
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 1-1/+171
2021-03-19Initial tests set up (#10)Gravatar Matthew Phillips 1-1/+1
* 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-16Bring compiler into Astro (#4)Gravatar Matthew Phillips 1-0/+1
* include source compiler * Import from JS * Conditionally use the instance contents Co-authored-by: Fred K. Schott <fkschott@gmail.com>