Skip to content

Commit

Permalink
Script to inject prim to make updates easy
Browse files Browse the repository at this point in the history
  • Loading branch information
jrburke committed Jan 28, 2016
1 parent dc3a819 commit 9ad546f
Show file tree
Hide file tree
Showing 67 changed files with 1,668 additions and 5,183 deletions.
5 changes: 0 additions & 5 deletions .gitignore
@@ -1,5 +0,0 @@
alameda.min.js
alameda.min.js.gz
require.js
testBaseUrl.js
tests-requirejs
8 changes: 1 addition & 7 deletions .npmignore
@@ -1,8 +1,2 @@
LICENSE
alameda.min.js.gz
copyrequirejstests.sh
require.js
shrinktest.sh
testBaseUrl.js
tests
tests-requirejs
parts/
61 changes: 2 additions & 59 deletions README.md
@@ -1,60 +1,3 @@
#alameda
#alameda-prim

An AMD loader, like [requirejs](http://requirejs.org), but with the following
implementation changes:

* Assumes Promises are available in the JS environment.
* Targets "modern" web browsers that implement standardized script.onload behavior: execute load listener right after script execution, something IE9 and below did not do.
* Assumes browser support for Array.isArray, array extras, ES5 features.
* Does not support a couple of less-used APIs (see tests section below).

These changes means alameda is around 35% smaller than requirejs, 4.1 KB vs 6.4 KB, minified+gzipped sizes.

Browser support: browsers that [natively provide Promises](http://caniuse.com/#feat=promises). If you need to support IE 10 and 11, the [alameda-prim](https://github.com/requirejs/alameda-prim) project includes a private promise shim.

You can continue to use requirejs and the r.js optimizer for other scenarios.
The r.js optimizer works well with alameda-based projects.

## API

alameda supports [the requirejs API](http://requirejs.org/docs/api.html). It even
declares `requirejs`, to make passing the requirejs tests easier. alameda also
has a good chance of becoming requirejs in a far-future requirejs version.

## Running tests

The tests are pulled from almond and requirejs. All tests should be served
through a local web server, as the text loader plugin is used for some tests,
and some browsers restrict local XHR usage when the files are served from
a `file://` URL.

### Bundled tests

To run the tests that are just part of this repo, open `tests/index.html` in
a web browser.

### requirejs tests

To run the requirejs tests, first make sure the following projects have been cloned and are **siblings** to the the alameda repo:

* https://github.com/jrburke/requirejs
* https://github.com/requirejs/domReady
* https://github.com/requirejs/text
* https://github.com/requirejs/i18n

Then do the following:

* symlink alameda.js to require.js
* ./copyrequirejstests.sh

#### requirejs tests that do not pass

* require.undef()-related tests.
* onResourceLoadNestedRequire: depends on implementing requirejs.onResourceLoad
hook used for builds/some third party tools. This API is not required for normal
module loading.

## How to get help

* Open issues in the [issue tracker](https://github.com/requirejs/alameda/issues).
* Contact the [requirejs list](https://groups.google.com/group/requirejs).
The [alameda](https://github.com/requirejs/alameda) AMD module loader but includes a private Promise shim if the JS environment does not provide one. This is mainly to support using alameda in IE 10 and 11. If that is not a requirement for your project, then use alameda.

0 comments on commit 9ad546f

Please sign in to comment.