sghiassy / react-native-sglistview

SGListView is a memory minded implementation of React Native's ListView
MIT License
743 stars 72 forks source link

Please Provide Compiled Versions #11

Closed peterpme closed 7 years ago

peterpme commented 9 years ago

Hi there,

This is great! My only concern is that I exclude node_modules. I can whitelist this package but it would be great if there were a compiled version we can use.

Thank you, Peter

sghiassy commented 9 years ago

Good idea. Will do in the next version.

sghiassy commented 9 years ago

I'll keep this issue open until I ship the compiled version.

peterpme commented 9 years ago

:+1: thank you

sghiassy commented 8 years ago

Haven't gotten to this yet. Swamped on some other projects.

Question I was thinking of though. When shipping react-native and using the build command react-native bundle --minify won't this source get minified in the process? Would it still be helpful to provide a pre-compiled version in NPM?

Thx

peterpme commented 8 years ago

yes, because you're otherwise requiring a transpiler dependency, rather than just letting the user use it as is.

I personally exclude babel to run through my node_modules, it's not necessary. I've had to create a flag for this plugin.

I would help you set this up actually, but it's not something you add to the repo. You just have a dist folder that's gitignored. npm will default to using dist in production, and the real source in dev mode

sghiassy commented 8 years ago

Ok, I put up a branch with the compiled versions master.provideBuild. Can you check it out and see if it looks good. I've been out of the JS scene for a bit.

From what you were saying, it seems like even if I add dist to .gitignore, npm will auto-magically use that folder for npm publish?

sghiassy commented 8 years ago

Also, I moved ./index.js to lib/index.js so it was included in the transpiling.

rreusser commented 8 years ago

Here's a simple repo where I've done the same: https://github.com/rreusser/react-native-paged-scroll-view

I .npmignored the source directory and .gitignored the build directory. I also had to .npmignore .babelrc, otherwise it broke actual builds. Finally, the prepublish script builds before publishing. It's not perfect and I'm sure there's more than one way to do it, but hope that's at least a reference point, if needed!

And to answer your question, I think the entry point in package.json needs to be the compiled version, even if that's gitignored.

sghiassy commented 8 years ago

The newest npm update includes the transpiled code in /dist. For now, I'm keeping package.json pointing to /lib. But the code is now available for reference/use in /dist.

Hope that helps

sibelius commented 7 years ago

I don't think it is necessary to have a compiled version of this package

react native handle well non compiled code

sghiassy commented 7 years ago

The latest version provides both compiled versions, as well as map files to help debuggers show the code in their original form. Should be best of both worlds.

Closing this issue. Please reopen should the current situation in v0.3.10 causes complications.

rreusser commented 7 years ago

@sibelius FWIW I wasn't sure either but asked on stackoverflow and was offered some suggestions. I liked this as a general answer:

To my mind yes, transpiling is a good step. We used it in react-native-drawer-layout, so we didn't have our users to enable certain babel features. On the other hand, the more Safaris JS engine reaches spec compliance with ES6, the more I would tend to say no, as transpiled code is almost always slower.

Not sure where we are in the transition, but whatever the answer, I think a "transition" to omitting it is a decent rationale.

sibelius commented 7 years ago

react-native packager enable all stage-0 features anyway

I hope we all delivery non compiled code in the future and let webpack/rollup only transpilers what is needed