Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

component(1) support #421

Closed
wants to merge 4 commits into
from

Conversation

Projects
None yet
6 participants

nl0 commented Nov 21, 2013

Hi there!
Thanks for your work on this great project.
To help it get even better I've implemented component(1) support.

@philfreo philfreo and 1 other commented on an outdated diff Nov 21, 2013

backbone-relational.js
@@ -14,7 +14,7 @@
* CommonJS shim
**/
var _, Backbone, exports;
- if ( typeof window === 'undefined' ) {
+ if ( typeof require === 'function' ) {
@philfreo

philfreo Nov 21, 2013

Collaborator

i'm +1 for adding Component support, but I'm not sure that this change is the best/proper way to do AMD/requirejs support

See also #220 and #215

at this point i'd recommend copying Backbone's framework for commonjs/amd/vanilla, since Backbone now supports AMD: https://github.com/jashkenas/backbone/blob/master/backbone.js

@nl0

nl0 Nov 25, 2013

Adding AMD/require support wasn't my intent -- it is a bit more involved. I just wanted to fix CommonJS support for the browser and add component.json to be able to use the package properly in component(1) environment.

nl0 added some commits Nov 25, 2013

Merge upstream
* upstream/master: (35 commits)
  Upgrade qunit
  Fix subModels not being populated properly on Underscore 1.6.0, due to `_.each` api change.
  Fire change events right away if we're not in a nested scenario. Fixes #427
  Document `store.unregister`
  `store.unregister` now also accepts collections or a model type
  Change `findOrCreate` to pass `parsedAttributes` to `build`, and adjust tests to reflect change.
  Remove unnecessary locking
  Update change log
  Add test for models not being added to store until they get an id
  Change where we listen to `relational:unregister`.
  Only add models with an id to the store. Closes #411
  Fix a bug in the (crude) performance test
  Add a small test for `clear`
  Fix collection return values when setting/removing `[]` and `null`. Ref #419
  Clarify the behavior of `findOrCreate` when it just a receives a scalar value. Ref #399
  Proper return values on collection methods for Backbone 1.1. Closes #419
  Submodels: accommodate multiple 'type' keys for the same submodel. Closes #429
  Hmm, fix spaces/tabs mix in the example
  Update a few version numbers in the docs to 0.8.7
  Backbone-relational 0.8.7
  ...

Some of these changes are likely superseded by #215 assuming it is merged. Might make sense to pull the component.json out into a separate commit/PR.

Uh, already merged.

Owner

PaulUithol commented Mar 25, 2014

Shouldn't this be bower.json nowadays?

Owner

PaulUithol commented Mar 25, 2014

Or is that something different altogether again.. seeing a comment in the docs there: "In versions of Bower before 0.9.0 the package metadata file was called component.json rather than bower.json. This has changed to avoid a name clash with another tool. You can still use component.json for now but it is deprecated and the automatic fallback is likely to be removed in an upcoming release."

@PaulUithol PaulUithol referenced this pull request Mar 25, 2014

Closed

Bower pulls old code #445

Yes, different tools. Based on the original I understood it to be the component.io version of component.json. Bower compat should come from bower.json.

azhang commented May 1, 2014

+1

Collaborator

bpatram commented Mar 28, 2016

Seeing as Component JS is no longer active I am closing this PR

@bpatram bpatram closed this Mar 28, 2016

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