Closed fredfortier closed 5 years ago
I am encountering the same issues when updating my project using ES6 with babel, as you mentioned.
@fredfortier @FabiolaBusch
Check out my alternative truffle box: https://github.com/adrianmcli/truffle-react
I use Web3 v1.0, and I have also enabled ES6 modules for writing tests. It seems like this repo is no longer actively maintained, but I tend to keep my repos pretty fresh (I am also the author of Truffle-Next btw).
I also avoid having conflicting environments between Truffle's JS environment and the React app by completely separating the frontend code into a different folder. The React app resides in its own /client
folder. Ideally, you'd use a monorepo-like approach but the current Truffle Unbox implementation would not allow for that. See this issue I made here: https://github.com/trufflesuite/truffle-box/issues/11
@adrianmcli I just wanted to say that your truffle box helped me out a lot. Great work
@medoror thanks! always good to hear that I'm helping. The maintainers of this repo seem to have decided to move on from this Truffle Box. They're putting all their effort into Drizzle, but I'm not sure it's the right direction for our community.
@adrianmcli what's the difference between truffle-react
and truffle-next
? I see that you are maintaining both and that they perform the same function. Is truffle-react
more ligthweight?
@fredfortier
truffle-react
uses Create React App for the frontend client. truffle-next
uses Next.js for the frontend client instead. Both of them allow you to make React web apps with minimal configuration.
Whether or not one is more lightweight than the other depends on what you are trying to do. Create React App tries to do less for you out of the box, but the generated project often have more files than a Next.js app.
The reason I maintain both is because I use both in my daily life. Both are capable of very complex web apps, but depending on your goals, usually one can get the balling rolling faster than the other. I highly recommend you check out both projects (CRA and Next.js) as they are maintained by some of the best people in the Javascript community.
An update for you all.
I have joined the Truffle team and I will be updating and maintaining the official Truffle boxes. Don't worry guys, it's coming soon!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This should be fixed now!
I started a project with this scaffold. While it works well, an older version of web3 is injected in my unit test. Also, I cannot import ES6 modules in them.
I'd expect the unit tests to be structured more like this: http://truffleframework.com/docs/getting_started/solidity-tests
How would I attempt to upgrade my project? I tried upgraded to ES6 like this: https://ethereum.stackexchange.com/questions/21210/syntaxerror-unexpected-token-import-on-truffle-test. However, this seems to cause some conflict in the Dapp with React expecting a different Babel config.