* Adding a flag to disable HTTP streaming
* refactor: adding support for SSG builds
* handling string responses in the server runtime, adding tests
* removing streaming CLI flag
* removing import.meta.env.STREAMING
* include Content-Length header when streaming is disabled
* Verifying content-length header in dev
* fix: default streaming to enabled in the base App server
* TEMP: disabling the production test to investigate the test-adapter
* re-enabling the test with an adapter option to disable streaming for the test
* fix: use the existing TextEncoder to get the body's byte length
* moving config to build.streaming, ignoring it in `dev`
* fixing dev test to expect response streaming
* chore: add changsets
* removing the new config option all together 🎉
* remove temp debug log
* Updating astro changeset now that streaming isn't a config option
* fix: don't throw an error when the lit renderer doesn't provide a clientEntrypoint
* updating the framework-lit example to match new behavior
* fix: updating the playground example to latest lit syntax
* Add preact/compat renderer (likely broken)
Based on the current Preact renderer and the old preact/compat implementation: f892aeb52f/packages/renderers/renderer-preact/compat/index.js
* Make sure name is consistent
* Switch to single integration with compat option
* fix: add module-resolver to alias react => preact/compat
* fix: preact/compat mode
* chore: remove client-compat entrypoint
* chore: add e2e test for preact/compat
* Try to fix frozen lock file error
* Add changeset
* Update README to new structure & document `compat`
* Fix changeset wording
* Fix README typo
* Tweak wording
Co-authored-by: Kevin Zuniga Cuellar <46791833+kevinzunigacuellar@users.noreply.github.com>
Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Co-authored-by: Kevin Zuniga Cuellar <46791833+kevinzunigacuellar@users.noreply.github.com>
* Adds a basic @astrojs/prefetch integration
* adding tests for custom selectors
* missed in last commit
* Adding a few docs, removing the option for `selectors` to be an element array
* adding an option for the concurrency limit
* fixing test for updated integration options
* Update packages/labs/prefetch/src/client.ts
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
* nit: removing the NodeJS.Timer type to allow typescript to infer the return
* updating docs for default selector with ~=
* Skip prefetching on 2G connections, or when data saver is enabled
* refactor: moving to packages/integrations, Astro Labs TBD down the road
* README typo fix
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
* feat: add private `addPageExtensions` hook
* feat: experimental JSX support
* chore: remove experimental.jsx option from config
* chore: remove automatic astro JSX runtime detection
* fix: throw warning when client:* directive is used but no client entrypoint is found
* feat: add slot support to renderer
* chore: remove client entrypoint from jsx renderer
* test: add barebones JSX test
* test: add frameworks-in-jsx test
* feat: improve error message when no matching import is found
* feat: support slots
* fix: do not strip `astro-slot` when using JSX renderer
* fix: handle null values in isVNode
* fix: do not transform slots for elements
Co-authored-by: Nate Moore <nate@astro.build>
* Start of streaming
* New lockfile
* Base should be Uint8Arrays
* Remove the ability to throw from a component
* Add a warning when returning a Response from a non-page component
* Adds a changeset
* Added test for dir in astro:build:done
* Added changeset
* Change pathname for Windows
* Change changeset generated file summary
* Eliminate testing of branches by os
* Eliminate OS dependence
* Change changeset generated file summary
* Using fileURLToPath
* Cross-platform fixes.
* Use posix for everything.
* Pass an empty string for relative from
* Use path.join for the correct value
* Update packages/astro/test/static-build-dir.test.js
* Update packages/astro/test/static-build-dir.test.js
* Update packages/astro/test/static-build-dir.test.js
* Remove trailing slash
* add toString
* fix syntax error
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
* feat: pass all slots to renderers
* refactor: pass `slots` as top-level props
* test: add named slot test for frameworks
* fix: nested hydration, slots that are not initially rendered
* test: add nested-recursive e2e test
* fix: render unmatched custom element children
* chore: update lockfile
* fix: unrendered slots for client:only
* fix(lit): ensure lit integration uses new slots API
* chore: add changeset
* chore: add changesets
* fix: lit slots
* feat: convert dash-case or snake_case slots to camelCase for JSX
* feat: remove tmpl special logic
* test: add slot components-in-markdown test
* refactor: prefer Object.entries.map() to for/of loop
Co-authored-by: Nate Moore <nate@astro.build>
* Inline small hoisted scripts
This makes it so that small hoisted scripts get inlined into the page rather than be fetched externally.
* Ensure we don't inline when there are imports
* Fix ts
* Update tests with new url structure
* Adds a changeset
* enabling eslint on the all packages and tests
* enabling for all packages
* TEMP: adding an only() test to verify it fails CI
* using our eslint config and ignore in CI
* removing the temporary .only() test
* update lock file
* lint: fixing new test with a no-shadow warning
* chore: update lock file
* Support re-exporting astro components containing client components
* Include metadata for markdown too
* Fix ssr, probably
* Inject post-build
* Remove tagName custom element test
* Allows using the constructor for lit elements
* Fix hoisted script scanning
* Pass through plugin context
* Get edge functions working in the edge tests
* Fix types for the edge function integration
* Upgrade the compiler
* Upgrade compiler version
* Better release notes for lit
* Update .changeset/unlucky-hairs-camp.md
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
* Properly test that the draft was not rendered
* Prevent from rendering draft posts
* Add a changeset about the build perf improvement.
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
* restarting dev server between each error test
* re-enabling the test on Linux CI
* trying separate describe() suites per error test
* narrowed the issue down, disabling for more investigation
* not: removing unrelated whitespace change
* fix: filter out falsy integration from telemetry
Falsy integrations are now ignored in `@astrojs/telemetry`
This error should no longer occur,
```ts
error Cannot read properties of null (reading 'name')
at file:///workspaces/bundle/node_modules/.pnpm/@astrojs+telemetry@0.1.2/node_modules/@astrojs/telemetry/dist/events/session.js:53:117
...
```
* ci: add tests for optional integrations
* ci: add changeset
* fix(@astrojs/telemetry): count number of optional integrations in use
* ci: add test for counting the total number of optional integrations in use
* ci: update changeset
* chore: make the changes @tony-sull sugested
* revert(@astrojs/webapi): mod.d.ts -> a4c78b5: [ci] format
* ci: remove `@astrojs/webapi` patch change
* chore(@astrojs/telemetry): remove totalIntegrations payload field
* fix(@astrojs/telemetry): add optional integrations field
* ci: add changeset
* Adding support for base64 encoded responses in Netlify Functions
* chore: add changeset
* removing the regex check for a more simple header-based check
* nit: cleaning up the readme a bit
* Remove redundant hydration scripts
* Prebuild the island JS
* Fix build
* Updates to tests
* Update more references
* Custom element test now has two classic scripts
* Account for non-default exports
* Restructure hydration directives
* Move nested logic into the island component
* Remove try/catch
* Update MarkdownInstance type
The return of the `default` function includes the same `frontmatter`
data as the parent object, merged with the `astro` data. The inclusion
of that frontmatter type was previously not recognized by TS, and fell
back to a `Record<string, any>`. This change persists the more accurate
type, as the runtime code does.
* fixup! Update MarkdownInstance type
(This change is what I'd personally do, but I don't really know how you
expect people to use `MarkdownContent` in practice, or if there is some
deeper benefit you wish to exploit by leaving it as an interface instead
of a type.
* feat(integrations): support optional integrations
By making integration optional, Astro can now ignore null or undefined Integrations instead of giving an internal error most devs can't read/won't understand.
This also enables optional integrations,
e.g.
```ts
integration: [
// Only run `compress` integration in production environments, etc...
import.meta.env.production ? compress() : null
]
```
* ci: add tests for optional integration
* docs: add changelog
* fixing reliability issue in component HMR tests
* fix: test change snuck into the last commit
* TEMP: logging to track down ubuntu CI failure
* disabling svelte test for now
* reverting unrelated .d.ts change
Changed astro.config.js text to a link to the supported config file types, since above it appears astro.config.mjs and mixing extensions could lead to confusion (plus in that page linked we can see the valid extensions)
* Astro.site should be defaulted to localhost
* test: verify Astro.site default value
* chore: add changeset
* test: matching a URL regex to ignore specific port numbers
* vite-astro-plugin should ignore unresolved relative imports
* test: add error test for unresolved imports
* chore: add changeset
* moving the test to it's own describe
* chore: cleaning up the test's dev server
* TEMP: skipping the old test again to see if that's breaking CI
* test: verifying the dev server recovers
* TEMP: is it the new test breaking ubuntu CI?
* testing whether the errors suite only handles one test case in ubuntu
* disabling the Errors suite on linux for now to avoid reliability issues
* Fix importing CSS packages in frontmatter
* Formatting
* Only update if the source code contains the import
* Consolidate the two plugins
* we do need a pre and a post
* Adds a changeset
* feat: improve HMR handling for styles, persisted islands
* Also using data-persist to keep injected <style>'s during HMR
* Updating E2E tests to validate that .astro HMR doesn't blow away component styles
* chore: add changeset
* copy/paste error when cleaning up tests
* big change - using inline <style> blocks instead of <link>s in dev
* Updating tests that were expecting <link> stylesheets in dev
* updating all E2E tests to use workspace versions for astro deps
* TEMP: adding debug logging to see why the Ubuntu test only fails in CI
* fix: Svelte styles are automatically handled by Vite, we can skip them in dev
* fix: svelte is more interesting, we need Astro to inject styles only until hydration
* avoiding extra HMTL noise by only including the data-astro-injected URL for svelte components
* TEMP: ubuntu CI doesn't like the svelte HMR test...
* disabling the svelte component test on ubuntu for now
Co-authored-by: Tony Sullivan <tony.f.sullivan@outlook.com>
* chore: fix typo in remark tests
* test: add test cases for markdown expressions in header
* fix: avoid evaluating JSX-like expressions inside inline code in heading
* fix: generate slug for id including values in backtick blocks
* fix: remove source map consumption from babel transform
* refactor: move inputSourceMap to integration option
* tests: add newline ex to test build and dev
* chore: change back to babel.transformAsync
* chore: changeset
* test commi
* add video
* test video include
* actually close the tag
* try directly pasting the video link
* remove the quote I forgot about
* figured out how to properly upload a video to github
* remove unneeded media directory
* why tailwind
* Installation and Usage
* Troubleshooting
* Add examples section
* Update packages/integrations/tailwind/README.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update packages/integrations/tailwind/README.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update packages/integrations/tailwind/README.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update packages/integrations/tailwind/README.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* TOC + layout tweaks
* separated, and example re: warning to not use Tailwind with other styling method
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* WIP: the leading /@fs broke script HMR
* Revert "WIP: the leading /@fs broke script HMR"
This reverts commit 84fce366268033261369aed48f909e59e78bf3e4.
* Metadata needs to strip off /@fs from hoisted script URLs
* adding a test for hoisted script HMR support
* removing 2 second timeout on navigation, allow default 30 seconds
* simplifying the hoisted script test sync
* TEMP: bubbling up console logs to track down windows failure
* removing temp logging
* disabling the test on windows for now
* chore: adding changeset
* feat: add rawContent obj with html helper
* refactor: change toString to function call
* test: rawContent helpers
* chore: update MarkdownInstance type
* refactor: parseHtml -> html
* chore: changeset
* fix: remove needless async heading on content version
* fix: fixLineEndings helper on unit tests
* refactor: change api to raw and compiled
* chore: add new type to env.d.ts
* docs: JSdocs for raw and compiled
* refactor: change API AGAIN to rawContent, compiledContent
* chore: update changeset
* Fix VITE_ASSET bug
* Updated test that depended on esbuild output
* Fix some more tests
* Fix css config and postcss tests
* Git client only working
* Fix static build test
* Update tailwind tests
* Fix build
* Fix css bundling tests
* Updated some more tests for windows
* Remove tests that are no longer relevant
* Cause it to break
* Fix bug and add explanation
* Adds a changeset
* Inline comments about what the hashing is doing
* Update packages/astro/src/vite-plugin-build-css/index.ts
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
* Update to the lockfile
* Minify css
* Update tailwind tests
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
* feat: use internal MDX tooling for markdown + components
* fix: improve MD + component tests
* chore: add changeset
* fix: make tsc happy
* fix(#3319): add regression test for component children
* fix(markdown): support HTML comments in markdown
* fix(#2474): ensure namespaced components are properly handled in markdown pages
* fix(#3220): ensure html in markdown pages does not have extra surrounding space
* fix(#3264): ensure that remark files pass in file information
* fix(#3254): enable experimentalStaticExtraction for `.md` pages
* fix: revert parsing change
* fix: remove `markdown.mode` option
* WIP: proof of concept fix to use absolute paths
* correct fix to handle absolute paths and config.base
* adding tests for hydration scripts with config.base
* chore: add changeset
* fix: ensure posix paths are used for Windows compat
* adding Tailwind E2E tests with Playwright
* package.json updates
* adding e2e tests to CI workflow
* using e2e for dev tests, mocha for build tests
* refactor: sharing test-utils helpers
* chore: update lockfile
* Adding contributing docs
* Revert "refactor: sharing test-utils helpers"
This reverts commit 48496f43bc99eab30747baf6e83041ba4932e786.
* refactor: simpler solution to resolving e2e test fixtures
* chore: updating lockfile
* refactor: cleaning up how URLs are resolved in e2e tests
* install playwright deps in CI
* ensure playwright deps are installed during CI
* adding a basic HMR test for tailwind styles
* using @e2e for playwright test packages
* adding react hydration and HMR tests
* adding hydration and HMR tests for preact
* adding svelte hydration and HMR tests
* adding solid-js hydration and HMR tests
* adding solid hydration and HMR tests
* adding vue hydration and HMR tests
* adding client:media tests
* fixing Lit hydration and HMR tests
* fixing up the Vue e2e tests
* fixing up svelte tests
* chore: test cleanup
* chore: cleaning up test element IDs
* chore: updating lock file
* chore: update lockfile after merge
* TEMP: disabling React e2e tests
* Revert "TEMP: disabling React e2e tests"
This reverts commit ed1bad9cbc.
* updating to use the new editFiles helper
* chore: updating lock file
* updating lock file
* updating lockfile
* TEMP: watching for console logs
* TEMP: testing typescript tests
* updating test:e2e scripts for config file
* seems like it didn't find the config file?
* use a fresh dev server for each test
* removing Lit tests for now
* Revert "removing Lit tests for now"
This reverts commit 4970a8093e.
* updating test config for CI
* WIP: disabling HMR tests to track down why they're unreliable
* TEMP: logging to debug HMR test
* afterEach isn't a global in Playwright
* fix: the test's file reset helper was using a URL not filepath
* one last try, why is the HMR test hanging at cleanup?
* resetting files after tailwind HMR test
* create the onNextChange watcher before editFile is called
* moving the file changed sync into editFile()
* code refactor + Astro Component HMR test
* chore: lint fixes
* adding a test suite for the framework-multiple example app
* refactor: make node-fetch external in rollup build
* deps: make node-fetch standard dep
* refactor: switch to node-fetch pkg ref in fetch.ts
* chore: changeset
* chore: bump webapi to minor change
* only trim /1 from canonical URLs for paginate() routes
* chore: fixing eslint warning
* chore: add changeset
* typo: copy paste error
* adding a test validation error message
* verifying canonical for all three test routes
* TEMP: extra test logging to track down the failure
* TEMP: additional test logging to see what the failing CLI messages are
* TEMP: digging deeper, it's getting stuck on port 3000 is taken
* TEMP: why is it breaking when LOCAL isn't logged?
* TEMP: still digging, strange how consistent this failure is
* finally found it - the new test wasn't closing the dev server...
* WIP: have a few test failures to track down
* WIP: still a few failures to fix
* WIP: fixes the issue of dynamic routes stepping on static routes
* Resolve route priority before building routes for `getStaticPaths()`
* chore: adding comments explaining why this filter is needed
* chore: adding changeset
* got too fancy with the test suite, these routes weren't valid
* simplifying the test cases
* TEMP: is this test breaking my CI run?
* Revert "TEMP: is this test breaking my CI run?"
This reverts commit 291af2a1b6f075ebfc74002886e43110731b3e1b.
* slots-preact didn't list @astrojs/preact as a dep
* reverting copy/paste error
* test: add with-components to astro-markdown fixture
* fix: markdown pathname with /@fs prefix
* feat: add loadMetadata helper for md
* feat: fix components in Astro.glob results!
* fix: md import path
* Revert "feat: add loadMetadata helper for md"
This reverts commit 76cf96f4be3d0e19589f84025c0131352d0b6cc8.
* fix: add back $$loadMetadata helper
* feat: add second comp framework to md test
* chore: core/render/dev lint
* chore: changeset
* fix: short circuit if mod doesn't have metadata
* fix: skip mod graph preloading in dev
* refactor: make md metadata check recursive
* refactor: extract metadata helper to util
* fix: remove unecessary mod graph query
* fix: move md import flag to util for deno bundling issue
* fix: remove 'dev' mode from test utils build
* feat: add global hashset for seen metadata
* refactor: flip Promise.all to for await for perf!
* Revert bc I was wrong! "refactor: flip Promise.all to for await for perf!"
This reverts commit da8a6873f5.
* WIP: this regex should handle .html as well
* much simpler! Just fix the req.url, don't touch the manifest
* only handle .html requests when config.build.format === 'file'
* chore: add changeset
* Allow overriding build vite config options
* Adds a changeset
* Test svelte
* Move plugins down
* Assign after for the client too
* Spread output options on manually
* Remove .only
* fix(#3309): use system default locale
* fix(#3309): use system default locale in create-astro
* test: add locale regression tests
* test: add i18n regression test
* Re-enable error recovery test
* Doing some debugging
* Remove extra debugging
* longer wait
* make it wait even longer just to check
* Wait a very long time
* await the change, and then a little bit
* Give a longer timeout for the error recovery test
* OK, make it *very* long
* Run error tests separately
* Get rid of wait