Skip to content

Commit

Permalink
Add requirejs to repo for DDC
Browse files Browse the repository at this point in the history
Fixes #29140

R=jakemac@google.com, whesse@google.com

Review-Url: https://codereview.chromium.org/2782213002 .
  • Loading branch information
vsmenon committed Mar 29, 2017
1 parent 2815f3f commit 7a809bc
Show file tree
Hide file tree
Showing 6 changed files with 2,285 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/dev_compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"karma-requirejs": "^0.2.2",
"karma-safari-launcher": "^1.0.0",
"mocha": "^2.2.4",
"requirejs": "^2.1.17",
"requirejs": "^2.3.3",
"webdriver-manager": "8.0.0"
}
}
45 changes: 45 additions & 0 deletions third_party/requirejs/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Copyright jQuery Foundation and other contributors, https://jquery.org/

This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/requirejs/requirejs

The following license applies to all parts of this software except as
documented below:

====

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

====

Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code displayed within the prose of the
documentation.

CC0: http://creativecommons.org/publicdomain/zero/1.0/

====

Files located in the node_modules directory, and certain utilities used
to build or test the software in the test and dist directories, are
externally maintained libraries used by this software which have their own
licenses; we recommend you read them, as their terms may differ from the
terms above.
13 changes: 13 additions & 0 deletions third_party/requirejs/README.google
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Name: RequireJS Asynchronous Module (AMD) implementation
Short Name: requirejs
URL: https://github.com/requirejs/requirejs
Version: 2.3.3
Date: February 19, 2017
License: MIT

Description:

This directory contains the un-minified require.js. It is provided as
a way to load and run Dart Dev Compiler (DDC) generated AMD modules.
It is distributed with the DDC's AMD Dart SDK module for convenience.

79 changes: 79 additions & 0 deletions third_party/requirejs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# RequireJS

RequireJS loads plain JavaScript files as well as more defined modules. It is
optimized for in-browser use, including in
[a Web Worker](http://requirejs.org/docs/api.html#webworker), but it can be used
in other JavaScript environments, like Rhino and
[Node](http://requirejs.org/docs/node.html). It implements the
[Asynchronous Module](https://github.com/amdjs/amdjs-api/wiki/AMD)
API.

RequireJS uses plain script tags to load modules/files, so it should allow for
easy debugging. It can be used
[simply to load existing JavaScript files](http://requirejs.org/docs/api.html#jsfiles),
so you can add it to your existing project without having to re-write your
JavaScript files.

RequireJS includes [an optimization tool](http://requirejs.org/docs/optimization.html)
you can run as part of your packaging steps for deploying your code. The
optimization tool can combine and minify your JavaScript files to allow for
better performance.

If the JavaScript file defines a JavaScript module via
[define()](http://requirejs.org/docs/api.html#define), then there are other benefits
RequireJS can offer: [improvements over traditional CommonJS modules](http://requirejs.org/docs/commonjs.html)
and [loading multiple versions](http://requirejs.org/docs/api.html#multiversion)
of a module in a page. RequireJS also has a plugin system that supports features like
[i18n string bundles](http://requirejs.org/docs/api.html#i18n), and
[text file dependencies](http://requirejs.org/docs/api.html#text).

RequireJS does not have any dependencies on a JavaScript framework.

RequireJS works in IE 6+, Firefox 2+, Safari 3.2+, Chrome 3+, and Opera 10+.

[Latest Release](http://requirejs.org/docs/download.html)

## License

MIT

## Code of Conduct

[jQuery Foundation Code of Conduct](https://jquery.org/conduct/).

## Directories

* **dist**: Scripts and assets to generate the requirejs.org docs, and for
generating a require.js release.
* **docs**: The raw HTML files for the requirejs.org docs. Only includes the
body of each page. Files in **dist** are used to generate a complete HTML page.
* **tests**: Tests for require.js.
* **testBaseUrl.js**: A file used in the tests inside **tests**. Purposely
placed outside the tests directory for testing paths that go outside a baseUrl.
* **updatesubs.sh**: Updates projects that depend on require.js Assumes the
projects are siblings to this directory and have specific names. Useful to
copy require.js to dependent projects easily while in development.

## Tests

This repo assumes some other repos are checked out as siblings to this repo:

git clone https://github.com/requirejs/text.git
git clone https://github.com/requirejs/i18n.git
git clone https://github.com/requirejs/domReady.git
git clone https://github.com/requirejs/requirejs.git

So when the above clones are done, the directory structure should look like:

* domReady
* i18n
* text
* requirejs (this repo)

You will need to be connected to the internet because the JSONP and
remoteUrls tests access the internet to complete their tests.

Serve the directory with these 4 siblings from a web server. It can be a local web server.

Open requirejs/tests/index.html in all the browsers, click the arrow button to run all
the tests.
Loading

0 comments on commit 7a809bc

Please sign in to comment.