Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring your own dependencies #534

Closed
bartlangelaan opened this issue Mar 14, 2018 · 11 comments
Closed

Bring your own dependencies #534

bartlangelaan opened this issue Mar 14, 2018 · 11 comments
Labels

Comments

@bartlangelaan
Copy link
Contributor

Razzle is awesome because of it's no-config-needed approach. Everything works out of the box.

To make this all possible, Razzle has a lot of dependencies. Currently, these dependencies are locked. It seems like they are locked since 2e68e7d.

By locking these dependencies, it's hard for projects that use razzle to upgrade to a newer version of these dependencies. For example, eslint is currently locked at 4.5.0 while the latest version is 4.18.2. As stated in #404, old dependencies can become incompatible with other modules like eslint-config-airbnb.

If you run yarn add eslint, the newest version of eslint will be added to the project. But Razzle will still use the old version, because it's dependencies are locked. The only way to make Razzle use the new eslint is by changing the webpack config, but the old eslint will still be installed while it's never used.

Why were the Razzle dependencies locked? When they are loosened with a caret, it would be easier for users to update modules like eslint and babel. As long as dependencies uphold semver, updating them won't break Razzle.

@jaredpalmer
Copy link
Owner

Totally understand the frustration. Razzle runs on a lot of mission critical applications for my clients, so locking down deps is just a habit. When Babel 7 is released, I plan to do a large overhaul. I will consider relaxing them.

@jaredpalmer
Copy link
Owner

Feel free to submit a PR with the changes to eslint you'd like to see

@AndyArcherKG
Copy link

Any ideas when this will get a npm tag so we can pull this as a dependency?

@jaredpalmer
Copy link
Owner

I have been working on 2. I think it’s about time to tag 0.8 as 1

@JP-GNL
Copy link

JP-GNL commented May 10, 2018

Following on from @bartlangelaan's comment - I was also trying to use eslint-config-airbnb with Razzle. However, it relies on eslint ^4.9.0 and Razzle uses 4.5.0, so I've upgraded to 4.19.1 in my app and remapped Razzle's eslint to use my local app's:

config.module.rules[0].use[0].options.eslintPath = path.resolve(__dirname, 'node_modules/eslint');

Hope this helps.

@AndyArcherKG
Copy link

@JP-GNL in which file did you put this?

@JP-GNL
Copy link

JP-GNL commented May 10, 2018

Sorry, should have said: razzle-config.js in your app root.

@AndyArcherKG
Copy link

So for clarity, using the example for custom webpack config the completed file would look something like this:

'use strict';
const path = require('path');
module.exports = {
  modify(config, { target, dev }, webpack) {
    config.module.rules[0].use[0].options.eslintPath = path.resolve(__dirname, 'node_modules/eslint');
    return config;
  },
};

@stale
Copy link

stale bot commented Aug 15, 2018

Hola! So here's the deal, between open source and my day job and life and what not, I have a lot to manage, so I use a GitHub bot to automate a few things here and there. This particular GitHub bot is going to mark this as stale because it has not had recent activity for a while. It will be closed if no further activity occurs in a few days. Do not take this personally--seriously--this is a completely automated action. If this is a mistake, just make a comment, DM me, send a carrier pidgeon, or a smoke signal.

@stale stale bot added the stale label Aug 15, 2018
@stale
Copy link

stale bot commented Aug 22, 2018

ProBot automatically closed this due to inactivity. Holler if this is a mistake, and we'll re-open it.

@stale stale bot closed this as completed Aug 22, 2018
@nolandg
Copy link

nolandg commented Sep 12, 2018

Thank you @AndyArcherKG! I was fighting with this for a while, your solution works perfectly, didn't realize that was possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants