Comments (9)
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.
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.
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.
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.
Also relevant: http://blog.izs.me/post/44149270867/why-no-directories-lib-in-node-the-less-snarky
from spec.
Interesting blog, so the take home messages appears to be no magic in bower.
from spec.
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.
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.
Closing as I disagree with 4 months ago @sindresorhus.
from spec.
Related Issues (20)
- bower validate? HOT 1
- Should `main` contain individual JS files or one concatenated JS file? HOT 4
- "overrides" property proposal HOT 3
- Proposal for an optional "supportedVersions" property HOT 2
- main and ignore are optional, but bower complains if missing HOT 1
- How should local components be specified and consumed to avoid duplication? HOT 1
- files: list all required files for build tools HOT 71
- Version the spec itself HOT 5
- Add the possibility to host custom fields in the bower.json HOT 5
- Rename repository to bower-spec and add .bowerrc specificaton HOT 5
- dependencies and devDependencies automatically pull the latest commit when url has #latest suffix ? HOT 1
- Inconsistencies for version, main, ignore attributes HOT 1
- Formatting of Deprecated is Confusing HOT 1
- example of environment variables seems incorrect HOT 2
- config spec does not document hooks HOT 1
- main property for es6 module version HOT 1
- Author clarification
- save and save-exact aren't listed in the spec
- Concurrent bower install error.
- Default value of `private` field is not specified. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spec.