Skip to content

Commit

Permalink
RSC: RSA: Add more comments to the basic 'use server' check (redwoodj…
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe authored Aug 6, 2024
1 parent 5dea4a7 commit c81683b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ export function rscTransformUseServerPlugin(): Plugin {
name: 'rsc-transform-use-server-plugin',
transform: async function (code, id) {
// Do a quick check for the exact string. If it doesn't exist, don't
// bother parsing.
// bother parsing. This check doesn't have to be perfect. It's just a
// quick check to avoid doing a full parse to build an AST.
// Plesae benchmark before making any changes here.
// See https://github.com/redwoodjs/redwood/pull/11158
if (!code.includes('use server')) {
return code
}
Expand Down

0 comments on commit c81683b

Please sign in to comment.