Giter VIP home page Giter VIP logo

Comments (10)

mquandalle avatar mquandalle commented on May 28, 2024

Hello,

I've not tested it myself but there are already packages on atmosphere that depends on meteor-bower. For instance https://github.com/ccll/meteor-angular-ui-router/blob/master/smart.json

I think the current package API provided by meteor doesn't allow to restrict bower exports to the package scope, so the side effect is that exports are visible from the main app. There is some work in the upcoming constraint-solver core package that may help for that purpose in the future.

The other solution that currently works is to rely on git submodules and manually add the desired files in package.js.

from meteor-bower.

mquandalle avatar mquandalle commented on May 28, 2024

I think it would be possible to improve imports/exports management in the same way that the linker rewrite did it for meteor core packages. The idea is that each package is scoped inside a closure, if you want to access another package, you have to require it:

var backbone = Bower.require("backbone");

It will work only on the client side. The problem is that most of the code related to this is in the tools/ not packages/ so I need to see how feasible it is.

from meteor-bower.

Sivli-Embir avatar Sivli-Embir commented on May 28, 2024

So I have not tested it yet but I wanted to update this with my thoughts. I think the issue I am having is that I have not published my package on Atmosphere yet. Since meteor does not actually use smart.json the dependance is not being called.

It will be a little while until I am ready to put my work on Atmo. For a quick fix I found that if I called the dependency from my app then my smart package could use it. This is working fine for now but I think your idea to use linker style may be more intuitive for meteor users. That said you may want to wait until the meteor/atmosphere merge? Its possible that this issue will be easy to resolved then. (assuming I am right about why things are not working)

from meteor-bower.

mquandalle avatar mquandalle commented on May 28, 2024

I don't understand what you think the problem is. Does it work with a bower.json file instead of using smart.json?

from meteor-bower.

Sivli-Embir avatar Sivli-Embir commented on May 28, 2024

So within my app smart.json I am able to use bower just fine. But if I have a package with a smart.json and I reference bower nothing happens. I just tested a bower.json file, within the package, and had the same results.

In my smart package smart.json:

"packages": {
  "bower": "0.1.2"
},
"bower": {
  "notify.js": "1.1.0"
}

from meteor-bower.

mquandalle avatar mquandalle commented on May 28, 2024

Is your package located in the packages/ directory, or anywhere else?

from meteor-bower.

Sivli-Embir avatar Sivli-Embir commented on May 28, 2024

Standard layout with all the packages in packages/
Meteor Release 0.7.1.2
Meteorite version 0.6.15

from meteor-bower.

djhi avatar djhi commented on May 28, 2024

You have to include it in your package.js:

// Install bower components.
api.add_files('smart.json', 'client');

from meteor-bower.

monbro avatar monbro commented on May 28, 2024

Any updates on this? Meteor is 1.1 now :-)

from meteor-bower.

yourcelf avatar yourcelf commented on May 28, 2024

Just FYI for anyone who isn't clear (it wasn't to me, I just spent some time beating my head on this): mquandalle:bower does not currently support loading bower components specified by local packages (e.g. a package in your project's packages/ directory). So anyone needing bower components to be loaded for subpackages will currently need to duplicate those dependencies in a project-level bower.json, even with meteor 1.2.

from meteor-bower.

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.