Comments (11)
Have you tried using https://github.com/jaredhanson/deamdify?
from famous.
Oops, closing and reopen are my faults.
I tried deamdify
now. Thanks to @jpcamara .
I need to rename to famous/
to ../
for example require('famous/core/Engine')
to require('../core/Engine')
dirs
famous/
main.js
And exec browserify -t deamdify main.js -o bundle.js
makes bundle.js. yeah!
main.js is here.
var Engine = require('./famous/core/Engine');
It works but need many procedures. (and need to merge manually after that)
I tried aliasify
but looks not active to AMD.
Anyway, if this way are refined, common.js users can use famo.us easily but only common.js users. Almost develpper can't choose their own building system under constructuring.
My point of view is current using way is only for requirejs. I think providing all included file are easy to use if famous can.
from famous.
I'd also be interested in seeing a version that doesn't use require.js.
from famous.
For what it is worth you can change the name space in the requirejs config
which is bundled with the yo scaffolded base project. You could also
consider looking at the project browserify-ftw which is used to convert
require to common.
I personally have not played with either but I know @andredeandarade has.
On Apr 15, 2014 9:54 AM, "jodyheavener" [email protected] wrote:
I'd also be interested in seeing support for not needing require.js.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/27#issuecomment-40506067
.
from famous.
browserify-ftw worked wonders for me; you only need a minimal config to get it working.
Make sure there's nothing else in your working directory besides the famous folder before you do this, or browserify-ftw might mess with them too! Create these three files in the directory containing the main famous folder:
require.js
require.config({ paths: {} });
entry.js
define([],function(){});
config.js
module.exports = { indent: 0, dryrun: false };
Then run browserify-ftw -r require.js -c config.js -e entry.js
.
It'll transform all the files in place (and create a few extra files outside of the famous folder). You can delete all the extra files when you're done.
While this works, it sure as hell is clunky so I might start working on forking a brunch skeleton for Famous that uses the CommonJS format.
from famous.
@jdiaz5513 Let me know how browserify-ftw could be modified (beyond your instructions above) to get it working out of the box with no modifications. If it is reasonable, I can submit another pull request to browserify-ftw since I'm already familiar with that repo (since I made most of the changes that allow it to work nicely with famous code). I'm particularly interested in knowing the reason why those changes you made were necessary. i.e. what side effects did you observe without them that were undesirable? (FWIW I used browserify-ftw as a library and not as a CLI tool, so I'm not familiar with its CLI behavior).
To make things easier for others and to make this repeatable in other repos, add the following script to ~/bin
and chmod +x
it.
#!/bin/sh
set -eu
command -v browserify-ftw >/dev/null 2>&1 || { npm install -f browserify-ftw; }
DIR=`pwd`
REQUIRE=$DIR/require.js; ENTRY=$DIR/entry.js; CONFIG=$DIR/config.js
FILES=( $REQUIRE $ENTRY $CONFIG )
for i in "${FILES[@]}"
do
[ -f $i ] && { echo "${i} already exists. aborting"; exit 1; }
done
echo "require.config({ paths: {} });" > $REQUIRE
echo "define([],function(){});" > $ENTRY
echo "module.exports = { indent: 0, dryrun: false };" > $CONFIG
browserify-ftw -r $REQUIRE -c $CONFIG -e $ENTRY
rm $REQUIRE $ENTRY $CONFIG
from famous.
The indent behavior for me was odd.
I was expecting {indent: 2} to refactor all the code to an indent spacing of two, but instead what it (appears) to do is leave the require statements at indent level 0, and then everything below it got an indent of 2. I don't really see how that is useful at all?
The browserify-ftw command-line would be super useful if it had an option to just target a specific folder in "library mode", with the above config implied. No main entrypoint, do not generate browserify bundle build files, and add a flag to disable dryrun so you don't need a refactor config file either.
It should be as simple as this: browserify-ftw --library --folder famous/ --dryrun false
I'll have to look into using browserify-ftw as a library, maybe that'll be illuminating (I was assuming it was just a CLI tool).
from famous.
@mizchi @jdiaz5513 I put together a port of Famo.us to CommonJS here: https://github.com/aelr/famous-commonjs
from famous.
@aelr Great! And I created global namespace version by use your modules.
https://github.com/mizchi/famous-bundled
What I want is this repository's famous.min.js
. It is fork so I can't maintaine.
from famous.
👍
from famous.
I'm closing this for right now. Please feel free to reopen if you do not feel like you found the necessary answers in here
from famous.
Related Issues (20)
- Very bad performance for ScrollView on Android/Cordova HOT 9
- whats happening? HOT 9
- ScrollView breaks when surface content is modified by a third party like Angular. HOT 1
- Using ViewSequence.splice can mess up the internal linked-list HOT 1
- When will "mixed mode" be released? HOT 1
- Utility.clone issue HOT 1
- CORS issue w/ Picasa and slideshow demo HOT 1
- Stress test - Bad performance in Firefox only HOT 1
- FlexibleLayout subview not hidden when its ratio is 0 HOT 1
- Howto build famous without fastclick? HOT 3
- Scroll HOT 2
- Animation Smoothness issue in mobile devices. HOT 1
- mixed mode - native overflow scrolling with famous (+flex view) HOT 4
- Blank homepage of university HOT 1
- Where can we find the docs to the old 0.3.5 version HOT 1
- Weird issues with absolute positioning, movement, and changeContent on iOS HOT 1
- GridView HOT 1
- dev console and CTRL+C HOT 2
- Scrolling problem when height of blocks is less than container height (stuck at the bottom) HOT 2
- What if all the famo.us objects are native ?
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 famous.