Skip to content

Commit

Permalink
Merge branch 'main' into fix/preact-signals
Browse files Browse the repository at this point in the history
  • Loading branch information
ph1p committed Aug 28, 2024
2 parents 2a582d1 + 497324c commit 4c4c46e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .changeset/eleven-cameras-sing.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'@astrojs/preact': major
'@astrojs/preact': patch
---

Preact signals are now serialized correctly in arrays when they are given to components.
5 changes: 5 additions & 0 deletions .changeset/nasty-ladybugs-whisper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Prevents prefetching of the same urls with different hashes.
3 changes: 3 additions & 0 deletions packages/astro/src/prefetch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ export interface PrefetchOptions {
* @param opts Additional options for prefetching.
*/
export function prefetch(url: string, opts?: PrefetchOptions) {
// Remove url hash to avoid prefetching the same URL multiple times
url = url.replace(/#.*/, '');

const ignoreSlowConnection = opts?.ignoreSlowConnection ?? false;
if (!canPrefetchUrl(url, ignoreSlowConnection)) return;
prefetchedUrls.add(url);
Expand Down

0 comments on commit 4c4c46e

Please sign in to comment.