* use shorthash for filename of data url images
* add changeset
* add fixture to test processing of data url images
* run format
* update changeset
* fix test
* Update .changeset/dull-worms-own.md
---------
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
* Revert "Remove dependency on path-to-regexp (#11983)"
This reverts commit 633eeaa9d8.
* Add test for regression
* Add a changeset
* Pin path-to-regexp
* Remove experimental.serverIslands flag
* update link to the guide
* Add changeset
* Update packages/astro/src/core/errors/errors-data.ts
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update packages/astro/src/core/errors/errors-data.ts
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Unflag Server Islands
* update example
* Add changeset
* Only append serverIslands route if there is one
* Update .changeset/strange-sheep-film.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* check buildoutput instead
* Update packages/astro/src/core/errors/errors-data.ts
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
* remove flag
---------
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
* feat: changesets for the hybrid removal
* Update .changeset/afraid-apricots-buy.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Apply suggestions from code review
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* feat: support pattern arrays with glob
* feat: allow arrays of patterns for content layer
* Apply suggestions from code review
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Allow passing into the crypto key via ASTRO_KEY
* Add a changeset
* Add test
* Use the node package
* omg
* Create a new create-key command
* linting
* lint again
* Update the changeset
* Provide an error message when Actions throws in setup
* Update .changeset/many-turtles-tie.md
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
---------
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
* fix: don't keep data store in node_modules during dev
* Lint
* Fix test
* Wait for data store
* Use helper for data store file
* Fix data store file helper
* Lint
* Handle case where Vite already knows about save
* Allow integrations to refresh content layer data
This reverts commit 90a862fc94.
* Add test
* Add changeset
* Add wait in test
* Dispose of queue
* Skip if no content layer collections
* Use spaces in markdown
* fix: don't keep data store in node_modules during dev
* Lint
* Fix test
* Apply suggestions from code review
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Re-order tests
* Wait for data store
* Lint
* Handle case where Vite already knows about save
---------
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Add support for remote LibSQL
* Add support for local memory DB
* Add some tests
* Add push support
* Fix switch cascading
* Update .changeset/healthy-boxes-poke.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update packages/db/src/runtime/db-client.ts
[skip ci]
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
* Use independent env vars for LibSQL and Studio backends
* Expand comment regarding missing table
* Apply suggestions from code review
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
* extend virtual module astro:transitions/client to exports swapFunctions
* use virtual module in e2e tests
* Update .changeset/new-monkeys-sit.md
* Update .changeset/new-monkeys-sit.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update new-monkeys-sit.md
* Update swap-functions.ts
restoreFocus() bindings are now returned by saveFocus() and do not make sense anymore as a member of the swapFunctions object
* take over suggestion
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update .changeset/new-monkeys-sit.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* feat: support setting timeout for `client:idle`
* tst: add client:idle timeout e2e test
* Update .changeset/clever-emus-roll.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update .changeset/clever-emus-roll.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* nit: we wait for times, not values!
---------
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* feat: add `Astro.route`
* change logic and add test
* rebase
* rebase
* rename to `Astro.routePattern`
* chore: added more tests
* update test
* add leading slash
* Update astro.ts
small fix to example
* Create odd-otters-look.md
---------
Co-authored-by: Reuben Tier <64310361+TheOtterlord@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* fix(astro): prevent prefetching of the same urls with different hashes
* add changeset
* Update packages/astro/src/prefetch/index.ts
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
* Update .changeset/nasty-ladybugs-whisper.md
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
---------
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
* feat: support effects on form validators
* feat: support object passthrough on form input
* feat: support infinitely nested effects with simplified types
* feat(test): ensure arbitrary schemas work with form data
* chore: changeset
* fix: support zod pipe()
* fix: remove static usage warning with isPrendered flag
* fix(test): cookie is empty for prerendered routes in dev
* chore: add test route
* chore: changeset
* Use GET and preload links on Server Islands
Use origin/next
Remove since
* Add test to verify large islands work
* Update based on feedback
* Merge conflict fixed
* Update test
* fix: adapter features messaging
* Apply suggestions from code review
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update .changeset/long-months-burn.md
Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com>
---------
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com>
* Empty commit
* Changeset
* feat: add Content Layer loader (#11334)
* wip
* wip
* wip
* Update demo
* Add meta
* wip
* Add file loader
* Add schema validation
* Remove log
* Changeset
* Format
* Lockfile
* Fix type
* Handle loading for data store JSON
* Use rollup util to import JSON
* Fix types
* Format
* Add tests
* Changes from review
* fix: sync content layer in dev (#11365)
* wip
* wip
* wip
* Update demo
* Add meta
* wip
* Add file loader
* Add schema validation
* Remove log
* Changeset
* Format
* Lockfile
* Fix type
* Handle loading for data store JSON
* Use rollup util to import JSON
* Fix types
* Format
* Add tests
* Changes from review
* Sync content layer in dev
* feat: add typegen for loaders (#11358)
* fix: watch for content layer changes (#11371)
* fix: watch for content layer changes
* Add test
* feat: adds simple loader (#11386)
* wip
* Add simple loader
* Fix type guard
* Tighten loader schema
* Add loader function to type
* Reinstall vitest
* feat: add glob loader (#11398)
* feat: add glob loader
* Enable watching and fix paths
* Store the full entry object, not just data
* Add generateId support
* Fix test
* Rename loaders to sync
* Refacctor imports
* Use getEntry
* Format
* Fix import
* Remove type from output
* Windows path
* Add test for absolute path
* Update lockfile
* Debugging windows
* Allow file URL for base dir
* Reset time limit
* feat: add markdown rendering to content layer (#11440)
* feat: add glob loader
* Enable watching and fix paths
* Store the full entry object, not just data
* Add generateId support
* Fix test
* Rename loaders to sync
* Refacctor imports
* Use getEntry
* Format
* Fix import
* Remove type from output
* Windows path
* Add test for absolute path
* Update lockfile
* Debugging windows
* Allow file URL for base dir
* Reset time limit
* wip: add markdown rendering to content layer
* use cached entries
* CLean up types
* Instrument more of the build
* Add digest helper
* Add comments
* Make image extraction work
* feat: image support for content layer (#11469)
* wip
* wip
* Add image to benchmark
* Stub assets if missing
* Resolve assets in data
* Ignore virtual module
* Format
* rm log
* Handle images when using cached data
* Fix CCC
* Add a comment
* Changes from review
* Format
* Use relative paths for asset files
* Pass all md props to getImage
* Ensure dotastro dir exists
* Fix tests
* Changes from review
* Don't use temp array in getcollection
* Add error handling
* Format
* Handle paths that are already relative
* Dedupe sync runs
* Fix syncing in dev
* Changes from review
* Windows paths ftw
* feat(content-layer): support references in content layer (#11494)
* Support references in content layer
* Fix utf8 rendering
* Warn for invalid entries
* Fix test
* lol windows paths
* Remove assertion
* chore: fix content layer types (#11527)
* Add experimental_content type
* Fix import
* Make data store methods generic
* fix loader types
* Lockfile
* Clean content layer with `--force` (#11541)
* Clearn content layer with `--force`
* Add tests
* Document --force flag
* Fixes to content layer render types (#11558)
* Lockfile
* feat: use devalue to serialize content layer data (#11562)
* feat: use devalue to serialize content layer data
* Fix import
* Use devalue stringify
* Unused import
* Propagate error messages correctly
* Support --force flag in sync and dev (#11581)
* Support --force flag in sync and dev
* Fix test
* Separate render function and merge content layer types (#11579)
* Separate render function and merge content layer types
* Changes from review
* fix: clear content layer cache if config has changed (#11591)
* fix: clear content layer cache if config has changed
* Add test
* Watch config
* Change from review
* fix: skip glob files in content dir (#11622)
* fix: skip glob files in content dir
* Changes from review
* Log pattern
* Refactor content layer into shared instance (#11625)
* Refactor content layer into shared instance
* Clean up when testing
* Handle cleanup
* fix: support filters in content layer getCollection (#11631)
* Throw when using deprecated getEntryByX functions with content layer (#11637)
* Updates to content layer types and jsdocs (#11643)
* Add hot key to reload content layer (#11626)
* Add hot key to reload content layer
* Fix filename
* Remove cli message
* Update example
* Change key to "s"
* feat: handle simple mdx rendering (#11633)
* feat: handle simple mdx rendering
* cleanup
* feedback
* fix regression
* remove log
* flip condition
* update tests
* log collections to understand the error
* let's try this alternative
* try parallel test to understand the issue
* chore: use a new fixture to fix tests
* rebase and docs
* fix regressions
* remove old code
* address feedback
* rename param
* log error
* rebase
* chore: try a different cache dir to solve the error test
* fix invalidation of the module when there's no store available
* address suggestion
* run formatter
* update lock file
* Lint
* Add experimental content layer flag (#11652)
* Add experimental content layer flag
* Syntax and format
* Aside
* Format
* Reset content config between runs
* Update fixture
* Update terminology
* Lint
* wut
* Normalize render function return value (#11663)
* Add markdoc support to content layer (#11664)
* Add markdoc support to content layer
* Switch test to cheerio
* Update benchmarks
* update lock file
* Update content layer flag docs (#11682)
* Update content layer flag docs
* Apply suggestions from code review
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* More markdoc
* Typo
* Apply suggestions from code review
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update
---------
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Add changeset for content layer experimental release (#11644)
* Add changeset for content layer experimental release
* Update changeset
* Update .changeset/smooth-chicken-wash.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* feat: injectTypes (#11551)
* feat: make inline config 1st arg
* fix: run config done in sync
* feat: start working on injectTypes
* feat: write files
* feat: adapt core features
* feat: migrate db to injectTypes
* feat: special db handling
* feat: update settings instead of workarounds
* fix: create dotAstroDir
* feat: refactor sync tests
* fix: path
* fix: paths
* chore: add comments
* feat: overwrite content file if exists
* chore: remove unused db env related code
* feat: use dotAstroDir for settings
* chore: simplify astro env sync
* feat: use dotAstroDir for preferences
* feat: handle db in integration api
* chore: reorganize
* feat: format
* feat: add test
* Discard changes to examples/basics/astro.config.mjs
* Discard changes to examples/basics/package.json
* Discard changes to pnpm-lock.yaml
* chore: remove test files
* feat: update examples dts
* fix: dts
* chore: changesets
* fix: indentation
* Apply suggestions from code review
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
* Apply suggestions from code review
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
* chore: format
* Update packages/astro/src/integrations/hooks.ts
* Update .changeset/mean-horses-kiss.md
* feat: remove formatting
* feat: handle fs errors
* feat: remove astro:db special path handling
* feat: add fs error
* Update packages/astro/src/content/types-generator.ts
* Update .changeset/mean-horses-kiss.md
* Update errors-data.ts
* Update .changeset/mean-horses-kiss.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update .changeset/mean-horses-kiss.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
* Add file generation and flag for content intellisense (#11639)
* feat: add type to infer input type of collection
* refactor:
* feat: generate json schema for content too
* feat: generate a manifest of all the collections
* refactor: unnecessary type
* fix: only add content collections to manifest
* chore: changeset
* fix: generate file URLs
* fix: flag it properly
* fix: save in lower case
* docs: add jsdoc to experimental option
* nit: move function out
* fix: match vscode flag name
* Update packages/astro/src/@types/astro.ts
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update packages/astro/src/@types/astro.ts
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update serious-pumas-run.md
* test: add tests
* Add content layer support
* Apply suggestions from code review
* fix: test
* Update .changeset/serious-pumas-run.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Apply suggestions from code review
* Remove check for json
---------
Co-authored-by: Matt Kane <m@mk.gg>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* nit: use same filesystem error as injectTypes
* fix: code component was missing support for meta string (#11605)
* fix: code component was missing support for meta string
Fixed#11604
* Create odd-buttons-pay.md
* <Code>: add reference link for meta prop
* Apply suggestions from code review
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update .changeset/odd-buttons-pay.md
* Update .changeset/odd-buttons-pay.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
* Deprecates exporting prerender with dynamic values (#11657)
* wip
* done i think
* Add changeset
* Use hook instead
* Reorder hooks [skip ci]
* Update .changeset/eleven-pens-glow.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Fix run
* Fix link
* Add link
Co-authored-by: Sarah Rainsberger <sarah11918@users.noreply.github.com>
* More accurate migration [skip ci]
---------
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Sarah Rainsberger <sarah11918@users.noreply.github.com>
* Use node parseArgs instead of yargs-parser and arg (#11645)
* wip
* done
* Add changeset
* Format
* Update
* Fix houston
* Fix test
* Fix test
* [ci] format
* resolve conflict
---------
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Co-authored-by: Julien Cayzac <jcayzac@users.noreply.github.com>
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah11918@users.noreply.github.com>
Co-authored-by: Bjorn Lu <ematipico@users.noreply.github.com>
* wip
* done i think
* Add changeset
* Use hook instead
* Reorder hooks [skip ci]
* Update .changeset/eleven-pens-glow.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Fix run
* Fix link
* Add link
Co-authored-by: Sarah Rainsberger <sarah11918@users.noreply.github.com>
* More accurate migration [skip ci]
---------
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Sarah Rainsberger <sarah11918@users.noreply.github.com>
* fix: code component was missing support for meta string
Fixed#11604
* Create odd-buttons-pay.md
* <Code>: add reference link for meta prop
* Apply suggestions from code review
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update .changeset/odd-buttons-pay.md
* Update .changeset/odd-buttons-pay.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
* Encrypt server islands props
* Comment on the hex algo
* Use @oslojs/encoding
* Rename functions
* Add base to test
* Remove old tests no longer valid
* Run test locally
* Make sure adapters run before manifest
* Add a changeset
* Adjust test adapter
* don't assume adapter is at root
* Add a changeset
* Updates on review comments
* Update oslo
* Add better description of Node adapter change
* fix: make semicolon optional when detecting `prerender` option
* trim to remove possible carriage return
* Apply suggestions from code review
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
---------
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
* Fix css plugin having inconsistent builds in different environments
Astro's css plugin generates chunk ids that include a hash of all of
the chunk's parent ids. These ids are currently the absolute file paths
of the parent files. The generated chunk ids are then inserted into
those pages as import statements.
Because these import statements include a hash based on these absolute
file paths, this causes rollup to generate different hashes for those
pages when a build is run in different environments. The exact same
project will produce identical assets with different filenames when
built on different machines, or when built from different directories
on the same machine, etc.
To fix this, I've stripped out the working directory of these file paths
before they are added to the hash. This means that the hash will still
change if the files referencing it chacnge (which I believe is the
intended behavior), but will be stable if the entire project is built
in different environments.
* add changeset
* fixup! use settings.config.root and vite's normalizePath
I've chosen to update the function signature of shortHashedName
to match createSlugger's, so it now accepts the settings object
and returns the actual hashing function. This way, createSlugger's
function signature doesn't need to update to needlessly accept
an additional argument.
* fixup! remove unused import
* Update .changeset/young-pillows-shave.md
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
* fixup! use fileURLtoPath
---------
Co-authored-by: Matt Lee <mdlee.md@gmail.com>
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
* wip: move getActionResult setup to render
* feat: serialize action data for edge
* refactor: serializeActionResult util
* feat: introduce devalue for body parsing
* refactor: orthrow -> main
* feat(test): Date and Set
* refactor: move getAction to separate file for bundling
* docs: changeset
* Revert "refactor: move getAction to separate file for bundling"
This reverts commit ef2b40991f90ff64c063cb4364eb2affcb2328c3.
* Revert "Revert "refactor: move getAction to separate file for bundling""
This reverts commit 40deaeda1dd350b27fa3da994a7c37005ae7a187.
* fix: actions import from client
* feat: add support for URL objects
* refactor: new isActionError utility
* refactor: reuse isInputError in fromJson
* fix: use INTERNAL_SERVER_ERROR for unknown errors
* fix: audit incorrectly flagging images as above the fold (#10891)
Previously used lement.offsetTop to find the y position of the image, which does not work when the element parent has a position: relative property.
Instead, this uses lement.getBoundingClientRect().y top get real y position of the image.
There's one issue though, which is that getBoundingClientRect returns the position relative to the user's viewport, not the absolute position.
So, add window.scrollY to the value to cancel that effect out, and you have the element's absolute position.
https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRecthttps://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY
* chore: add changeset
* refactor: move from Async local storage to .bind()
* feat: Astro.callAction for server calls
* feat(e2e): update server call
* feat(types): test callAction types
* fix: callAction context on rewrite
* feat: called from server error
* chore: remove store.ts file
* chore: remove getApiContext client stub
* chore: changeset
* fix: src -> dist import
* refactor: move content collection errors together
* fix: move rfc link to hint
* fix: highlight line with error in the error overlay
* chore: changeset
* Update packages/astro/e2e/errors.test.js
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
---------
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>