Pre-release: v4.0.0 (beta 2)
Pre-releaseHello! π
Another beta release of the upcoming Truffle 4! Big thanks to the community for all of the feedback on the first beta β this release is chock-full of bug fixes and new features brought up by all of you. To download, see below. As always, we'd love to hear from you! If you're upgrading from Truffle 3, please see the upgrade section below.
Note: Beta 1 was released prior to this one, but contained a bug for Windows users that has now been fixed.
What's New in this Beta
- Lots of improvements and fixes for
truffle develop
(see below) - Improve
truffle test
compatibility #601 - Upgrade
solc
to v0.4.17 (Warning: Expect some additional Solidity warningsβ οΈ , see below) #604 - Start parsing Solidity with
solc
itself instead of separate parser library #560 - Support proxy environment variables with
truffle unbox
(trufflesuite/truffle-box#8)
Truffle Develop Updates
Featuring multiple concurrent truffle develop
sessions π !
-
Run
truffle develop
in two or more terminals and connect to the same managed RPC: (#571) -
Access RPC logs with
truffle develop --log
: (#598) -
Fix problems with synchronous requests not working (e.g.
web3.eth.accounts
) #570 -
Fix bug where
test
insidetruffle develop
would not run twice in a row #585
solc
Upgrade Notes
Solidity v0.4.17 introduces a couple new keywords and deprecates others.
You'll likely encounter the following warnings:
- The
constant
keyword has been replaced byview
andpure
. You'll get warnings for usingconstant
. - Functions not marked with
public
/private
/internal
/external
will throw a warning.
Some of these warnings will come from Truffle / the Truffle Box. Please bear with us as we fix these issues as part of the full Truffle 4 release! π°
See Solidity v0.4.17 release notes for more information.
Updating to Truffle 4.0 from 3.x
For most users, updating to Truffle 4.0 from 3.x is seamless: You simply need to install the new version. However, there's one gotcha that might affect some users. Before we get to that, your TL;DR:
- Install the new version of Truffle
- Upgrade
truffle-contract
to^3.0.0
for any project that uses it (like frontends) - Run
truffle compile --all
to auto-upgrade contract artifacts and unlock debugging features.
Now for the nitty gritty...
In order to support debugging, the artifact format for Truffle contracts has changed (these are all the files that live in ./build/contracts
). The new format provides all the information needed to easily debug your contracts. There's one catch: You may have to do some upgrading. The good news is most of the upgrade is done automatically.
(Aside! We formalized and standardized our contract schema so you can write programs that interact with that format, too. Check it out! π)
Let's dive in.
Install the new version of Truffle
First you need to install the new version of Truffle. Remember that this is the beta release, so the process will be slightly different from before.
We'll start by uninstalling the old version of Truffle, if present:
$ npm uninstall -g truffle
Next, install the new version using the beta flag:
$ npm install -g truffle@beta
If you're on Ubuntu or OS X, you may need to use sudo
in the above commands.
Update truffle-contract
to ^3.0.0
Projects that interact with Truffle-created contracts, like frontends, usually do so by interfacing through the truffle-contract
library. If you have a project that uses truffle-contract
, you'll need to update that project's package.json
to include truffle-contract
^3.0.0
instead of the older version.
This upgrade should be seamless for most users, and you shouldn't have to update your project's code unless you use a contract's .toJSON()
function. Since the internal JSON representation has changed, the output that function returns will be different.
If you do not use .toJSON()
and you notice the upgrade doesn't go seamlessly, then that's a bug. Please contact us right away so we can fix the (unintended) breaking changes.
Finally, run truffle compile --all
Running truffle compile
will cause Truffle to upgrade your contract artifacts to the latest format. This will also unlock the debugging features so you can better inspect your contracts' behavior.
That's it! This process should be pretty smooth, but let us know if it's not.
Thanks
Thanks to members of the community for your support in identifying issues and for your submitted Pull Requests in this release!
Feedback
We know, this release is BIG. With it came some big changes, and we couldn't keep putting out great software without your help. So please: Get on the bat phone (our Truffle Gitter channel) and drop us a line. We'd love to hear your experiences with this new release, how it makes your development life better, and how we can continue to improve.
Thanks as always, and happy coding!
-- The Truffle Team