Giter Site home page Giter Site logo

Comments (11)

ro-ka avatar ro-ka commented on July 19, 2024

Thanks, I knew there was a reason! Reverted it for now, but will leave this ticket open and review the build process later, no time right now. New (fixed) release is 1.3.0 on npm.

from react-geosuggest.

zallek avatar zallek commented on July 19, 2024

Adding reactify in dependencies leads that the package will be included in the final bundle whereas it's only needed for compilation.
Was working fine with reactify in devDependencies with webpack at least.

from react-geosuggest.

ro-ka avatar ro-ka commented on July 19, 2024

Already moved it back to the dependencies, update to 1.3.0. Will verify the build process and check how to preprocess this later.

from react-geosuggest.

idolize avatar idolize commented on July 19, 2024

@ro-ka Thanks!

@zallek Yes, having it in devDependencies is best, but the problem is that it will fail hard for anyone bundling their code with Browserify (webpack will work fine, but clearly not everyone out there uses the same build tools). Keeping it in dependencies is just a temporary workaround for a larger problem.

The best solution is to take the transform out of package.json, so Browserify never attempts to perform a transform after downloading it from npm (that feature is not needed here). The transform can still be performed as part of the build before publishing to npm through the prepublish section in scripts of package.json, or as part of the Gulp build task—at this point it will be safe to keep reactify in devDependencies instead of dependencies.

from react-geosuggest.

idolize avatar idolize commented on July 19, 2024

@ro-ka If you are looking for a good JSX transpilation tool to add to prepublish, I'd recommend Babel.

This script should replicate your current build structure without using reactify:

"scripts": {
  "prepublish": "babel ./src --out-dir ./dist",
},
"devDependencies": {
  "babel": "*"
}

Also, as an aside, you may want to add a .npmignore file to keep the src directory out of npm. More info on this subject here.

from react-geosuggest.

ro-ka avatar ro-ka commented on July 19, 2024

I know, using babel in many other projects. Just no time right now to change the build process. Will do so next week, hopefully!

from react-geosuggest.

ro-ka avatar ro-ka commented on July 19, 2024

Fixed and released as 1.4.0.

from react-geosuggest.

idolize avatar idolize commented on July 19, 2024

@ro-ka Thanks! Unfortunately, I'm getting errors trying to require this now with 1.4.0 released. First glance looks like it's because the main section of package.json points to "module/Geosuggest.js", but I don't see this file in my latest npm install.

Are you sure all compiled files were included in your npm publish?

from react-geosuggest.

ro-ka avatar ro-ka commented on July 19, 2024

Ah… https://docs.npmjs.com/misc/developers#keeping-files-out-of-your-package
Will fix, sorry!

from react-geosuggest.

ro-ka avatar ro-ka commented on July 19, 2024

Fixed in 1.4.1. Thanks for the feedback! Does it work now?

from react-geosuggest.

idolize avatar idolize commented on July 19, 2024

@ro-ka I updated and now I'm seeing a different error:

Cannot find module './GeosuggestItem.jsx' from '/node_modules/react-geosuggest/module'

from react-geosuggest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.