add component.json for componentjs support #204

Merged
merged 1 commit into from Feb 18, 2014

Conversation

Projects
None yet
5 participants
Contributor

pirxpilot commented Jan 31, 2014

see: https://github.com/component/component

To use with Component:

  • add "es-shims/es5-shim" dependency
  • require('es5-shim') in your code
component.json
@@ -0,0 +1,20 @@
+{
+ "name": "es5-shim",
@ljharb

ljharb Jan 31, 2014

Owner

please use 4-space indentation, for consistency with the rest of the repo

@pirxpilot

pirxpilot Jan 31, 2014

Contributor

will do

Owner

ljharb commented Jan 31, 2014

Can you elaborate on how version numbers work with component? Does it use conventionally named git tags, or does it locate the first commit on master in which the version number is changed?

Contributor

pirxpilot commented Jan 31, 2014

It uses git tags and '*' is master.

For now folks will have to use
"es-shims/es5-shim": "*"

and they will get the latest version.
But once you release '2.3.1' (or whatever version is next) and tag it as you tagged 2.3.0 we can all switch to specific version.

add component.json for componentjs support
see: https://github.com/component/component

To use with Component:
- add "es-shims/es5-shim" dependency
- require('es5-shim') in your code
Owner

ljharb commented Jan 31, 2014

@pirxpilot All the current version tags use the npm style - with a "v" prefix. So version 2.3.0 is tag v2.3.0. Bower supports this as well. Will this work with component?

Contributor

pirxpilot commented Jan 31, 2014

Sorry about the churn: I kept looking at the github URL and could swear it said es5-shim/es5-shim

In any case - I tested my master with some of my components and it works OK - require triggers

typeof exports === 'object'

case in the preamble.

Contributor

pirxpilot commented Feb 1, 2014

'v' prefix probably won't work - I could swear I saw tags without 'v' in this repo ;-)
In any case: not a big deal. There is some ongoing work in component with versioning and moving to an independent component registry.
IMHO having 'latest' supported is better than nothing.

@pirxpilot pirxpilot referenced this pull request in pirxpilot/jsonp Feb 1, 2014

Closed

More-compatible iteration #1

Owner

ljharb commented Feb 1, 2014

I had created those tags but have since deleted them - I want to have only v-prefixed tags. It's a shame component doesn't have support in component.json to define the tag name - either for the version, or the convention itself. You should PR that in :-p

Contributor

jdalton commented Feb 1, 2014

I had created those tags but have since deleted them - I want to have only v-prefixed tags. It's a shame component doesn't have support in component.json to define the tag name - either for the version, or the convention itself. You should PR that in :-p

Or you could let go of this v prefix hangup. Jordan, it's seriously bizarre to me that you've had such a hard time coming to terms with something as trivial as tags. I appreciate the fact that you've made a splash of activity in a relatively stale project and hope you continue the forward momentum but in all honestly your handling of the whole tags issue has really thrown me.

Contributor

pirxpilot commented Feb 1, 2014

Just to clarify: I officially have no position on version tag naming ;-)

Is there any other reason this can't be merged? If there is - let me know: I guess I could maintain a code42day fork forever (I'd rather not.)

For component folks who got lost and ended up here. If you want a specific release you can always do "es-shims/es5-shim": "v2.3.1"- that will make component-builder happy. Well - maybe not happy but it won't complain.

Contributor

bryanforbes commented Feb 1, 2014

Or you could let go of this v prefix hangup ... your handling of the whole tags issue has really thrown me

Or you could let go of this non-v prefix hangup. It's a name. If a tool doesn't allow any tag to be used, it would seem to me like it's fundamentally broken. I appreciate that Jordan has taken the reigns of this project and hasn't tried to rock the boat too much, including the tag thing.

Owner

ljharb commented Feb 1, 2014

@jdalton it's the way npm does it - and npm trumps bower or component by a long shot for the past, or forseeable future. I'd rather not support bower/component at all (given their paltry usage in comparison) rather than deviate from npm's conventions.

Contributor

jdalton commented Feb 1, 2014

@ljharb

It's the way npm does it

You've mentioned that before but I'm not sure what you're talking about.
For example, if I want to install lodash at a specific version the syntax is:

  • npm i lodash@2.4.1
  • component install lodash/lodash@2.4.1
  • bower install lodash#2.4.1
  • jam install lodash@2.4.1
  • volo install lodash/lodash/2.4.1

While npm and bower allow optional v, as @pirxpilot mentioned component is much more strict and works only with the exact tag. Having tags with leading v is not the norm for component, or any other reasonably well known JS package manager that I'm aware of. It seems like an unnecessary stumbling block that carries with it no real benefit.

Owner

ljharb commented Feb 1, 2014

You're right, I should be more specific - it's the way npm does git tags. If you use npm version to bump your version number, as is common and recommended, it will create a git tag with the "v" prefix.

Certainly installs and dependency declarations use primarily unprefixed version numbers (although npm uses semver, so it supports a number of prefixes). I'm not advocating that anything have the "v" prefix except git tags.

I believe this is a pretty big flaw in both bower and component - both bower.json and component.json have no mechanism to declare which git tag a given version corresponds to, which means they have to guess - and neither one documents this guessing algorithm anywhere. That doesn't inspire confidence in either system's algorithm's stability or robustness, even if it's the way they happen to work, and even if it's the way that the community typically uses them.

Contributor

jdalton commented Feb 1, 2014

You're right, I should be more specific - it's the way npm does git tags.

Ahhh, ok! I still don't see the benefit of following npm version, as previously mentioned many of the most used npm packages don't follow it and their users don't seem to be impacted.

I'm not advocating that anything have the "v" prefix except git tags.

It's a shame the end result is making things needlessly hard/more-error-prone for devs.

Prioritizing some npm version command at the cost of added grief for other package managers arguably more tailored to browsers/environments that might actually need es5-shim seems at odds with this project's goals.

Contributor

pirxpilot commented Feb 1, 2014

@ljharb This is how component is using git tags It's documented and predictable.

Owner

ljharb commented Feb 1, 2014

@jdalton Fair point. I'm definitely open to weighing all options - the past approach has been to have minimal to no support for alternatives to npm, so I hope that even considering supporting them indicates my good intentions :-)

@pirxpilot Thanks for pointing that out! However, it mentions Github-style URLs for alternative registries - but nothing about git tags. The latest tagged version of this shim is https://github.com/es-shims/es5-shim/blob/v2.3.0/es5-shim.js for example - which doesn't follow their convention - so although they may be referring to the Github API, it's not very clear or explicit to me how that URL translates to a git tag.

So after a bunch of discussion, what's the status on this PR? I'd like to include es5-shim via component. Is it going to end up in mainline or should I be referencing the code42day fork?

Owner

ljharb commented Feb 18, 2014

If component lets me use any tag convention I wish - ie, if it's configurable in component.json - I'll happily add support for it.

I'm very concerned that it seems neither bower nor component has anything but a poorly-documented convention for mapping versions to git tags, and I don't want to have more than one tag for a given version if I can avoid it.

My impression is that component supports arbitrary version strings that will map to github tags, branches, etc. That is, in component.json, you could put "v2.3.0" and it will map to that tag. Does that work for you?

Owner

ljharb commented Feb 18, 2014

Ah, that absolutely would! I'll get on that right now.

ljharb added a commit that referenced this pull request Feb 18, 2014

Merge pull request #204 from code42day/component-js
add component.json for componentjs support

@ljharb ljharb merged commit a8266f6 into es-shims:master Feb 18, 2014

1 check passed

default The Travis CI build passed
Details

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment