Skip to content

Commit

Permalink
handle TODOs in build/experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
lastmjs committed Aug 28, 2024
1 parent a903e55 commit c48acd5
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 9 deletions.
Binary file modified canister_templates/experimental.wasm
Binary file not shown.
Binary file modified canister_templates/stable.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion src/build/experimental/commands/compile/get_context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export async function getContext(
const wasmData: WasmData = {
...stableContext.wasmData,
consumer,
management_did: managementDid // TODO should we just do the camelCase snake case Rust thing to unify these across the languages?
managementDid
};

const wasmedgeQuickJsName = `wasmedge-quickjs_${version}`;
Expand Down
5 changes: 0 additions & 5 deletions src/build/experimental/commands/compile/javascript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ export async function compile(
);
}

// TODO clean this up beautifully
// TODO make the CanisterMethods thing pristine
// TODO it's a bit confusing right now
// TODO do not repeat from stable
export function getPrelude(main: string): string {
return /*TS*/ `
import 'azle/src/lib/stable/globals';
Expand Down Expand Up @@ -129,7 +125,6 @@ export function getBuildOptions(
...externalNotImplementedDev
];

// TODO we need to move custom_js_modules into build/experimental
const customJsModulesPath = join(
AZLE_PACKAGE_PATH,
'src',
Expand Down
2 changes: 1 addition & 1 deletion src/build/experimental/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export type Context = {

export type WasmData = {
consumer: Consumer;
management_did: string;
managementDid: string;
} & StableWasmData;
2 changes: 2 additions & 0 deletions src/build/rust/canister/src/wasm_binary_manipulation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize)]
pub struct WasmData {
#[serde(rename = "envVars")]
pub env_vars: Vec<(String, String)>,
#[cfg(feature = "experimental")]
pub consumer: Consumer,
#[cfg(feature = "experimental")]
#[serde(rename = "managementDid")]
pub management_did: String,
}

Expand Down
2 changes: 1 addition & 1 deletion src/build/stable/commands/compile/get_context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function getContext(

const envVars = getEnvVars(canisterConfig);
const wasmData = {
env_vars: envVars
envVars
};

return {
Expand Down
2 changes: 1 addition & 1 deletion src/build/stable/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ export type MethodMeta = {
};

export type WasmData = {
env_vars: EnvVars;
envVars: EnvVars;
};

0 comments on commit c48acd5

Please sign in to comment.