Dfx 0.7.7 Frontend Changes

Hi all, I’ve been teasing dfx 0.7.7 in some threads, and now we are getting ready to release it. There will be some changes to our JavaScript codegen that will fix some bugs, but may require some attention when you choose to upgrade your project. I have written up an explanation of the changes, the benefits they bring, and a migration path here: Dfx 0.7.7 Changes | Kyle Peacock's website.

3 Likes

Thanks for the tutorial and examples :+1:

I was wondering, what’s process.env.DFX_NETWORK in your script? Is it an environment variable which is set only when dfx cmd, such as deploy, are run?

P.S.: For those who do not use Webpack, if it can help, I extracted the script to map the environments variables in a function (find it here). I use in my Rollup build with the replace plugin.

1 Like

You are correct - the DFX_NETWORK environment variable is provided by dfx. Without specifying a network, it will be "local", or else it will be whatever is specified in the command, i.e. --network ic -> "ic"

1 Like

All clear, thx for the feedback

After gathering feedback, we have decided to skip promoting 0.7.7, and to treat these changes as a breaking change that will go out as 0.8.0, which will incorporate some of the feedback on 0.7.7 that we received. Look forward to an update soon!

Will there be any breaking changes between 0.7.7 and 0.8.0? I’ve started playing around with 0.7.7 and everything seems to work out of the box with the new project created by dfx. I was wondering if I can start working on stuff with this as a template, or wait for 0.8.0?

8.0.0 will be very similar to 0.7.7, and shouldn’t break anything. Really, 0.7.7 ought to have been released as 0.8.0-beta.1, because the breaking changes were introduced there

1 Like

0.7.7 copy:types uses ic network

I ran npm run copy:types to update a type in my declarations. It copied the declarations from .dfx/ic instead of .dfx/local. This did not have the update to my type and I got the following error: Reject text: Canister rkp4c-7iaaa-aaaaa-aaaca-cai trapped explicitly: IDL error: did not find field myField in record

Perhaps this is expected behavior? I did not expect it. I don’t want to have to deploy to ic before I can copy the references over.

The copy:types command will either use the DFX_NETWORK or fall back to the most recently modified files, using rsync's logic. To specify a network when you’re running it manually, try

DFX_NETWORK="local" npm run copy:types
1 Like

Dfx 0.8.0 is now released! Docs update and promotion coming soon