rtfeldman / seamless-immutable

Immutable data structures for JavaScript which are backwards-compatible with normal JS Arrays and Objects.
BSD 3-Clause "New" or "Revised" License
5.37k stars 194 forks source link

Add "react-native" key to package.json #181

Closed jgkim closed 7 years ago

jgkim commented 7 years ago

This resolves #180, which is related to facebook/react-native#2208.

rtfeldman commented 7 years ago

Thanks!

However, I don't understand why the source works but the development build fails. I'd like to understand this fix better before applying it...what is it about the development build that react native rejects it?

jgkim commented 7 years ago

@rtfeldman Since the build files for broswers are listed in .npmignore, it cannot be found and imported in the react-native (node) environment.

rtfeldman commented 7 years ago

@jgkim ah, got it!

In that case, it seems like it would make more sense to fix this by removing these from .npmignore:

seamless-immutable.development.min.js
seamless-immutable.development.js
seamless-immutable.production.min.js

...and then having both react-native and browser point to the development build.

What do you think?

jgkim commented 7 years ago

@rtfeldman I guess the react-native environment is somewhat different from the browser environment. Do you think it's appropriate for react-native to fallback to the browser field? If it's the case, why do we need to distinguish main from browser?

rtfeldman commented 7 years ago

Yeah maybe main should be node?

I think since we know about react-native it makes sense to include it alongside browser, just to be explicit.

jgkim commented 7 years ago

Making it explicit is good. :) I think react-native is more similar to node rather than browser. The packager of react-native will transpile and minify the source. However, whichever case we choose, it will work. ;)

rtfeldman commented 7 years ago

@jgkim If you make those changes above, can you rebase on top of master? I pushed (what ought to be) a fix for Travis builds getting credentials errors on PRs.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 95.942% when pulling 5cd203438fcef6802eb3b7d69d9ce0180e342e1e on jgkim:fix/react-native into ab98236daa8d09a27545d7316fd084675104ec5b on rtfeldman:master.

rtfeldman commented 7 years ago

Thanks @jgkim!