gajus / brim

View (minimal-ui) manager for iOS 8.
http://gajus.com/sandbox/brim/demo/
Other
391 stars 41 forks source link

NPM error when searching for `gajus.Scream`! #29

Closed RafaelPlantard closed 7 years ago

RafaelPlantard commented 7 years ago

https://github.com/gajus/brim/blob/809d68475504aa2482fadca1d90cb7620fb11bbd/src/brim.js#L19

gajus commented 7 years ago

NPM error? Not clear what you are asking for.

Closing until further details provided.

RafaelPlantard commented 7 years ago

@gajus I'm trying to use Scream + Brim with webpack into a Vue.JS system, but when I try to create an instance of Brim, using the following code:

import Scream from 'scream';
import Brim from 'brim';

/*...*/

const scream = Scream({
    width: {
        portrait: 320,
        landscape: 568
    }
});

const brim = Brim({
    viewport: scream
});

package.json: "brim": "^1.0.11",

The brim instance has not been created because of this: https://github.com/gajus/brim/blob/809d68475504aa2482fadca1d90cb7620fb11bbd/src/brim.js#L19

For some reason the Scream from NPM package is not same of gajus.Scream instance. Any idea of how to solve it?

gajus commented 7 years ago

Have you inspected the contents of the entry point of those scripts?, i.e. look at the package.json main value and what script that executes.

I have not touched Scream/ Brim in a long time.

gajus commented 7 years ago

Oh, I see. This line of code was from Brim.

https://github.com/gajus/brim/blob/809d68475504aa2482fadca1d90cb7620fb11bbd/src/brim.js#L19-L21

Yeah, this obviously does not make sense.

Looks like the only fix would be to add scream as a dependency of Brim and check instanceof of the imported dependency.

RafaelPlantard commented 7 years ago

Hey @gajus thanks for this update, but apparently isn't working:

screen shot 2017-09-01 at 00 14 04

I run it before: npm update: "brim": "^1.0.12",

gajus commented 7 years ago

Can you try to look into the code?

I am out of capacity to take on this at the moment.

gajus commented 7 years ago

I am fine with the instanceof check being completely removed.

RafaelPlantard commented 7 years ago

Actually, it will be my next suggestion, haha, just check for not null value and remove instance of check.