-
Notifications
You must be signed in to change notification settings - Fork 9
Conversation
94f507c
to
52f46f3
Compare
This is awesome. We no longer need I was able to get it running on Circle by adding It'd be good to have one more dev's opinion before merging this I think, but this works well for me and the code looks good. |
Note we will have to update the readme file to mention this new dependency. |
Done! Uncharacteristically I had already thought of it :) |
3. Execute `npm start` to install packages and start the server | ||
4. Add `127.0.0.1 delphin.localhost` to your `hosts` file | ||
5. Open http://delphin.localhost:1337 in your browser | ||
3. Install Webpack: `npm install webpack -g` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we have to install webpack
explicitly. Yarn will take care of that.
1702ec8
to
57613d7
Compare
@@ -9,16 +9,15 @@ | |||
"build:server": "webpack --config webpack.server.config.js --progress --colors", | |||
"build:static": "BUILD_STATIC=true REFRESH_I18N_CACHE=true node server/build/bundle", | |||
"clean": "rm -f public/scripts/vendor.*.js && rm -f public/scripts/*.bundle.*.js && rm -f public/scripts/bundle.*.js && rm -f public/styles/bundle.*.css && rm -f public/scripts/assets.json && rm -rf server/build && npm run clean:i18n-cache && npm run clean:static", | |||
"clean:all": "rm -rf node_modules && npm run clean", | |||
"clean:all": "rm -rf node_modules && rm -f yarn.lock && npm run clean", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably not remove the yarn.lock
file since it's basically an extension of package.json
.
1d9b4a8
to
633266f
Compare
Awesome indeed. So we'll have to use both yarn and npm for some time. I added a simple commit to make circleci install deps using yarn instead of npm. |
|
deployment: | ||
production: | ||
branch: master | ||
branch: /.*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will need to revert this to master before merging
Still fighting with CircleCI? :D |
@gziolo Indeed :) I have found a couple more issues with yarn:
|
I'm still a bit worried about how it will play out if we upgrade node for instance, yarn might not rebuild the dependencies. Maybe that's an issue for another time. This is ready for review ;) |
I would also recommend investigating build time on Circle CI: Comparing for the times shared by @stephanethomas, it doesn't looks like an improvement ... Maybe it still needs some tweaks :) |
Nice experiment, @stephanethomas! Also, good team work getting this ready to ship 🍰 This doesn't seem to break any of the main flows, so apart from any further performance tweaks, product 👍 |
That's probably because I cleared the cache for this test. I think it's an improvement for our dev environment at least, it's a pain to wait 20s for npm to detect than nothing has changed :) |
I took a closer look at Circle CI. Everything looks good, you just enabled deployment part for branches other than master and that increased the build time: So I guess it looks good to go, unless @stephanethomas has some comments :) |
Yep because I added those in our circle.yml here 64a5303 |
dependencies: | ||
pre: | ||
- curl -o- -L https://yarnpkg.com/install.sh | bash | ||
- yarn run preinstall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we simply do npm install -g yarnpkg
like in development?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can but the idea is to get rid of npm
eventually
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha. It's just that I'm not a big fan of downloading and executing a shell script :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed it's not the best, but in the end, we do have to trust some server to give us the right version of our library anyway. Granted there are more secure solution on the market!
3. Execute `npm start` to install packages and start the server | ||
4. Add `127.0.0.1 delphin.localhost` to your `hosts` file | ||
5. Open http://delphin.localhost:1337 in your browser | ||
4. Install yarn: `npm install -g yarnpkg` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we simply mention it in point #1 instead?
1. Make sure you have `git`, `node`, `npm`, and [`yarn`](https://yarnpkg.com/en/docs/install) installed
I think it's better to point to Yarn's installation page since the process is different depending on the platform.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed a commit to do just that ;)
Product was 👍 , I removed the commit which let us build an archive version of our app for other branches than |
This moves commands specified in the CircleCi dashboard to this configuration file. Note these commands replace the ones inferred by CircleCi.
Come on, we're no longer in beta!
371aec5
to
64b2f9f
Compare
I've rebased and cleaned the commits history. |
This pull request updates Delphin to use Yarn to manage dependencies. As mentioned here, Yarn is a fast, reliable, and secure alternative Npm client. It has several advantages over Npm such as offering an offline mode, and better network performance. Right now it divides the installation process by almost two on the first build. This process even goes from 26 seconds to less than half a second on the next builds!
Npm
First build
Next builds
Yarn
First build
Next builds
Testing instructions
npm install -g yarnpkg
to install Yarngit checkout test/yarn
and start your serverAdditional notes
CircleCi still uses
npm
for building artifacts.Reviews
@Automattic/sdev-feed