As an unexperienced starting developer I find that learning Motoko isn’t as hard as actually wrapping my head around the broader pallet of technologies used on the front end.
The assets canister in the hello world (and the declarations) contains Candid, .js and .ts files. Also we find webpack and npm in the root of the project.
I know this is independent of the IC, but I would love to hear someone give a talk about how all these technologies work together to build clients that interact with the IC.
I would love to know what the assumptions and reasoning is that makes the frontend like it is. Mostly I would love to learn how javascript / typescript uses agents to communicate with actors on the IC. Also a deep run down of the generated decelerations. Why are both js and ts used? What is webpack doing? etc.
JavaScript is the lowest common denominator for running in browsers so that pretty much has to be used. TypeScript is popular and so is also provided for people using that but if you’re not using it, or use some other compile-to-JS language, you can ignore those files.
Webpack is bundling all of the sources files used in development and preparing them for production. Depending on your configuration, this could include various transformations that aren’t necessary during development, or would make development too slow. It also provides a dev server so that you can iterate more quickly on your UI without having to deploy the front end to a canister after every change.
What is a good place to start learning about how javascript or typescript are used to read in the Candid interface file and use it to communicate with the IC? I’m a details kind of a guy
I think dfx creates a copy:types entry under scripts in package.json which copies from .dfx/<network>/canisters.
If you look in that directory, probably .dfx/local/canisters, each canister has a directory that contains generated JavaScript.
So, JavaScript isn’t used to read the Candid file, but rather the Candid file is used to generate some JavaScript which knows how to encode and decode it.
Whatever we have done here should be reversed or fixed globally. Google search results of the docs lead to “Page not found”, this basically rendered a huge amount of links that used to work unusable. It doesn’t make sense to fix them all manually …