Skip to content

Commit

Permalink
update import order
Browse files Browse the repository at this point in the history
  • Loading branch information
shuding committed Aug 24, 2024
1 parent fa05710 commit e9f7157
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 15 deletions.
10 changes: 7 additions & 3 deletions crates/next-custom-transforms/src/transforms/server_actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -957,8 +957,11 @@ impl<C: Comments> VisitMut for ServerActions<C> {
let find_source_map_url_ident = private_ident!("findSourceMapURL");

if !self.config.is_react_server_layer {
// import { createServerReference } from
// 'private-next-rsc-action-client-wrapper'
// import {
// createServerReference,
// callServer,
// findSourceMapURL
// } from 'private-next-rsc-action-client-wrapper'
// createServerReference("action_id")
new.push(ModuleItem::ModuleDecl(ModuleDecl::Import(ImportDecl {
span: DUMMY_SP,
Expand Down Expand Up @@ -991,6 +994,7 @@ impl<C: Comments> VisitMut for ServerActions<C> {
with: None,
phase: Default::default(),
})));
new.rotate_right(1);
}

for (id, export_name) in self.exported_idents.iter() {
Expand Down Expand Up @@ -1202,7 +1206,7 @@ impl<C: Comments> VisitMut for ServerActions<C> {
new.rotate_right(2);
} else {
// Make it the first item
new.rotate_right(1);
// new.rotate_right(1);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* __next_internal_client_entry_do_not_use__ default auto */ /* __next_internal_action_entry_do_not_use__ {"6d53ce510b2e36499b8f56038817b9bad86cabb4":"$$ACTION_0"} */ export async function $$ACTION_0() {}
export default function App() {
/* __next_internal_client_entry_do_not_use__ default auto */ /* __next_internal_action_entry_do_not_use__ {"6d53ce510b2e36499b8f56038817b9bad86cabb4":"$$ACTION_0"} */ export default function App() {
var fn = registerServerReference("6d53ce510b2e36499b8f56038817b9bad86cabb4", $$ACTION_0);
return <div>App</div>;
}
export async function $$ACTION_0() {}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// app/send.ts
/* __next_internal_action_entry_do_not_use__ {"c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default","e10665baac148856374b2789aceb970f66fec33e":"myAction"} */ export default createServerReference("c18c215a6b7cdc64bf709f3a714ffdef1bf9651d", callServer, void 0, findSourceMapURL, "default");
import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper";
/* __next_internal_action_entry_do_not_use__ {"c18c215a6b7cdc64bf709f3a714ffdef1bf9651d":"default","e10665baac148856374b2789aceb970f66fec33e":"myAction"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper";
export var myAction = createServerReference("e10665baac148856374b2789aceb970f66fec33e", callServer, void 0, findSourceMapURL, "myAction");
export default createServerReference("c18c215a6b7cdc64bf709f3a714ffdef1bf9651d", callServer, void 0, findSourceMapURL, "default");
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// app/send.ts
/* __next_internal_action_entry_do_not_use__ {"ab21efdafbe611287bc25c0462b1e0510d13e48b":"foo"} */ export var foo = createServerReference("ab21efdafbe611287bc25c0462b1e0510d13e48b", callServer, void 0, findSourceMapURL, "foo");
import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper";
/* __next_internal_action_entry_do_not_use__ {"ab21efdafbe611287bc25c0462b1e0510d13e48b":"foo"} */ import { createServerReference, callServer, findSourceMapURL } from "private-next-rsc-action-client-wrapper";
export var foo = createServerReference("ab21efdafbe611287bc25c0462b1e0510d13e48b", callServer, void 0, findSourceMapURL, "foo");

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e9f7157

Please sign in to comment.