chemerisuk / better-dom

Live extension playground
http://chemerisuk.github.io/better-dom/
MIT License
545 stars 35 forks source link

Usage without bower #8

Closed mrzafod closed 10 years ago

mrzafod commented 10 years ago

Hi. I was intrested in your project from the first look (спасибо хабру). It's really BETTER DOM. So I've used it on a production in a small project build on node.js with a bower onboard. And it has worked as expected. Now I working on a Meteor.js and I have to stay away from bower (sadly). How can I get a "browsefied" build of betterDom? Is it possible?

chemerisuk commented 10 years ago

Hey Roman. You can simply use a direct git url with a commit hash to grab the repo using NPM (see this answer on StackOverflow):

{
  ...
  "devDependencies": {
     "better-dom": "git://github.com/chemerisuk/better-dom.git#commit_hash"
    ...
  }
}

Just curious why you can't install bower? It's just a tool for aliasing git repos.

mrzafod commented 10 years ago

@chemerisuk thanks, I've got this one. Don't you have a separate features list or roadmap board like trello? BetterDOM seems like a something big in future and it's a positive one to catch all planned features.

chemerisuk commented 10 years ago

Take a look at the project releases section - I'm trying to compile there a change log for major releases at least. I also have a private spreadsheet on google drive with potential features, but most of them require investigating. It's probably a good idea to make it public... need to find the best way how to do it.

Also there is the project wiki where you can always find more information about the library.

mrzafod commented 10 years ago

Sadly, but Meteor can't buid package that is imported as subscribed. Trying to build it with bower in a separate project

chemerisuk commented 10 years ago

Could you provide a stack trace? I've never deal with Meteor.

mrzafod commented 10 years ago

You can take a quick look at https://github.com/oortcloud/unofficial-meteor-faq#what-about-npm-node-modules. Meteor has its own package system that can use some NPM packages. Thats why Meteor can not provide an environment for building better-dom from the source

chemerisuk commented 10 years ago

You don't need to build from the source - just include files from dist folder.

mrzafod commented 10 years ago

I mean the repo, not any folder. Why don't you provide a builded and minified version. It could be distributed via CDN. And all of this could make better-dom more popular, cause it's brilliant one

chemerisuk commented 10 years ago

I'd rater include tools for making minified build than put minified version into the source control. So the next version (which will be 1.7.0 final I guess) will include npm run-script build that will create regular and minified builds and source maps in the build directory.

Regarding the problem with Meteor I've found an article that aims to solve similar problem: http://tridnguyen.com/articles/meteor-and-bower/. Seems like you just need to override bower_components directory to public/bower_components using .bowerrc file and add <script src="bower_components/better-dom/dist/better-dom.js"></script> on your page. Hope this helps.

mrzafod commented 10 years ago

Solved. Usually Meteor wants to define any globals via its own Package API, i.e.

Package.on_use(function(api) {
    api.add_files("better-dom.js", "client");
    if (typeof api.export !== "undefined") {
        api.export("DOM", "client");
    }
});

But better-dom.js has already define a window.DOM so api.export("DOM", "client"); overrides that global to undefined

chemerisuk commented 10 years ago

Excellent! Could you make a note in FAQ about your solution for Meteor (it should be editable for anybody)?