Comments (15)
I do remember I had this problem when I was trying to use debowerify
transform and backbone
module was in bower_components
from requirebin.
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.
i wonder if there is a good way to get the equivalent of npm ls
from browserifyCDN
from requirebin.
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.
@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.
@ganchenkor the answer to your question is https://github.com/substack/node-browserify#browserifytransform
from requirebin.
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.
@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.
I don't have any problems in my repo. I can't load Marionette in Requirebin. That's all
from requirebin.
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.
That's what I'm trying to say. Thank you @jmeas
from requirebin.
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.
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.
Done https://www.npmjs.org/package/marionette-browserify
from requirebin.
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)
- Can't install browserify-cdn
- Receiving errors when trying to run promises-tests
- Can't require browserify... HOT 2
- Flagrant system error
- iframe has scrolling="no" HOT 2
- <script> & <link> tags are ignored (possible solution included)
- es6 destructuring and indentation HOT 1
- CORS error when I try to require
- Debug mode
- Can't save from gist HOT 4
- Where are the libraries loaded and where does the execution take place?
- Need to refresh once after visiting site in Chrome HOT 3
- cannot read property content of undefined HOT 1
- Error: CORS request rejected: https://wzrd.in/multi HOT 4
- gatekeeper.maxogden.com not resolving HOT 2
- HTTPS support HOT 1
- ** operator not allowed HOT 1
- Clean page logs errors in console: `sinon is not defined`
- Current project status HOT 1
- Is requirebin.com still in use HOT 2
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 requirebin.