Giter VIP home page Giter VIP logo

Comments (9)

briandipalma avatar briandipalma commented on July 19, 2024

This seems like a sensible objection, does this mean bower will throw an error/refuse to register a package that does not provide a main.

Being strict from the start and then loosening the rules if they end up being too strict is easier then being loose at the start and then trying to tighten them up.

from spec.

josh avatar josh commented on July 19, 2024

You definitely should not need to have a main. Components that have many optional modules may not have any sort of "base" requirement. See bootstrap, rails-behaviors.

What is the action item here. index.js is not currently mentioned at all in the spec?

from spec.

sindresorhus avatar sindresorhus commented on July 19, 2024

To be clear. This is for components containing JS.

This seems like a sensible objection, does this mean bower will throw an error/refuse to register a package that does not provide a main.

We can't do that as many components don't have JS.

My point is for Bower to not try to find an index.js if main isn't specified. As this is a wasted system call and logical overhead for the user.

from spec.

briandipalma avatar briandipalma commented on July 19, 2024

You definitely should not need to have a main. Components that have many optional modules may not have any sort of "base" requirement. See bootstrap, rails-behaviors.

So you would include them by doing

const dropdown = require("bootstrap/js/dropdown");

I guess...

We can't do that as many components don't have JS.

True. I'm seeing everything through the prism of JS because ideally I'd want bower to be the base for a development toolset that allows you to do bower install and within a development webpage/workbench that you use to the develop the package/component that you did bower install within you could instantly start doing require("resource") and it would be available on a browser refresh.

Manually adding script tags doesn't scale for large single page applications made up of tens of components. So something like bower and a tool like browserify that understands ES6 modules and bower packages is the best solution.

Hence my feeling that the more guarantees a bower package can provide the more the toolset can rely on conventions and be simple to develop/understand/develop with.

from spec.

sindresorhus avatar sindresorhus commented on July 19, 2024

Also relevant: http://blog.izs.me/post/44149270867/why-no-directories-lib-in-node-the-less-snarky

from spec.

briandipalma avatar briandipalma commented on July 19, 2024

Interesting blog, so the take home messages appears to be no magic in bower.

from spec.

josh avatar josh commented on July 19, 2024

I agree with non spec'ing index.js, but rehashing izs's opinion doesn't really apply to our situation.

bower isn't node.js. node.js is built on the assumption everyone can write and maintain this tiny little single file dependencies. This is not the case for the frontend landscape where components can have many parts and many subresources. bootstrap isn't going to create 100 repositories for every js file, css file, or image file.

from spec.

sindresorhus avatar sindresorhus commented on July 19, 2024

There can be a degree of modularity. Doesn't have to be either Bootstrap or your version.

Keep in mind that we are architecting Bower for the future, not the awful monolithic present. The point is that your thing should do one thing and do it well.

bootstrap isn't going to create 100 repositories for every js file, css file, or image file.

Of course not, but with Web Components it should split the widgets up into self-contained reusable components.

from spec.

sindresorhus avatar sindresorhus commented on July 19, 2024

Closing as I disagree with 4 months ago @sindresorhus.

from spec.

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.