Houston (Bot)
4d32a8077b
[ci] release ( #11053 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-16 18:00:58 +01:00
Matthew Phillips
749a7ac967
Fix streaming in Node.js fast path ( #11058 )
...
* Fix streaming in Node.js fast path
* Create a new next if the iterator is not done
* Use a flag instead
* Update test
* Add new assertion
* Add explanation of the renderingComplete variable
* Remove flaky assertion
2024-05-16 12:36:28 -04:00
Erika
1fec4a6eb9
fix: use astro cli command instead of astro db's ( #11070 )
...
* fix: use astro cli command instead of astro db's
* chore: changeset
2024-05-16 18:10:59 +02:00
Erika
9332bb1c1f
feat: add an internal for now studio package ( #11037 )
...
* feat: add an internal for now studio package
* fix: remove test commands
* fix: use getenvs from studio package
* fix: packagejson
* chore: changeset
* fix: remove unused error
* fix: of course Bjorn was right all along
2024-05-16 18:10:08 +02:00
Emanuele Stoppa
240a70a29f
fix: improve logging for on-demand pages ( #11069 )
2024-05-16 16:13:32 +01:00
Emanuele Stoppa
1f988ed10f
fix(rewrite): match index with params ( #11065 )
...
* fix(rewrite): match index with params
* remove import
2024-05-16 14:52:39 +01:00
Emanuele Stoppa
16f12e426e
fix(i18n): allow to create 404.html and 500.html ( #11062 )
...
* fix(i18n): allow to create 404.html and 500.html
* Update packages/astro/src/i18n/index.ts
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
* Update .changeset/lazy-rockets-raise.md
* chore: use better matching
* fix linting
---------
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
2024-05-16 14:43:30 +01:00
n4n5
3a0c02ae03
add error message for svg without dimensions ( #10924 )
...
* add svg
* throw clean error
* add error handling
* revert
* throw clean error
* add changeset
* make it a patch
* Update remoteProbe.ts
---------
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
2024-05-16 12:52:35 +02:00
Elias
a8f0372ea7
Update generator.ts to allow %23 (#) in dynamic urls ( #10965 )
...
* Update generator.ts to allow %23 (#) in dynamic urls
* added changeset
* fix: Update generator.ts to santize url params as well
* fix: sanitizeParams function
* removed old fix
* fix: added test for decoded # and ?
* fix: formatting of file
* sperated sanitizing of generated paths and ssr dynamic paths
* refactor: using map instead
* Update .changeset/mean-geckos-sell.md
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
* doc: added JSDoc for sanitizeParams function
---------
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
2024-05-16 09:26:27 +01:00
Florian Lefebvre
a05ca38c2c
fix: conflict between rewrite and actions middleware ( #11052 )
...
* fix: conflict between rewrite and actions middleware
* Update middleware.ts
* fix: short circuit middleware if locals already defined
* chore(test): remove atkinson font refs
* feat(test): progressive fallbacks
* chore: remove unneeded conditional
---------
Co-authored-by: bholmesdev <hey@bholmes.dev>
2024-05-15 12:49:45 -04:00
Houston (Bot)
5a48d53385
[ci] release ( #11025 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-15 10:42:55 -04:00
Ming-jun Lu
841df1f1b1
fix(rss): fix an issue where trailing slash is not removed even if trailingSlash
is set to false
( #11050 )
...
* refactor(createCanonicalURL): return string instead of URL object
* fix(rss): fix an issue where trailing slash is not removed even if `trailingSlash` is set to `false`
* test(rss): update test case related to trailing slash
* chore: add changeset
2024-05-15 15:33:50 +01:00
Bjorn Lu
5f353e39b2
Improve prefetch behaviour for browsers ( #10999 )
2024-05-15 21:11:05 +08:00
Ben Holmes
6cc3fb97ec
Actions: support empty args and empty response ( #11041 )
...
* feat: support empty args and empty response
* chore: changeset
* Update .changeset/many-guests-yell.md
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
---------
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
2024-05-15 07:42:04 -04:00
Ben Holmes
d0d1710439
Actions: fix minor type issues in documented example ( #11043 )
...
* fix(docs): add type case for `e.target`, say "Preact" explicitly
* fix(docs): Preact -> React
* chore: changeset
* Update .changeset/dirty-planes-punch.md
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
---------
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
2024-05-15 06:45:20 -04:00
HiDeoo
086694ac31
Fix getViteConfig()
type definition ( #11046 )
2024-05-15 09:04:47 +01:00
Ben Holmes
771d1f7654
actions: Throw error on missing server output ( #11028 )
...
* feat: throw error on missing server output
* chore: changeset
* refactor: use isServerLikeOutput
* feat: add errors-data on actions build output
* chore: add jsdoc
2024-05-14 13:29:27 -04:00
molsson
ad9227c7d1
fix(types): Add name attribute to AnchorHTMLAttributes ( #10981 )
...
* fix(types): Add name attribute to AnchorHTMLAttributes
* Create tiny-toys-exist.md
---------
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
2024-05-14 10:52:38 +02:00
Alexander S
2e2d6b7442
fix(astro): refine assets prefix typing ( #11020 )
2024-05-14 16:40:52 +08:00
Argana Phangquestian
5f2dd4518e
fix: add missing attribute popovertargetaction ( #11034 )
...
* fix: add missing attribute popovertargetaction
* add: changeset
2024-05-14 10:38:17 +02:00
Ben Holmes
bd34452a34
Actions: include zod error in message for easier debugging ( #11029 )
...
* refactor: embed zod object in error msg
* chore: changeset
2024-05-13 15:28:48 -04:00
Bjorn Lu
8dfb1a23cc
Fix CSS handling for experimental.directRenderScript ( #11026 )
2024-05-13 14:48:55 -04:00
Ben Holmes
18e7f33ccd
Actions: fix custom error message on client ( #11030 )
...
* feat(test): error throwing on server
* feat: correctly parse custom errors for the client
* feat(test): custom errors on client
* chore: changeset
2024-05-13 14:40:37 -04:00
Ben Holmes
eb1d9a447b
Fix isDbError()
for remote errors ( #11027 )
...
* fix: use LibsqlError for remote db errors
* chore: remove unused drizzle.ts
* fix(test): return expected `error` object
* fix: error detail formatting
* feat(test): error messages with remote adapter
* feat(test): add code to test body
* chore: changeset
2024-05-13 12:20:43 -04:00
Shiina
4ea38e7333
Prevents unhandledrejection error when checking for latest Astro version ( #11013 )
...
* fix: prevent error appear when check latest version fail(#11012 )
* Resolve review problem
2024-05-13 10:07:17 -04:00
Houston (Bot)
18b78ec881
[ci] release ( #11019 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-13 07:29:41 -04:00
Ben Holmes
7418bb054c
Fix: allow locals
access from actions ( #11006 )
...
* fix: move actions middleware to post
* fix(test): user middleware
* chore: changeset
2024-05-13 07:23:52 -04:00
Houston (Bot)
0b8b6f98a2
[ci] release ( #10993 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-09 14:20:24 -04:00
liruifengv
4161a2a3d0
fix: fix incorrect actions path on windows ( #10990 )
...
* fix: remove actions path leading slash on windows
* add changeset
* use `viteID` get actions path
* update changeset
2024-05-09 13:38:42 -04:00
Bryce Russell
6fa89e84c9
Fix loading of non-index routes that end with index.html
( #10979 )
...
* Add test
* Fix alt pathname
* Add changeset
2024-05-09 13:38:28 -04:00
Houston (Bot)
e2cdd3c96b
[ci] release ( #10985 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-09 22:40:23 +08:00
Federico Ballarini
4d163811e1
feat(package.json): removed wrong react types ( #10986 )
2024-05-09 21:34:41 +08:00
Emanuele Stoppa
05db5f7818
fix: incorrect type for experimental option ( #10987 )
2024-05-09 14:32:04 +01:00
Bjorn Lu
6b640b3bcb
Support scope styles for picture element in Picture component ( #10975 )
2024-05-09 21:04:19 +08:00
Houston (Bot)
770b9f06c3
[ci] release ( #10944 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-09 11:06:49 +01:00
Bryce Russell
59571e8812
Fix error when accessing clientAddress
on prerendered routes ( #10977 )
2024-05-09 16:16:29 +08:00
Florian Lefebvre
7179930ac8
feat(solid): add support for devtools ( #10937 )
...
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2024-05-08 16:48:17 +02:00
Emanuele Stoppa
f0acd30a12
feat(vercel): skew protection ( #10761 )
...
* feat(vercel): skew protection
* feat(vercel): skew protection
2024-05-08 15:05:03 +01:00
Matthew Phillips
a1343184da
Convert saved non-UTC dates to UTC ( #10967 )
...
* Convert saved non-UTC dates to UTC
* Simplify the check
* Simplify check and add link
2024-05-08 08:27:55 -04:00
Ben Holmes
c0c509b6bf
Actions experimental release ( #10858 )
...
* feat: port astro-actions poc
* feat: basic blog example
* feat: basic validationError class
* feat: standard error types and safe() wrapper
* refactor: move enhanceProps to astro:actions
* fix: throw internal server errors
* chore: refine enhance: true error message
* fix: remove FormData fallback from route
* refactor: clarify what enhance: true allows
* feat: progressively enhanced comments
* chore: changeset
* refactor: enhance -> acceptFormData
* wip: migrate actions to core
* feat: working actions demo from astro core!
* chore: changeset
* chore: delete old changeset
* fix: Function type lint
* refactor: expose defineAction from `astro:actions`
* fix: add null check to experimental
* fix: export `types/actions.d.ts`
* feat: more robust form data parsing
* feat: support formData from rpc call
* feat: remove acceptFormData flag requirement
* feat: add actions.d.ts type reference on startup
* refactor: actionNameProps -> getNameProps
* fix: actions type import
* chore: expose zod from `astro:actions`
* fix: zod export path
* feat: add explicit `accept` property
* Use zod package instead of relative path outside of src
* feat: clean up error throwing and handling flow
* fix: make `accept` optional
* docs: beef up actions experimental docs
* fix: defineAction type narrowing on `accept`
* fix: bad `getNameProps()` arg type
* refactor: move to single `error` object + `isInputError()` util
* fix: move res.json() parse to avoid double parse
* feat: support async zod schemas
* feat: serialize and expose zod properties on input error
* feat: test input error in comment example
* fix: remove ZodError import
* fix: add actions-module to files export
* fix: use workspace for test pkg versions
* refactor: default export -> server export
* fix: type inference for json vs. form
* refactor: accept form -> defineFormAction
* refactor: better callSafely signature
* feat: block action calls from the server with RFC link
* feat: move getActionResult to global
* refactor: getNameProps -> getActionProps
* refactor: body.toString()
* edit: capitAl
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* edit: highlight `actions`
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* edit: add actions file name
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* edit: not you can. You DO
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* edit: declare with feeling
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* edit: clarify what the `handler` does
* edit: schema -> input
* edit: add FormData mdn reference
* edit: add defineFormAction() explainer
* refactor: inline getDotAstroTypeRefs
* edit: yeah yeah maybe
* fix: existsSync test mock
* refactor: use callSafely in middleware
* test: upgradeFormData()
* chore: stray console log
* refactor: extract helper functions
* fix: include status in error response
* fix: return `undefined` when there's no action result
* fix: content-type
* test: e2e like button action
* test: comment e2e
* fix: existsSync mock for other sync test
* test: action dev server raw fetch
* test: build preview
* chore: fix lock
* fix: add dotAstroDir to existsSync
* chore: slim down e2e fixture
* chore: remove unneeded disabled test
* refactor: better api context error
* fix: return `false` for envDts
* refactor: defineFormAction -> defineAction with accept
* fix: check FormData on getActionProps
* edit: uppercase
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* fix: add switch default for 500
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
* fix: add `toLowerCase()` on content-type check
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
* chore: use VIRTUAL_MODULE_ID for plugin
* fix: remove incorrect ts-ignore
* chore: remove unneeded POST method check
* refactor: route callSafely
* refactor: error switch case to map
* chore: add link to trpc error code table
* fix: add readable error on failed json.stringify
* refactor: add param -> callerParam with comment
* feat: always return safe from getActionResult()
* refactor: move actions module to templates/
* refactor: remove unneeded existsSync on dotAstro
* fix: hasContentType util for toLowerCase()
* chore: comment on 415 code
* refactor: upgradeFormData -> formDataToObj
* fix: avoid leaking stack in production
* refactor: defineProperty with write false
* fix: revert package.json back to spaces
* edit: use config docs for changeset
* refactor: stringifiedActionsPath -> stringifiedActionsImport
* fix: avoid double-handling for route
* fix: support zero arg actions
* refactor: move actionHandler to helper fn
* fix: restore mdast deps
* docs: add `output` to config
---------
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: bholmesdev <bholmesdev@gmail.com>
2024-05-08 07:53:17 -04:00
Goulven CLEC'H
698c2d9bb5
fix(page-data): add key to allPages ( #10625 )
...
* fix(page-data): add key to allPages
* add fryuni's test
* replaced object.entries(allpages)
* tmp: change pagesByComponents by pagesByKeys
* fix pagesByKeys.get() in plugin-ssr & plugin-manifest
* remove logs
* remove useless generators
* another useless generator
* use null byte in key
* tmp function in pipeline.ts
* refactor getVirtualModulePageName
* refactor getPageKeyFromVirtualModulePageName
* clean & comments
* better key and fix build
* utils: add makePageDataKey
* fix(pipeline): retrieveRoutesToGenerate for ssr
* internals: getPageData function
* tmp(ssr-split-manifest): fix test ?
* fix?: ssr clean static output
* internals: getPageDatasWithPublicKey
* internals: getPageDatasByHoistedScriptId & getPagesDatasByComponent
* remove broken & useless virtualModuleNameFromResolvedId
* chore: changeset
* fix: sanitize slashes in filepaths
* Revert "fix: sanitize slashes in filepaths"
This reverts commit 5c3a75fac8
.
* fix?: remove route from virtual module name
* fix: concat & array.from
* update changeset
* clean unnecessary change
* remove unnecessary pageInfo
* add return types to utils functions
* revert a comment deletion
* fix cleanStaticOutput
* changes from ematipico review
* moving a todo outside jsdoc (cc @ematipico )
* Update .changeset/great-turtles-greet.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Update .changeset/great-turtles-greet.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* chore: fix merge conflicts
* fix: incorrect function
* remove logs
* revert: codepoint change
---------
Co-authored-by: Princesseuh <3019731+Princesseuh@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
2024-05-08 11:33:19 +01:00
Chris Swithinbank
61f47a6842
Support passing inline Astro config to getViteConfig() ( #10963 )
...
* Support passing inline Astro config to `getViteConfig()`
* Add changeset
2024-05-08 11:19:54 +01:00
Emanuele Stoppa
47877a7540
feat: rewriting (experimental) ( #10867 )
...
* feat: implement reroute in dev (#10818 )
* chore: implement reroute in dev
* chore: revert naming change
* chore: conditionally create the new request
* chore: handle error
* remove only
* remove only
* chore: add tests and remove logs
* chore: fix regression
* chore: fix regression route matching
* chore: remove unwanted test
* feat: reroute in SSG (#10843 )
* feat: rerouting in ssg
* linting
* feat: reroute for SSR (#10845 )
* feat: implement reroute in dev (#10818 )
* chore: implement reroute in dev
* chore: revert naming change
* chore: conditionally create the new request
* chore: handle error
* remove only
* remove only
* chore: add tests and remove logs
* chore: fix regression
* chore: fix regression route matching
* chore: remove unwanted test
* feat: reroute in SSG (#10843 )
* feat: rerouting in ssg
* linting
* feat: rerouting in ssg
* linting
* feat: reroute for SSR
* fix rebase
* fix merge issue
* feat: rerouting in the middleware (#10853 )
* feat: implement reroute in dev (#10818 )
* chore: implement reroute in dev
* chore: revert naming change
* chore: conditionally create the new request
* chore: handle error
* remove only
* remove only
* chore: add tests and remove logs
* chore: fix regression
* chore: fix regression route matching
* chore: remove unwanted test
* feat: reroute in SSG (#10843 )
* feat: rerouting in ssg
* linting
* feat: rerouting in ssg
* linting
* feat: reroute for SSR
* fix rebase
* fix merge issue
* feat: implement the `next(payload)` feature for rerouting
* chore: revert code
* chore: fix code
* Apply suggestions from code review
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
---------
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
* feat: rerouting
* chore: rename to `rewrite`
* chore: better error message
* chore: update the chageset
* Apply suggestions from code review
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* chore: update docs based on feedback
* lock file
* Apply suggestions from code review
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Co-authored-by: Ben Holmes <hey@bholmes.dev>
* feedback
* rename
* add tests for 404
* revert change
* fix regression
* Update .changeset/pink-ligers-share.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Co-authored-by: Ben Holmes <hey@bholmes.dev>
2024-05-08 10:26:31 +01:00
Erika
7bbd66459d
feat: Add new component to toolbar library ( #10906 )
...
* feat: progress
* chore: changeset
2024-05-08 10:26:00 +01:00
Bjorn Lu
ddd8e49d1a
MDX integration v3 ( #10935 )
...
* fix(mdx): convert remark-images-to-component plugin to a rehype plugin (#10697 )
* Remove fs read for MDX transform (#10866 )
* Tag MDX component for faster checks when rendering (#10864 )
* Use unified plugin only for MDX transform (#10869 )
* Only traverse children and handle mdxJsxTextElement when optimizing (#10885 )
* Rename to `optimize.ignoreComponentNames` in MDX (#10884 )
* Allow remark/rehype plugins added after mdx to work (#10877 )
* Improve MDX optimize with sibling nodes (#10887 )
* Improve types in rehype-optimize-static.ts
* Rename `ignoreComponentNames` to `ignoreElementNames`
I think this better reflects what it's actually doing
* Simplify plain MDX nodes in optimize option (#10934 )
* Format code
* Minimize diff changes
* Update .changeset/slimy-cobras-end.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Armand Philippot <59021693+ArmandPhilippot@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2024-05-08 10:25:27 +01:00
Bjorn Lu
685fc22bc6
Improve content collection styles and scripts build perf ( #10959 )
...
* Improve content collection styles and scripts build perf
* Update test
It was actually a bug. There was an empty module script injected.
* Skip test
* Fix test not matching non-ccc behaviour
* Workaround bug to make test pass
* Update .changeset/grumpy-pillows-develop.md
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
---------
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2024-05-08 10:24:47 +01:00
Matthew Phillips
d47baa466a
Support React 19 ( #10942 )
...
* Support React 19
* Fix lint
* Update .changeset/short-phones-breathe.md
* fix: update types peer dep
---------
Co-authored-by: bholmesdev <hey@bholmes.dev>
2024-05-07 13:13:03 -04:00
Chris Swithinbank
e63e96bf32
Import metric table from astro:db ( #10947 )
2024-05-06 22:02:54 +02:00
Florian Lefebvre
2978287f92
fix(astro): handle AstroUserError during sync and exports types ( #10955 )
...
Co-authored-by: Luiz Ferraz <luiz@lferraz.com>
2024-05-06 17:35:17 +02:00
Matthew Phillips
4d905ccef6
Preserve content modules properly in cache ( #10889 )
...
* Wait until after build to preserve content modules
* Properly build hoisted scripts
* Add changeset
* Fix tests hitting each other
* Global state, the shame
* Move the file copying over to earlier in the process
2024-05-06 11:27:07 -04:00