Don't incite developers to bake the canister ID in the frontend #2628
Replies: 4 comments
-
I would like to add my voice to this. I have read up and talked to Nicolas and there are a couple of ways this impacts us:
|
Beta Was this translation helpful? Give feedback.
-
What do you think, @krpeacock et al? |
Beta Was this translation helpful? Give feedback.
-
Note regarding serving the canister ID on a common, well known endpoint: If a CSP is provided in index.html, providing the canister ID via another endpoint is too late unless we can also address the issue of the agent calling to the origin, rather than to |
Beta Was this translation helpful? Give feedback.
-
This has assumptions that could become an issue for certain use cases, and can be implementation specific to II. Consider the following situations:
|
Beta Was this translation helpful? Give feedback.
-
The default
webpack.config.js
injects the canister ID in the build as an environment variable. This is not ideal for the following reasons:npm run build
before the canisters have been created, since the default config will (try to) load the canister IDs from.dfx/<network>/canister_ids.json
(a file and filepath which are, AFAICT, undocumented).In the internet identity dapp we work around this by
canister_ids.json
file when a local development server is startedI think those are good practices, maybe they could be added to the default generated canisters and examples?
Beta Was this translation helpful? Give feedback.
All reactions