Skip to content

Commit ac4afe3

Browse files
committed
Merge branch 'node-native-esm' (PR #2914)
2 parents 68d1de8 + 62c6ad0 commit ac4afe3

37 files changed

+4376
-210
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ coverage
88
test-treeshake/*-umd.js
99
amd
1010
cjs
11+
/underscore.js
12+
/underscore-min.js
13+
/underscore-min.js.map
14+
/underscore-node-*-pre*

.travis.yml

+10-3
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,22 @@ sudo: false
55
jobs:
66
include:
77
- node_js: 8
8-
env: EXTRA=false
8+
env:
9+
- DOWNGRADE=true
10+
- EXTRA=false
911
- node_js: 10
10-
env: EXTRA=true
12+
env:
13+
- DOWNGRADE=false
14+
- EXTRA=false
1115
- node_js: 14
12-
env: EXTRA=false
16+
env:
17+
- DOWNGRADE=false
18+
- EXTRA=true
1319
before_install:
1420
- npm install -g karma-cli
1521
before_script:
1622
- npm install karma-sauce-launcher
23+
- "[ $DOWNGRADE = false ] || npm install rollup@1"
1724
script:
1825
- npm test
1926
- "[ $EXTRA = false ] || npm run test-browser"

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414

1515
* Use the same coding style as the rest of the [codebase](https://github.com/jashkenas/underscore/blob/master/modules/index.js).
1616

17-
* In your pull request, do not add documentation or re-build the minified `underscore-min.js` file. We'll do those things before cutting a new release.
17+
* In your pull request, do not add documentation or re-build the minified `underscore-umd-min.js` file. We'll do those things before cutting a new release.

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "underscore",
3-
"main": "underscore.js",
3+
"main": "underscore-umd.js",
44
"keywords": ["util", "functional", "server", "client", "browser"],
55
"ignore" : ["docs", "test", "*.yml", "CNAME", "index.html", "favicon.ico", "CONTRIBUTING.md", ".*", "package.json", "karma.*"]
66
}

docs/modules/_setup.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ <h1>_setup.js</h1>
850850

851851
</div>
852852

853-
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">var</span> VERSION = <span class="hljs-string">'1.12.1'</span>;</pre></div></div>
853+
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">var</span> VERSION = <span class="hljs-string">'1.13.0-3'</span>;</pre></div></div>
854854

855855
</li>
856856

docs/modules/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ <h1 id="named-exports">Named Exports</h1>
865865
<div class="pilwrap ">
866866
<a class="pilcrow" href="#section-3">&#182;</a>
867867
</div>
868-
<pre><code>Underscore.js <span class="hljs-number">1.12</span><span class="hljs-number">.1</span>
868+
<pre><code>Underscore.js <span class="hljs-number">1.13</span><span class="hljs-number">.0</span><span class="hljs-number">-3</span>
869869
<span class="hljs-attr">https</span>:<span class="hljs-comment">//underscorejs.org</span>
870870
(c) <span class="hljs-number">2009</span><span class="hljs-number">-2020</span> Jeremy Ashkenas, DocumentCloud and Investigative Reporters &amp; Editors
871871
Underscore may be freely distributed under the MIT license.</code></pre>

docs/underscore-esm.html

+62-62
Large diffs are not rendered by default.

index.html

+94-32
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
<div id="sidebar" class="interface">
187187

188188
<a class="toc_title" href="#">
189-
Underscore.js <span class="version">(1.12.1)</span>
189+
Underscore.js <span class="version">(1.13.0-3)</span>
190190
</a>
191191
<ul class="toc_section">
192192
<li>&raquo; <a href="https://github.com/jashkenas/underscore">GitHub Repository</a></li>
@@ -442,23 +442,20 @@
442442
</p>
443443

444444
<p>
445-
You may choose between monolithic and modular imports. There is a quick
446-
summary of the options below, as well as a more comprehensive
447-
discussion in <a
448-
href="https://juliangonggrijp.com/article/introducing-modular-underscore.html"
449-
>the article</a>.
445+
You may choose between monolithic and modular imports. There is a quick
446+
summary of the options below, as well as a more comprehensive
447+
discussion in <a
448+
href="https://juliangonggrijp.com/article/introducing-modular-underscore.html"
449+
>the article</a>.
450450
</p>
451451

452452
<p>
453-
<i><a
454-
href="https://cdn.statically.io/gh/jashkenas/underscore/1.13.0-1/index.html"
455-
>Prerelease version 1.13.0-1</a> adds full support for native ESM
456-
imports in Node.js version 12 and later. It should do this without
457-
breaking existing setups. Please try it out by installing
453+
<i>Prerelease version 1.13.0-1 adds full support for native ESM imports
454+
in Node.js version 12 and later. It should do this without breaking
455+
existing setups. Please try it out by installing
458456
<tt>underscore@preview</tt> from NPM and let us know whether it worked
459-
for you in <a
460-
href="https://github.com/jashkenas/underscore/pull/2914"
461-
>the pull request</a>!</i>
457+
for you in <a href="https://github.com/jashkenas/underscore/pull/2914">the
458+
pull request</a>!</i>
462459
</p>
463460

464461
<p>
@@ -486,7 +483,7 @@
486483
<i>Underscore is an open-source component of <a href="https://documentcloud.org/">DocumentCloud</a>.</i>
487484
</p>
488485

489-
<h2>v1.12.1 Downloads <i style="padding-left: 12px; font-size:12px;">(Right-click, and use "Save As")</i></h2>
486+
<h2>v1.13.0-3 Downloads <i style="padding-left: 12px; font-size:12px;">(Right-click, and use "Save As")</i></h2>
490487

491488
<table>
492489
<tr>
@@ -504,17 +501,17 @@ <h2>v1.12.1 Downloads <i style="padding-left: 12px; font-size:12px;">(Right-clic
504501
</td>
505502
</tr>
506503
<tr>
507-
<td class="dl-link"><a href="underscore.js">UMD (Development)</a></td>
504+
<td class="dl-link"><a href="underscore-umd.js">UMD (Development)</a></td>
508505
<td>
509506
<i>67.45kb, Uncompressed with Bountiful Comments</i>
510-
&nbsp;<small>(<a href="underscore.js.map">Source Map</a>)</small>
507+
&nbsp;<small>(<a href="underscore-umd.js.map">Source Map</a>)</small>
511508
</td>
512509
</tr>
513510
<tr>
514-
<td class="dl-link"><a href="underscore-min.js">UMD (Production)</a></td>
511+
<td class="dl-link"><a href="underscore-umd-min.js">UMD (Production)</a></td>
515512
<td>
516513
<i>7.39kb, Minified and Gzipped</i>
517-
&nbsp;<small>(<a href="underscore-min.js.map">Source Map</a>)</small>
514+
&nbsp;<small>(<a href="underscore-umd-min.js.map">Source Map</a>)</small>
518515
</td>
519516
</tr>
520517
<tr>
@@ -525,37 +522,37 @@ <h2>v1.12.1 Downloads <i style="padding-left: 12px; font-size:12px;">(Right-clic
525522
<td><i>Unreleased, current <tt>master</tt>, use by your own judgement and at your own risk</i></td>
526523
</tr>
527524
<tr>
528-
<td class="dl-link"><a href="https://raw.github.com/jashkenas/underscore/master/underscore.js">Edge UMD</a></td>
525+
<td class="dl-link"><a href="https://raw.github.com/jashkenas/underscore/master/underscore-umd.js">Edge UMD</a></td>
529526
<td><i>Unreleased, current <tt>master</tt>, use if you’re feeling lucky</i></td>
530527
</tr>
531528
</table>
532529

533-
<h2>v1.12.1 CDN URLs <i style="padding-left: 12px; font-size:12px;">(Use with <tt>&lt;script src="..."&gt;&lt;/script&gt;</tt>)</i></h2>
530+
<h2>v1.13.0-3 CDN URLs <i style="padding-left: 12px; font-size:12px;">(Use with <tt>&lt;script src="..."&gt;&lt;/script&gt;</tt>)</i></h2>
534531

535532
<ul>
536533
<li>
537-
<tt>https://cdn.jsdelivr.net/npm/underscore@1.12.1/underscore-min.js</tt>
534+
<tt>https://cdn.jsdelivr.net/npm/underscore@1.13.0-3/underscore-umd-min.js</tt>
538535
</li>
539536
<li>
540-
<tt>https://cdn.jsdelivr.net/npm/underscore@1.12.1/underscore-esm-min.js</tt>
537+
<tt>https://cdn.jsdelivr.net/npm/underscore@1.13.0-3/underscore-esm-min.js</tt>
541538
</li>
542539
<li>
543-
<tt>https://unpkg.com/underscore@1.12.1/underscore-min.js</tt>
540+
<tt>https://unpkg.com/underscore@1.13.0-3/underscore-umd-min.js</tt>
544541
</li>
545542
<li>
546-
<tt>https://unpkg.com/underscore@1.12.1/underscore-esm-min.js</tt>
543+
<tt>https://unpkg.com/underscore@1.13.0-3/underscore-esm-min.js</tt>
547544
</li>
548545
<li>
549-
<tt>https://pagecdn.io/lib/underscore/1.12.1/underscore-min.js</tt>
546+
<tt>https://pagecdn.io/lib/underscore/1.13.0-3/underscore-umd-min.js</tt>
550547
</li>
551548
<li>
552-
<tt>https://pagecdn.io/lib/underscore/1.12.1/underscore-esm-min.js</tt>
549+
<tt>https://pagecdn.io/lib/underscore/1.13.0-3/underscore-esm-min.js</tt>
553550
</li>
554551
<li>
555-
<tt>https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.12.1/underscore-min.js</tt>
552+
<tt>https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.13.0-3/underscore-umd-min.js</tt>
556553
</li>
557554
<li>
558-
<tt>https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.12.1/underscore-esm-min.js</tt>
555+
<tt>https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.13.0-3/underscore-esm-min.js</tt>
559556
</li>
560557
</ul>
561558

@@ -573,7 +570,7 @@ <h2>Package Installation</h2>
573570
</li>
574571
</ul>
575572

576-
<h2>Monolithic Import</h2>
573+
<h2>Monolithic Import (recommended)</h2>
577574

578575
<ul>
579576
<li>
@@ -586,7 +583,7 @@ <h2>Monolithic Import</h2>
586583
<b>CommonJS</b> <tt>var _ = require('underscore');</tt>
587584
</li>
588585
<li>
589-
<b>ExtendScript</b> <tt>#include "underscore.js"</tt>
586+
<b>ExtendScript</b> <tt>#include "underscore-umd.js"</tt>
590587
</li>
591588
</ul>
592589

@@ -2715,6 +2712,31 @@ <h2 id="notes">Notes</h2>
27152712

27162713
<h2 id="changelog">Change Log</h2>
27172714

2715+
<p id="1.13.0-3">
2716+
<b class="header">1.13.0-3</b> &mdash; <small><i>March 31, 2021</i></small> &mdash; <a href="https://github.com/jashkenas/underscore/compare/1.13.0-2...1.13.0-3">Diff</a> &mdash; <a href="https://cdn.rawgit.com/jashkenas/underscore/1.13.0-3/index.html">Docs</a><br />
2717+
<ul>
2718+
<li>
2719+
Adds a <tt>"module"</tt> exports condition to the
2720+
<tt>package.json</tt>, which should theoretically help to avoid
2721+
duplicate code bundling with <tt>exports</tt>-aware build tools.
2722+
</li>
2723+
<li>
2724+
Re-synchronizes some comments and documentation text with the
2725+
1.12.x branch.
2726+
</li>
2727+
</ul>
2728+
</p>
2729+
2730+
<p id="1.13.0-2">
2731+
<b class="header">1.13.0-2</b> &mdash; <small><i>March 15, 2021</i></small> &mdash; <a href="https://github.com/jashkenas/underscore/compare/1.13.0-1...1.13.0-2">Diff</a> &mdash; <a href="https://cdn.rawgit.com/jashkenas/underscore/1.13.0-2/index.html">Docs</a><br />
2732+
<ul>
2733+
<li>
2734+
Fixes the same security issue in <tt>_.template</tt> as the
2735+
parallel 1.12.1 release.
2736+
</li>
2737+
</ul>
2738+
</p>
2739+
27182740
<p id="1.12.1">
27192741
<b class="header">1.12.1</b> &mdash; <small><i>March 15, 2021</i></small> &mdash; <a href="https://github.com/jashkenas/underscore/compare/1.12.0...1.12.1">Diff</a> &mdash; <a href="https://cdn.statically.io/gh/jashkenas/underscore/1.12.1/index.html">Docs</a><br />
27202742
<ul>
@@ -2728,6 +2750,46 @@ <h2 id="changelog">Change Log</h2>
27282750
href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-23358"
27292751
>CVE-2021-23358</a>
27302752
</li>
2753+
<li>
2754+
Restores an optimization in <tt>_.debounce</tt> that was
2755+
unintentionally lost in version 1.9.0 (same as in parallel preview
2756+
release 1.13.0-0).
2757+
</li>
2758+
<li>
2759+
Various test and documentation enhancements (same as in parallel
2760+
preview releases 1.13.0-0 and 1.13.0-1).
2761+
</li>
2762+
</ul>
2763+
</p>
2764+
2765+
<p id="1.13.0-1">
2766+
<b class="header">1.13.0-1</b> &mdash; <small><i>March 11, 2021</i></small> &mdash; <a href="https://github.com/jashkenas/underscore/compare/1.13.0-0...1.13.0-1">Diff</a> &mdash; <a href="https://cdn.rawgit.com/jashkenas/underscore/1.13.0-1/index.html">Docs</a><br />
2767+
<ul>
2768+
<li>
2769+
Fixes an issue that caused aliases to be absent among the named
2770+
exports in the new native ESM entry point for Node.js 12+.
2771+
</li>
2772+
<li>
2773+
More test and documentation fixes and enhancements.
2774+
</li>
2775+
</ul>
2776+
</p>
2777+
2778+
<p id="1.13.0-0">
2779+
<b class="header">1.13.0-0</b> &mdash; <small><i>March 9, 2021</i></small> &mdash; <a href="https://github.com/jashkenas/underscore/compare/1.12.0...1.13.0-0">Diff</a> &mdash; <a href="https://cdn.rawgit.com/jashkenas/underscore/1.13.0-0/index.html">Docs</a><br />
2780+
<ul>
2781+
<li>
2782+
Adds experimental support for native ESM imports in Node.js. You
2783+
can now also do named imports or even deep module imports directly
2784+
from a Node.js process in Node.js version 12 and later. Monolithic
2785+
imports are recommended for use in production. State (such as
2786+
mixed-in functions) is shared between CommonJS and ESM consumers.
2787+
</li>
2788+
<li>
2789+
Renames the UMD bundle to <tt>underscore-umd.js</tt> for
2790+
consistency with the other bundle names. An alias named
2791+
<tt>underscore.js</tt> is retained for backwards compatibility.
2792+
</li>
27312793
<li>
27322794
Restores an optimization in <tt>_.debounce</tt> that was
27332795
unintentionally lost in version 1.9.0.
@@ -3938,7 +4000,7 @@ <h2 id="changelog">Change Log</h2>
39384000
</div>
39394001

39404002
<!-- Include Underscore, so you can play with it in the console. -->
3941-
<script type="text/javascript" src="underscore.js"></script>
4003+
<script type="text/javascript" src="underscore-umd.js"></script>
39424004
<script type="text/javascript" src="docs/main.js"></script>
39434005

39444006
</body>

karma.conf-sauce.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ module.exports = function(config) {
6363
files: [
6464
'test/vendor/qunit-extras.js',
6565
'test/qunit-setup.js',
66-
'underscore.js',
66+
'underscore-umd.js',
6767
'test/*.js'
6868
],
6969

karma.conf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = function(config) {
1515
// list of files / patterns to load in the browser
1616
files: [
1717
'test/qunit-setup.js',
18-
'underscore.js',
18+
'underscore-umd.js',
1919
'test/*.js'
2020
],
2121

modules/_setup.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Current version.
2-
export var VERSION = '1.12.1';
2+
export var VERSION = '1.13.0-3';
33

44
// Establish the root object, `window` (`self`) in the browser, `global`
55
// on the server, or `this` in some virtual machines. We use `self`

modules/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Named Exports
22
// =============
33

4-
// Underscore.js 1.12.1
4+
// Underscore.js 1.13.0-3
55
// https://underscorejs.org
66
// (c) 2009-2021 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors
77
// Underscore may be freely distributed under the MIT license.

modules/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "module"
3+
}

0 commit comments

Comments
 (0)