Coder Social home page Coder Social logo

Comments (15)

ganchenkor avatar ganchenkor commented on August 24, 2024

I do remember I had this problem when I was trying to use debowerify transform and backbone module was in bower_components

from requirebin.

kumavis avatar kumavis commented on August 24, 2024

The offending line is
Marionette.Deferred = Backbone.$.Deferred; in backbone.marionette
Marionette is getting a different Backbone object than you are above. So it does not have jq set. Not sure why it gets a different object, seems like the versions match ("1.1.2").

from requirebin.

kumavis avatar kumavis commented on August 24, 2024

i wonder if there is a good way to get the equivalent of npm ls from browserifyCDN

from requirebin.

max-mapper avatar max-mapper commented on August 24, 2024

there is no browserify section in this package.json https://github.com/ganchenkor/marionette-browserify/blob/master/package.json so browserify-cdn isn't running anything

from requirebin.

ganchenkor avatar ganchenkor commented on August 24, 2024

@maxogden - That is true You are right, I'm not using browserify-cdn in my repo.
I meant that with default browserify it works.
The only solution that I can see to make Marionette app work in RequireBin if there was a way to apply shims before using require 'someLib' (that would be FEATURE REQUEST)
Support for CoffeeScript via coffeeify transport would be nice too(I have example of it in my repo)
Example:

(function(root, factory) {
    var $ = require('jquery');
    var Backbone = require('backbone');
    Backbone.$ = $;
    var Marionette = require('backbone.marionette');
    var Radio = require('backbone.radio');
    var _ = require('lodash');
    module.exports = factory(Marionette, Radio, _);
}(this, function(Marionette, Radio, _) {
  'use strict';

  Marionette.Application.prototype._initChannel = function () {
    this.channelName = _.result(this, 'channelName') || 'global';
    this.channel = _.result(this, 'channel') || Radio.channel(this.channelName);
  }
}));

in this shim I
1)resolve $ dependency
2)substitute underscore with lodash
3)substitute wreqr with backbone.radio

Is it possible to make a feature in requirebin to use shims for packages BEFORE they are required?

from requirebin.

max-mapper avatar max-mapper commented on August 24, 2024

@ganchenkor the answer to your question is https://github.com/substack/node-browserify#browserifytransform

from requirebin.

ganchenkor avatar ganchenkor commented on August 24, 2024

I'm familiar how to use browserify transforms. How can I use it in http://requirebin.com ? We don't have access to package.json in Front End
Nor we have any other way to use transforms in http://requirebin.com

from requirebin.

max-mapper avatar max-mapper commented on August 24, 2024

@ganchenkor requirebin doesn't actually browserify the code from the editor in the requirebin web app, it only browserifies all of the require()'d dependencies. so you'd have to e.g. add a transform section to https://github.com/ganchenkor/marionette-browserify/blob/master/package.json to have a browserify transform run on that module

from requirebin.

ganchenkor avatar ganchenkor commented on August 24, 2024

I don't have any problems in my repo. I can't load Marionette in Requirebin. That's all

from requirebin.

jamesplease avatar jamesplease commented on August 24, 2024

For the record, we're aware of this issue over in Marionette. We weren't including jQuery, because Backbone should be including it – but it doesn't. In a future release, though, we plan to make the jQuery dependency explicit within Marionette.

So this should be less about making Marionette work / debugging Marionette, and more about if this is a feature that requirebin should have.

from requirebin.

ganchenkor avatar ganchenkor commented on August 24, 2024

That's what I'm trying to say. Thank you @jmeas

from requirebin.

max-mapper avatar max-mapper commented on August 24, 2024

The only way to support this with the current implementation of requirebin would be to publish https://github.com/ganchenkor/marionette-browserify to npm with the corrent transforms in it's package.json. That way when you require('marionette-browserify') it will run whatever transforms are in the package.json.

Otherwise we'd need to first make requirebin browserify the editor code and then add a feature on top of that that let the user install and run transforms during that browserification. I think this would be a lot of work so it's likely not going to get done unless someone here wants to take it on.

from requirebin.

ganchenkor avatar ganchenkor commented on August 24, 2024

Ok https://github.com/ganchenkor/marionette-browserify Done with this repo. Tonight will publish it on npm so we can use that in requirebin. Thank you @maxogden. But anyways, I will put that on my list to-do to see if I can find some time to learn source code of requirebin and suggest pull request for implementing custom browserify transforms.

from requirebin.

ganchenkor avatar ganchenkor commented on August 24, 2024

Done https://www.npmjs.org/package/marionette-browserify

from requirebin.

ganchenkor avatar ganchenkor commented on August 24, 2024

I just applied shim instead of using browserify-transports.
I just don't understand why it doesn't work with applied shim right inside of requirebin.
Theoretically, it should work.

from requirebin.

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.