Comments (21)
@victorwpbastos following up from jspm/npm#39 (comment):
I think you're jumping a few steps - the first thing is to just get ractive-load
to work on its own.
Test out:
jspm install npm:ractive-load -o {...}
With a simple page to load System.import('ractive-load')
.
Then there will be an error, specifically I'm getting:
Uncaught Error: Could not find Ractive! It must be loaded before the Ractive.load plugin
system.js:2161 Uncaught Error evaluating file:///Users/guybedford/Projects/jspm-cli/sandbox/jspm_packages/npm/[email protected]/ractive-load.js
Uncaught Error: Could not find Ractive! It must be loaded before the Ractive.load plugin
es6-module-loader.js:139 Potentially unhandled rejection [2] Error loading "npm:[email protected]" at file:///Users/guybedford/Projects/jspm-cli/sandbox/jspm_packages/npm/[email protected]
Error evaluating file:///Users/guybedford/Projects/jspm-cli/sandbox/jspm_packages/npm/[email protected]
Uncaught Error evaluating file:///Users/guybedford/Projects/jspm-cli/sandbox/jspm_packages/npm/[email protected]/ractive-load.js
Uncaught Error: Could not find Ractive! It must be loaded before the Ractive.load plugin (WARNING: non-Error used)
I don't have time to help with this, but when I do I will.
from registry.
Yes, then I installed github:ractive, required it before ractive-load and everything works in runtime but in bundle not.
from registry.
@victorwpbastos ok I see. Yes, just requiring ractive before ractive-load is not enough, as you need to ensure the dependency is defined at a modular level. This is where you should use shim configuration to enforce the dependency https://github.com/jspm/registry/wiki/Configuring-Packages-for-jspm#shim-configuration.
from registry.
Also, perhaps use ractive-load from GitHub as well then?
from registry.
Basically, something like
jspm install github:ractivejs/ractive-load -o "{ shim: { 'ractive-load': ['ractive'] }, dependencies: { ractive: 'github:ractivejs/ractive' } }"
from registry.
Runtime: fine, bundle:
Ract plugin:
exports.translate = function(load) {
load.source = 'module.exports = ' + JSON.stringify(load.source);
return Ractive.load(load.address).then(function(c) {
Ractive.components['ract-teste'] = c;
});
};
from registry.
Yes this is a race condition that is only affecting you on the server as the dependency on Ractive
is not properly defined.
from registry.
So by now there is no way to do that?
from registry.
This will be fixed by applying the shim override like the above example in my previous comment.
from registry.
After that I could install ractive-load running: jspm install ractive-load
and jspm would take care of everything, is it?
from registry.
Yes exactly.
from registry.
I wanna help. How could I do that?
from registry.
I'd suggest trying to follow the suggestion in #115 (comment) and see where it breaks. Read about overrides in detail at https://github.com/jspm/registry/wiki/Configuring-Packages-for-jspm#shim-configuration.
from registry.
@victorwpbastos any luck with that? I'm having the exactly same problem. But I'm not using ractive-node but rcu. rcu is a dep used by ractive-load. @guybedford suggestion didn't worked.
from registry.
I came back to webpack until this is resolved.
Em 08/04/2015 15:36, "guilhermeaiolfi" [email protected] escreveu:
@victorwpbastos https://github.com/victorwpbastos any luck with that?
I'm having the exactly same problem. But I'm not using ractive-node but
rcu. rcu is a dep used by ractive-load. @guybedford
https://github.com/guybedford suggestion didn't worked.—
Reply to this email directly or view it on GitHub
#115 (comment).
from registry.
I wonder if that's something that @Rich-Harris could help and change in the library side.
from registry.
So I made some progress. Enforcing CJS as a format for rcu ( "format cjs" ) and instaling github:jspm/nodelibs-module and requiring it at the top of the file made it work until:
Cannot call method 'add' of null
at Object.cssConfigurator.extend (evalmachine.<anonymous>:3400:17)
at configure (evalmachine.<anonymous>:6977:19)
at Object.config.extend (evalmachine.<anonymous>:6932:12)
at extendOne (evalmachine.<anonymous>:16531:18)
at Array.reduce (native)
at Function._extend__extend (evalmachine.<anonymous>:16491:20)
at createComponent [as _onTimeout] (evalmachine.<anonymous>:387:27)
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
But that's OK, seems a library error, so commented the line in [email protected]:7400
global_css.add({ id: id, styles: styles });
then the build completes. Not a lot of changes to make. What you guys think?
from registry.
In fact I'm using handlebars again. Ractive seems a little work in progress. I hope they keep the good work. Looks promising!
from registry.
The problem with global_css.add({ id: id, styles: styles });
was my fault. The only problem left is enforcing the cjs format for rcu and requiring 'module' (nodelibs-module). Here is the code: https://github.com/guilhermeaiolfi/ractem
from registry.
@guilhermeaiolfi thanks for updating here. I've just added an experimental feature to jspm at jspm/jspm-cli#670, which would allow shim to apply to any module format.
With this feature, such an install can be accomplished with:
jspm install npm:rcu -o "{shim:{'dist/rcu':{deps:['module']}},dependencies:{module:'jspm/[email protected]'},format:'cjs'}"
This is breaking though, so won't be released too soon unfortunately, but let me know if it looks like that will help here.
from registry.
So, it worked for me:
System.config({
meta: {
'github:ractivejs/[email protected]/dist/rcu': {
deps: ['module'],
format: 'cjs'
}
}
});
It took me a while until I understood how 'meta' works because it matches files and not modules names (at least in this case).
DO NOT WORK:
System.config({
meta: {
'rcu': { // 'github:ractivejs/[email protected]' won't work either
deps: ['module'],
format: 'cjs'
}
}
});
I hope it helps someone else. You can close this issue for now.
Thanks for the tips.
from registry.
Related Issues (20)
- Difference between Jenkins and local build HOT 7
- Slow/flaky npm.jspm.io registry HOT 7
- intro.js overrides? HOT 1
- npm Debug package override not applying HOT 3
- some fetch errors while making ts bundle HOT 1
- Latest d3 breaks jspm install HOT 3
- registry CI failure caused by transitive dependency update
- GitLab endpoint? HOT 1
- I'm confused by the module format documentation in the wiki HOT 2
- Is there a way in my package.json to tell JSPM not to install a specific dependency? HOT 14
- Mapping a dependency to `@empty` changes the import path
- Bootstrap install fails HOT 5
- `jspm install` not outputting anything in Windows bash
- React Router Dom 404
- new HOT 1
- Question: how much can I use dev.jspm.io? HOT 2
- kasperlewau.github.io/registry is not found HOT 1
- Licensing information. Can this project make it explicit?
- @shopify/app-bridge-utils is missing all new versions for the last 9 months HOT 2
- Self-hosting JSPM? HOT 5
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 registry.