tshaddix / webext-redux

A set of utilities for building Redux applications in Web Extensions.
MIT License
1.23k stars 180 forks source link

Unable to import deep diff strategy #178

Closed rbutera closed 5 years ago

rbutera commented 5 years ago

we're trying to use the deepDiff strategy instructions as provided in the README

We can import 'react-chrome-redux' fine but if we try to import the deepDiff strategy we get this error (in BOTH webpack and jest) (our jest installation does not rely on / use webpack):

Module not found: Error: Can't resolve 'react-chrome-redux/strategies/deepDiff/diff' in 'PATH/TO/OUR/PROJECT'

in the end we have just copy/pasted the relevant code into our own repo but obviously this isn't the most elegant solution

Any ideas why this import is failing?

We've tried:

jvergeldedios commented 5 years ago

@Raigasm I had to do it this way:

import deepDiff from 'react-chrome-redux/lib/strategies/deepDiff/diff';
tshaddix commented 5 years ago

Did the above work for you, @Raigasm ?

rbutera commented 5 years ago

nope, for some reason that didn't work for me last time I tried it. I ended up copy pasting the full deepdiff to from source and it worked.

tshaddix commented 5 years ago

How very odd... alright well maybe it makes sense to expose these on the root object from webext-redux.

That way it can be something along the lines of import {deepDiff} from "webext-redux"; or:

import {strategies} from "webext-redux";
const {deepDiff} = strategies;
tshaddix commented 5 years ago

Shorter term, I've just updated README examples to include the lib folder ^^