Closed jafri closed 2 years ago
No need to hurry. Let's wait for other developers' feedback to see if this version is stable enough.
You can create a new branch for this new version as you need at this time.
Happy to wait, not in a rush for this feature
When it’s stable, I will look into building an IDE maybe
From: learnforpractice @.> Sent: Friday, March 25, 2022 6:16:08 PM To: uuosio/ascdk @.> Cc: Syed Jafri @.>; Author @.> Subject: Re: [uuosio/ascdk] Upgrade assemblyscript to 0.20 (Issue #37)
[△EXTERNAL]
You can create a new branch for this new version as you need at this time.
— Reply to this email directly, view it on GitHubhttps://github.com/uuosio/ascdk/issues/37#issuecomment-1079529543, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADILGLKAD27UR73PC32S4TLVBZJMRANCNFSM5RVBAUVA. You are receiving this because you authored the thread.Message ID: @.***>
That's great!
import asc from "assemblyscript/asc";
import { ContractTransform } from "./transform";
import { APIOptionImpl } from './ascoption'
// Reset process
process.sourceModifier = undefined
// Create mem
const memoryStream = asc.createMemoryStream()
// Create options
const outputs: any = {}
const options = [
'contract.ts',
'--initialMemory', '1',
'--runtime', 'stub',
'--use', 'abort= ',
'--disable', 'mutable-globals',
'--disable', 'sign-extension',
'--disable', 'nontrapping-f2i',
'--disable', 'bulk-memory',
'-O2'
]
const apiOptions = new APIOptionImpl(sources, {
stdout: memoryStream,
stderr: memoryStream,
writeFile: (name: string, contents: string) => { outputs[name] = contents },
listFiles: () => [],
transforms: [new ContractTransform(abiEditor)]
});
const { error: initError, stderr } = await asc.main(options, apiOptions);
if (initError) {
alert(`
${initError}
${stderr.toString()}
`)
return
}
// Remove Transforms
apiOptions.transforms = []
// Add outputs
options.push(
'-t', 'contract.wat',
'-o', 'contract.wasm',
)
// Build contract
const { stdout, error } = await asc.main(options, apiOptions);
apiOptions.writeExtensionFile();
Docs: https://github.com/AssemblyScript/assemblyscript/releases/tag/v0.20.0
It seems that this would make it possible to run
ascdk
right in the browser without nodeJS easier, could be a valueable addition