Permalink
Browse files

Fix for path issue for optimizer in node, doc updates and version bum…

…p for release.
  • Loading branch information...
jrburke committed Mar 14, 2011
1 parent 8d33472 commit 1da7d82aa1a4f32a12d9ee81e1f71ce7a1e146c6
Showing with 52 additions and 48 deletions.
  1. +1 −1 README.md
  2. +2 −2 build/jslib/node/file.js
  3. +1 −1 dist/post.html
  4. +1 −1 dist/pre.html
  5. +44 −32 docs/download.html
  6. +2 −2 require.js
  7. +1 −9 tasks.txt
View
@@ -14,4 +14,4 @@ The standard require.js file is around 5KB when minified via Closure Compiler an
RequireJS works in IE 6+, Firefox 2+, Safari 3.2+, Chrome 3+, and Opera 10+.
-Latest Release: [0.22.0](http://requirejs.org/docs/download.html)
+Latest Release: [0.24.0](http://requirejs.org/docs/download.html)
View
@@ -17,11 +17,11 @@ define(['fs', 'path'], function (fs, path) {
function mkFullDir(dir) {
var parts = dir.split('/'),
- currDir = dir.indexOf('/') === 0 ? '/' : '',
+ currDir = '',
first = true;
parts.forEach(function (part) {
//First part may be empty string if path starts with a slash.
- currDir += (!first ? '/' : '') + part;
+ currDir += part + '/';
first = false;
if (part) {
View
@@ -1,6 +1,6 @@
</div>
<div id="footer" class="mono">
- <span class="line">Latest Release: <a href="http://requirejs.org/docs/download.html">0.23.0</a></span>
+ <span class="line">Latest Release: <a href="http://requirejs.org/docs/download.html">0.24.0</a></span>
<span class="line">Open source: new BSD or MIT licensed</span>
<span class="line">web design by <a href="http://andychung.ca">Andy Chung</a> &copy; 2011</span>
</div>
View
@@ -156,7 +156,7 @@ <h1>a javascript module loader</h1>
</ul>
<ul>
- <li class="version">0.23.0 Docs</li>
+ <li class="version">0.24.0 Docs</li>
</ul>
</div>
View
@@ -4,7 +4,7 @@ <h1>Download RequireJS</h1>
<li class="hbox"><a href="#latest">Latest Release</a><span class="spacer boxFlex"></span><span class="sect">&sect; 1</span></li>
<ul>
<li class="hbox"><a href="#requirejs">require.js</a><span class="spacer boxFlex"></span><span class="sect">&sect; 1.1</span></li>
- <li class="hbox"><a href="#samplejquery">Sample jQuery 1.5.1 project with require()</a><span class="spacer boxFlex"></span><span class="sect">&sect; 1.2</span></li>
+ <li class="hbox"><a href="#samplejquery">Sample RequireJS + jQuery 1.5.1 project</a><span class="spacer boxFlex"></span><span class="sect">&sect; 1.2</span></li>
<li class="hbox"><a href="#node">RequireJS adapter for Node and Rhino</a><span class="spacer boxFlex"></span><span class="sect">&sect; 1.3</span></li>
<li class="hbox"><a href="#optimizationtool">Optimization Tool / Full Source</a><span class="spacer boxFlex"></span><span class="sect">&sect; 1.4</span></li>
</ul>
@@ -21,52 +21,52 @@ <h1>Download RequireJS</h1>
</div>
<div class="section">
-<h2><a name="latest">Latest Release: 0.23.0</a><span class="sectionMark">&sect; 1</span></h2>
+<h2><a name="latest">Latest Release: 0.24.0</a><span class="sectionMark">&sect; 1</span></h2>
<ul>
-<li>Calculation of baseUrl changed. This affects the jQuery Sample project, which has been updated in this release. Instead of baseUrl defaulting to the directory containing require.js, it now defaults to the HTML page's directory. If data-main is used, then the directory used in that attribute becomes the baseUrl. Explicitly setting baseUrl in the configuration overrides the aforementioned defaults.</li>
-<li>The RequireJS optimizer now uses Node by default. So, build.sh/.bat are now Node-based. Java/Rhino is still supported via the buildj.sh/.bat scripts.</li>
-<li><a href="https://github.com/mishoo/UglifyJS">UglifyJS</a> is now the default minifier for the optimizer, since it works both in Node and in Rhino. However, UglifyJS does not do if/else dead code removal, so the <a href="optimization.html#hasjs">has() optimization</a> is not that great when using UglifyJS. Hopefully this will change in a future version of UglifyJS. If you want the full has() optimization, Closure Compiler can still be used, either by using buildj.sh to use Java/Rhino to do the optimization work, or by running Closure Compiler yourself after the optimizer runs.</li>
-<li>The behavior of the Node adapter, r.js has changed. It now assumes that any module found via the RequireJS config uses define() to define modules. If a module is not found via the RequireJS path config, r.js uses Node's native require() function and its pathing rules
-to find the module. This allows the most compatible use of npm-installed modules. However it means you <strong>should not</strong> include RequireJS configuration for npm-installed modules/packages.</li>
-<li>The r.js adapter now works in Node and Rhino.</li>
-<li>The config option, <strong>baseUrlMatch</strong> has been removed, since the data-main baseUrl rule mentioned above removes the need for it.</li>
-<li>Some important fixes around loader plugins: a fix to allow multiple modules to use the same plugin resources as a common dependency, and to allow loader plugins that use a define() function callback to work in the optimizer.</li>
-<li>A fix for the use of jQuery's readyWait capability when jQuery is detected and used as a module.</li>
-<li>Some directory shuffling related to making the rhino and node adapters the same for use in command line tools and in the r.js adapter.</li>
+<li>Support for IE 9. It has <a href="https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution">a non-conformant script loading behavior</a> that necessitated the change. It would be ideal if IE 9 would change the behavior to be conformant.</li>
+<li>Changes to jQuery integration:
+ <ul>
+ <li>jQuery 1.5.1 included in sample project.</li>
+ <li>No more bundled RequireJS and jQuery file. RequireJS includes special code to detect jQuery as a module, so the combined file is not necessary, and this approach makes it easier to swap in new versions of jQuery as they are released.</li>
+ <li>Because of that change, the jQuery sample project using the new priority: config approach.</li>
+ </ul>
+<li>allplugins-require.js has been removed. Plugins are no longer bundled with require.js or in the sample jQuery project. There are separate download links to the existing plugins on the download page. Special treatment of these plugins has also been removed from the require.js source, so those plugins behave like any other loader plugin.</li>
+<li>There is now a <a href="#cs">CoffeScript plugin</a>. It makes it easy to code in CoffeeScript in the browser, it can participate in the optimizer optimizations, and it works in Node and Rhino. This is the best way to do cross-environment, modular CoffeeScript.</li>
+<li>Bug fixes.</li>
</ul>
<div class="subSection">
<h4 class="hbox">
<a name="requirejs">require.js</a>
<span class="boxFlex"></span>
-<a class="download" href="http://requirejs.org/docs/release/0.23.0/minified/require.js">Minified</a>
-<a class="download" href="http://requirejs.org/docs/release/0.23.0/comments/require.js">With Comments</a>
+<a class="download" href="http://requirejs.org/docs/release/0.24.0/minified/require.js">Minified</a>
+<a class="download" href="http://requirejs.org/docs/release/0.24.0/comments/require.js">With Comments</a>
</h4>
<p>All you need to start using require.js in the browser.</p>
</div>
<div class="subSection">
<h4 class="hbox">
-<a name="samplejquery">Sample jQuery 1.5.1 project with require()</a>
+<a name="samplejquery">Sample RequireJS + jQuery 1.5.1 project</a>
<span class="boxFlex"></span>
-<a class="download" href="http://requirejs.org/docs/release/0.23.0/jquery-require-sample.zip">Download</a>
+<a class="download" href="http://requirejs.org/docs/release/0.24.0/jquery-require-sample.zip">Download</a>
</h4>
-<p>A zip file containing a build of jQuery with integrated require() support, with an sample project included to show how it can be used when using jQuery.</p>
+<p>A zip file containing a sample project that uses jQuery and RequireJS.</p>
</div>
<div class="subSection">
<h4><a name="node">RequireJS adapter for Node and Rhino</a></h4>
-<p><strong><a href="http://requirejs.org/docs/release/0.23.0/r.js">r.js</a></strong>: use this file if you want to code to the RequireJS module format in Node or Rhino.</p>
+<p><strong><a href="http://requirejs.org/docs/release/0.24.0/r.js">r.js</a></strong>: use this file if you want to code to the RequireJS module format in Node or Rhino.</p>
<p><strong>Use in Node</strong></p>
<p>Requires Node 0.4.0 or higher. The <a href="node.html">Node instructions</a> explain how to use it. It includes all the code needed for RequireJS to function with Node.</p>
-<p><strong><a href="http://requirejs.org/docs/release/0.23.0/node/index.js">index.js</a></strong>: the standard HTTP server-based Hello World app for Node, but coded to work with the r.js adapter. Download it in the same directory as r.js and then run this command:</p>
+<p><strong><a href="http://requirejs.org/docs/release/0.24.0/node/index.js">index.js</a></strong>: the standard HTTP server-based Hello World app for Node, but coded to work with the r.js adapter. Download it in the same directory as r.js and then run this command:</p>
<pre><code>node r.js index.js
</code></pre>
@@ -86,11 +86,9 @@ <h4><a name="node">RequireJS adapter for Node and Rhino</a></h4>
<h4 class="hbox">
<a name="optimizationtool">Optimization Tool / Full Source</a>
<span class="boxFlex"></span>
-<a class="download" href="http://requirejs.org/docs/release/0.23.0/requirejs-0.23.0.zip">Download</a></h4>
-
-<p>A zip file that is the optimization tool for RequireJS. It also includes the full source for require.js and its plugins.</p>
+<a class="download" href="http://requirejs.org/docs/release/0.24.0/requirejs-0.24.0.zip">Download</a></h4>
-<p>If you want to use RequireJS in Rhino, you should use this download.</p>
+<p>A zip file that is the optimization tool for RequireJS. It also includes the full source for RequireJS.</p>
</div>
</div>
@@ -105,8 +103,8 @@ <h2><a name="plugins">Plugins</a><span class="sectionMark">&sect; 2</span></h2>
<h4 class="hbox">
<a name="text">text</a>
<span class="boxFlex"></span>
-<a class="download" href="http://requirejs.org/docs/release/0.23.0/minified/text.js">Minified</a>
-<a class="download" href="http://requirejs.org/docs/release/0.23.0/comments/text.js">With Comments</a>
+<a class="download" href="http://requirejs.org/docs/release/0.24.0/minified/text.js">Minified</a>
+<a class="download" href="http://requirejs.org/docs/release/0.24.0/comments/text.js">With Comments</a>
</h4>
<p><a href="api.html#text">Load text files and treat them as dependencies</a>. Great for loading templates. The text strings can be inlined in an optimized build when the optimizer is used.</p>
</div>
@@ -115,8 +113,8 @@ <h4 class="hbox">
<h4 class="hbox">
<a name="order">order</a>
<span class="boxFlex"></span>
-<a class="download" href="http://requirejs.org/docs/release/0.23.0/minified/order.js">Minified</a>
-<a class="download" href="http://requirejs.org/docs/release/0.23.0/comments/order.js">With Comments</a>
+<a class="download" href="http://requirejs.org/docs/release/0.24.0/minified/order.js">Minified</a>
+<a class="download" href="http://requirejs.org/docs/release/0.24.0/comments/order.js">With Comments</a>
</h4>
<p><a href="api.html#order">Load script in the order specified in the dependency array</a>. Useful for existing scripts that have implied dependencies instead of calling define() to create modular code.</p>
</div>
@@ -126,19 +124,18 @@ <h4 class="hbox">
<h4 class="hbox">
<a name="cs">cs (CoffeeScript)</a>
<span class="boxFlex"></span>
-<a class="download" href="http://requirejs.org/docs/release/0.23.0/minified/cs.js">Minified</a>
-<a class="download" href="http://requirejs.org/docs/release/0.23.0/comments/cs.js">With Comments</a>
+<a class="download" href="https://github.com/jrburke/require-cs/raw/0.1.0/cs.js">With Comments</a>
</h4>
-<p>Load files written in CoffeeScript. Works with the optimizer to allow inlining of the CoffeeScript-converted-to-JavaScript code in an optimized build. The best way to use CoffeeScript in the browser, but also works in Node and Rhino via the <a href="#node">RequireJS adapter</a>.</p>
+<p>Load files written in CoffeeScript. Includes a version of CoffeeScript, only this one file is needed. With this plugin, it is easy to code in CoffeeScript in the browser, it can participate in the optimizer optimizations, and it works in Node and Rhino via the <a href="#node">RequireJS adapter</a>. This is the best way to do cross-environment, modular CoffeeScript. <a href="https://github.com/jrburke/require-cs/">The project home</a> has more information on how to use it.</p>
</div>
<div class="subSection">
<h4 class="hbox">
<a name="i18n">i18n</a>
<span class="boxFlex"></span>
-<a class="download" href="http://requirejs.org/docs/release/0.23.0/minified/i18n.js">Minified</a>
-<a class="download" href="http://requirejs.org/docs/release/0.23.0/comments/i18n.js">With Comments</a>
+<a class="download" href="http://requirejs.org/docs/release/0.24.0/minified/i18n.js">Minified</a>
+<a class="download" href="http://requirejs.org/docs/release/0.24.0/comments/i18n.js">With Comments</a>
</h4>
<p><a href="api.html#i18n">Load string bundles</a> used in internationalization (i18n) that are made up of separate country/language/locale-specific bundles.</p>
</div>
@@ -148,6 +145,21 @@ <h4 class="hbox">
<div class="section">
<h2><a name="previous">Previous releases</a><span class="sectionMark">&sect; 3</span></h2>
+<h3>0.23.0</h3>
+
+<ul>
+<li>Calculation of baseUrl changed. This affects the jQuery Sample project, which has been updated in this release. Instead of baseUrl defaulting to the directory containing require.js, it now defaults to the HTML page's directory. If data-main is used, then the directory used in that attribute becomes the baseUrl. Explicitly setting baseUrl in the configuration overrides the aforementioned defaults.</li>
+<li>The RequireJS optimizer now uses Node by default. So, build.sh/.bat are now Node-based. Java/Rhino is still supported via the buildj.sh/.bat scripts.</li>
+<li><a href="https://github.com/mishoo/UglifyJS">UglifyJS</a> is now the default minifier for the optimizer, since it works both in Node and in Rhino. However, UglifyJS does not do if/else dead code removal, so the <a href="optimization.html#hasjs">has() optimization</a> is not that great when using UglifyJS. Hopefully this will change in a future version of UglifyJS. If you want the full has() optimization, Closure Compiler can still be used, either by using buildj.sh to use Java/Rhino to do the optimization work, or by running Closure Compiler yourself after the optimizer runs.</li>
+<li>The behavior of the Node adapter, r.js has changed. It now assumes that any module found via the RequireJS config uses define() to define modules. If a module is not found via the RequireJS path config, r.js uses Node's native require() function and its pathing rules
+to find the module. This allows the most compatible use of npm-installed modules. However it means you <strong>should not</strong> include RequireJS configuration for npm-installed modules/packages.</li>
+<li>The r.js adapter now works in Node and Rhino.</li>
+<li>The config option, <strong>baseUrlMatch</strong> has been removed, since the data-main baseUrl rule mentioned above removes the need for it.</li>
+<li>Some important fixes around loader plugins: a fix to allow multiple modules to use the same plugin resources as a common dependency, and to allow loader plugins that use a define() function callback to work in the optimizer.</li>
+<li>A fix for the use of jQuery's readyWait capability when jQuery is detected and used as a module.</li>
+<li>Some directory shuffling related to making the rhino and node adapters the same for use in command line tools and in the r.js adapter.</li>
+</ul>
+
<h3>0.22.0</h3>
<ul>
View
@@ -1,5 +1,5 @@
/** vim: et:ts=4:sw=4:sts=4
- * @license RequireJS 0.23.0+ Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
+ * @license RequireJS 0.24.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/requirejs for details
*/
@@ -11,7 +11,7 @@
var require, define;
(function () {
//Change this version number for each release.
- var version = "0.23.0+",
+ var version = "0.24.0",
commentRegExp = /(\/\*([\s\S]*?)\*\/|\/\/(.*)$)/mg,
cjsRequireRegExp = /require\(["']([^'"\s]+)["']\)/g,
currDirRegExp = /^\.\//,
View
@@ -1,13 +1,5 @@
-Release Notes 0.24
+Release Notes
-------------------
-* jQuery 1.5.1 included in sample project.
-* No more bundled RequireJS and jQuery file, easier to swap out jQuery.
-* Plugins are no longer bundled with require.js or in sample jQuery project, separate download of each.
-* CoffeeScript plugin?
-
-- Prep work for CoffeeScript plugin release, update download links in the download.html file.
-
-- Test on windows node, build in cygwin.
Next release
--------------

0 comments on commit 1da7d82

Please sign in to comment.