Patch release for frontend canister (also known as asset canister or certified assets canister) code.
Recent updates to the asset canister that came as part of dfx 0.11.1 release introduced two unwanted behaviors to asset canister code, and we’re disabling both of them with this release:
redirection of all HTTP traffic from .raw.ic0.app to .ic0.app
HTTP traffic redirection will find its way into dfx in the form of per-asset configurable redirects in the upcoming dfx release
support for ETag HTTP header (a mechanism to aid cache validation).
ETag's will be back once we add more code to icx-proxy`
I know those two issues broke workflows for some people, for which I’m sorry, as this slipped through the release review process I was conducting. We will be implementing measures to make sure this never happens again.
Features presented at yesterday’s Global R&D are not part of 0.11.2 release. 0.11.2 is only a patch release to frontend canister code (wasm), there were no other changes in comparison to 0.11.1.
Looks like some of the features from yesterday GR&D are part of Release 0.7.0 · dfinity/motoko · GitHub (tho I don’t know if that release includes all of the features presented). At the time of writing this message, master branch of dfx uses motoko 0.6.3, and I don’t know/can’t promise if 0.7.0 motoko will get included in next dfx minor release (0.12.0).
After upgrading to 0.11.2 dfx complained about duplicate asset keys. I removed the CopyPlugin() as described here and also deleted the /dist folder from my project. However, now my React application can’t find the asset files including the main.css anymore. What is the recommended way for adding static assets now with 0.11.2?
It’s difficult for me to say what’s the root cause in this case, perhaps you can share the content of your: dfx.json, package.json, webpack.config.js?
The recommended way of adding static assets has not changed – when you issue dfx new xyz, the directory for frontend project will contain src/xyz_frontend/src and src/xyz_frontend/assets. Webpack config file is set up in way which will bundle the content of src/xyz_frontend/src into /dist directory. Afterwards, when you dfx deploy your canister, dfx will upload all files in directories listed under the key canisters.xyz_frontend.source in dfx.json file.
Thanks for your answer! I created a new project with dfx new <projectname> and compared the webpack.config.js. The following line was missing in the config of my old project: static: path.resolve(__dirname, "src", frontendDirectory, "assets"). Added it in and now it’s working again.