Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/shiny-facts-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"create-cloudflare": patch
---

remove unnecessary ASSETS binding call in SPA templates

With SPA mode now enabled by default for compat dates since 2025-04-01, the Workers in the React and Vue templates no longer need this fallback ASSETS binding.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function App() {
Name from API is: {name}
</button>
<p>
Edit <code>api/index.js</code> to change the name
Edit <code>worker/index.js</code> to change the name
</p>
</div>
<p className='read-the-docs'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ export default {
});
}

Comment thread
emily-shen marked this conversation as resolved.
return env.ASSETS.fetch(request);
},
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "<TBD>",
"main": "api/index.js",
"main": "worker/index.js",
"compatibility_date": "<TBD>",
"assets": { "not_found_handling": "single-page-application", "binding": "ASSETS" },
"assets": { "not_found_handling": "single-page-application" },
"observability": {
"enabled": true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function App() {
Name from API is: {name}
</button>
<p>
Edit <code>api/index.ts</code> to change the name
Edit <code>worker/index.ts</code> to change the name
</p>
</div>
<p className='read-the-docs'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@ export default {
name: "Cloudflare",
});
}
Comment thread
emily-shen marked this conversation as resolved.

return env.ASSETS.fetch(request);
},
} satisfies ExportedHandler<Env>;
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "<TBD>",
"main": "api/index.ts",
"main": "worker/index.ts",
"compatibility_date": "<TBD>",
"assets": { "not_found_handling": "single-page-application", "binding": "ASSETS" },
"assets": { "not_found_handling": "single-page-application" },
"observability": {
"enabled": true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ export default {
});
}

Comment thread
emily-shen marked this conversation as resolved.
return env.ASSETS.fetch(request);
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"main": "server/index.ts",
"assets": {
"not_found_handling": "single-page-application",
"binding": "ASSETS"
},
"observability": {
"enabled": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@ export default {
name: "Cloudflare",
});
}
Comment thread
emily-shen marked this conversation as resolved.

return env.ASSETS.fetch(request);
},
} satisfies ExportedHandler<Env>;
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"main": "server/index.ts",
"assets": {
"not_found_handling": "single-page-application",
"binding": "ASSETS"
},
"observability": {
"enabled": true
Expand Down