Skip to content

Commit

Permalink
[v3.0] Change default for systemNullSetters (#4649)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Oct 7, 2022
1 parent 5812006 commit b33513c
Show file tree
Hide file tree
Showing 91 changed files with 118 additions and 92 deletions.
2 changes: 1 addition & 1 deletion cli/help.md
Expand Up @@ -64,7 +64,7 @@ Basic options:
--no-stdin Do not read "-" from stdin
--no-strict Don't emit `"use strict";` in the generated modules
--strictDeprecations Throw errors for deprecated features
--systemNullSetters Replace empty SystemJS setters with `null`
--no-systemNullSetters Do not replace empty SystemJS setters with `null`
--no-treeshake Disable tree-shaking optimisations
--no-treeshake.annotations Ignore pure call annotations
--no-treeshake.moduleSideEffects Assume modules have no side-effects
Expand Down
2 changes: 1 addition & 1 deletion docs/01-command-line-reference.md
Expand Up @@ -395,7 +395,7 @@ Many options have command line equivalents. In those cases, any arguments passed
--no-stdin Do not read "-" from stdin
--no-strict Don't emit `"use strict";` in the generated modules
--strictDeprecations Throw errors for deprecated features
--systemNullSetters Replace empty SystemJS setters with `null`
--no-systemNullSetters Do not replace empty SystemJS setters with `null`
--no-treeshake Disable tree-shaking optimisations
--no-treeshake.annotations Ignore pure call annotations
--no-treeshake.moduleSideEffects Assume modules have no side-effects
Expand Down
4 changes: 2 additions & 2 deletions docs/999-big-list-of-options.md
Expand Up @@ -1558,9 +1558,9 @@ Whether to include the 'use strict' pragma at the top of generated non-ES bundle
#### output.systemNullSetters
Type: `boolean`<br> CLI: `--systemNullSetters`/`--no-systemNullSetters`<br> Default: `false`
Type: `boolean`<br> CLI: `--systemNullSetters`/`--no-systemNullSetters`<br> Default: `true`
When outputting the `system` module format, this will replace empty setter functions with `null` as an output simplification. This is _only supported in SystemJS 6.3.3 and above_.
When outputting the `system` module format, by default, empty setter functions are replaced with `null` as an output simplification. This is incompatible with SystemJS before v6.3.3. Deactivate this option to output empty functions instead that older SystemJS versions support.
#### preserveSymlinks
Expand Down
2 changes: 1 addition & 1 deletion src/utils/options/normalizeOutputOptions.ts
Expand Up @@ -84,7 +84,7 @@ export function normalizeOutputOptions(
| SourcemapPathTransformOption
| undefined,
strict: config.strict ?? true,
systemNullSetters: config.systemNullSetters || false,
systemNullSetters: config.systemNullSetters ?? true,
validate: config.validate || false
};

Expand Down
Expand Up @@ -5,7 +5,7 @@ System.register(['./generated-shared2.js', './generated-dep1.js', './generated-d
setters: [function (module) {
x = module.x;
y = module.y;
}, function () {}, function () {}],
}, null, null],
execute: (function () {

console.log(x + y);
Expand Down
@@ -1,7 +1,7 @@
System.register(['./generated-shared2.js', './generated-dep1.js', './generated-dep2.js'], (function () {
'use strict';
return {
setters: [function () {}, function () {}, function () {}],
setters: [null, null, null],
execute: (function () {


Expand Down
@@ -1,7 +1,7 @@
System.register(['./generated-dep1.js'], (function () {
'use strict';
return {
setters: [function () {}],
setters: [null],
execute: (function () {


Expand Down
@@ -1,7 +1,7 @@
System.register(['./generated-dep2.js'], (function () {
'use strict';
return {
setters: [function () {}],
setters: [null],
execute: (function () {


Expand Down
@@ -1,7 +1,7 @@
System.register(['./generated-dep111.js', './generated-dep112.js'], (function () {
'use strict';
return {
setters: [function () {}, function () {}],
setters: [null, null],
execute: (function () {

console.log('11');
Expand Down
Expand Up @@ -2,9 +2,9 @@ System.register(['./generated-dep11.js', './generated-dep112.js', './generated-d
'use strict';
var x;
return {
setters: [function () {}, function (module) {
setters: [null, function (module) {
x = module.x;
}, function () {}],
}, null],
execute: (function () {

console.log('1');
Expand Down
@@ -1,7 +1,7 @@
System.register(['./generated-dep11.js', './generated-dep111.js', './generated-dep112.js'], (function () {
'use strict';
return {
setters: [function () {}, function () {}, function () {}],
setters: [null, null, null],
execute: (function () {


Expand Down
@@ -1,7 +1,7 @@
System.register(['./generated-dep111.js'], (function () {
'use strict';
return {
setters: [function () {}],
setters: [null],
execute: (function () {


Expand Down
@@ -1,7 +1,7 @@
System.register(['./generated-dep112.js'], (function () {
'use strict';
return {
setters: [function () {}],
setters: [null],
execute: (function () {


Expand Down
@@ -1,7 +1,7 @@
System.register(['./generated-lib.js'], (function () {
'use strict';
return {
setters: [function () {}],
setters: [null],
execute: (function () {

console.log('dep2');
Expand Down
@@ -1,7 +1,7 @@
System.register(['external'], (function () {
'use strict';
return {
setters: [function () {}],
setters: [null],
execute: (function () {

console.log('dep');
Expand Down
@@ -1,7 +1,7 @@
System.register(['./generated-dep.js', 'external'], (function (exports) {
'use strict';
return {
setters: [function () {}, function (module) {
setters: [null, function (module) {
exports('dep', module.asdf);
}],
execute: (function () {
Expand Down
@@ -1,7 +1,7 @@
System.register(['./generated-dep.js', 'external'], (function (exports) {
'use strict';
return {
setters: [function () {}, function (module) {
setters: [null, function (module) {
exports('dep', module.asdf);
}],
execute: (function () {
Expand Down
@@ -1,7 +1,7 @@
System.register(['starexternal2', 'external2'], (function (exports) {
'use strict';
return {
setters: [function () {}, function () {}],
setters: [null, null],
execute: (function () {

var dep = exports('d', 'dep');
Expand Down
Expand Up @@ -17,7 +17,7 @@ System.register(['starexternal1', 'external1', './generated-dep.js', 'starextern
exports('e', module.e);
}, function (module) {
exports('dep', module.d);
}, function () {}, function () {}],
}, null, null],
execute: (function () {

var main = exports('main', '1');
Expand Down
Expand Up @@ -3,7 +3,7 @@ System.register(['./generated-lib1.js', './generated-lib2.js'], (function (expor
return {
setters: [function (module) {
exports('lib1', module.l);
}, function () {}],
}, null],
execute: (function () {


Expand Down
Expand Up @@ -3,7 +3,7 @@ System.register(['./generated-lib1.js', './generated-lib2.js'], (function (expor
return {
setters: [function (module) {
exports('lib1', module.l);
}, function () {}],
}, null],
execute: (function () {


Expand Down
@@ -1,7 +1,7 @@
System.register(['./generated-emptyTransformed.js'], (function () {
'use strict';
return {
setters: [function () {}],
setters: [null],
execute: (function () {

console.log('main1');
Expand Down
@@ -1,7 +1,7 @@
System.register(['./generated-emptyTransformed.js'], (function () {
'use strict';
return {
setters: [function () {}],
setters: [null],
execute: (function () {

console.log('main2');
Expand Down
@@ -1,7 +1,7 @@
System.register(['./main.js'], (function () {
'use strict';
return {
setters: [function () {}],
setters: [null],
execute: (function () {


Expand Down
@@ -1,7 +1,7 @@
System.register(['./main.js'], (function () {
'use strict';
return {
setters: [function () {}],
setters: [null],
execute: (function () {


Expand Down
@@ -1,7 +1,7 @@
System.register(['./generated-manual-inner.js'], (function () {
'use strict';
return {
setters: [function () {}],
setters: [null],
execute: (function () {

console.log('middle');
Expand Down
@@ -1,7 +1,7 @@
System.register(['./generated-manual-middle.js'], (function () {
'use strict';
return {
setters: [function () {}],
setters: [null],
execute: (function () {

console.log('outer');
Expand Down
@@ -1,7 +1,7 @@
System.register(['./generated-manual-outer.js', './generated-manual-middle.js', './generated-manual-inner.js'], (function () {
'use strict';
return {
setters: [function () {}, function () {}, function () {}],
setters: [null, null, null],
execute: (function () {

console.log('main');
Expand Down
@@ -1,7 +1,7 @@
System.register(['./generated-chunk-b.js'], (function () {
'use strict';
return {
setters: [function () {}],
setters: [null],
execute: (function () {

console.log('dep-c');
Expand Down
@@ -1,7 +1,7 @@
System.register(['./generated-chunk-c.js', './generated-chunk-b.js'], (function () {
'use strict';
return {
setters: [function () {}, function () {}],
setters: [null, null],
execute: (function () {

console.log('dep1');
Expand Down
@@ -1,7 +1,7 @@
System.register(['./generated-manual.js'], (function () {
'use strict';
return {
setters: [function () {}],
setters: [null],
execute: (function () {

console.log('main');
Expand Down
Expand Up @@ -5,7 +5,7 @@ System.register(['./generated-deps2and3.js', './generated-lib1.js'], (function (
setters: [function (module) {
fn$1 = module.f;
fn$2 = module.a;
}, function () {}],
}, null],
execute: (function () {

function fn () {
Expand Down
Expand Up @@ -4,7 +4,7 @@ System.register(['external', './other.js', './_virtual/other.js'], (function (ex
return {
setters: [function (module) {
require$$0 = module.default;
}, function () {}, function (module) {
}, null, function (module) {
other = module.__exports;
}],
execute: (function () {
Expand Down
Expand Up @@ -3,7 +3,7 @@ System.register(['./inner/more_inner/something.js', './inner/some_effect.js'], (
return {
setters: [function (module) {
exports('Something', module.Something);
}, function () {}],
}, null],
execute: (function () {


Expand Down
@@ -1,7 +1,7 @@
System.register(['./generated-main.js'], (function () {
'use strict';
return {
setters: [function () {}],
setters: [null],
execute: (function () {


Expand Down
@@ -1,7 +1,7 @@
System.register(['./generated-separate.js'], (function (exports, module) {
'use strict';
return {
setters: [function () {}],
setters: [null],
execute: (function () {

var inlined$1 = 'inlined';
Expand Down
@@ -1,7 +1,7 @@
System.register(['./generated-name.js', './generated-firstName.js', './generated-name2.js', './mainChunk.js'], (function () {
'use strict';
return {
setters: [function () {}, function () {}, function () {}, function () {}],
setters: [null, null, null, null],
execute: (function () {


Expand Down
@@ -1,7 +1,7 @@
System.register(['./generated-emptyTransformed.js'], (function () {
'use strict';
return {
setters: [function () {}],
setters: [null],
execute: (function () {

console.log('main1');
Expand Down
@@ -1,7 +1,7 @@
System.register(['./generated-emptyTransformed.js'], (function () {
'use strict';
return {
setters: [function () {}],
setters: [null],
execute: (function () {

console.log('main2');
Expand Down
Expand Up @@ -4,7 +4,7 @@ System.register(['./generated-m1.js', './m2.js'], (function () {
return {
setters: [function (module) {
ms = module.m;
}, function () {}],
}, null],
execute: (function () {

console.log(ms);
Expand Down
@@ -1,7 +1,7 @@
System.register(['./dep-626bb5df3105f7.js'], (function () {
'use strict';
return {
setters: [function () {}],
setters: [null],
execute: (function () {

console.log('main1');
Expand Down
@@ -1,7 +1,7 @@
System.register(['./dep-626bb5df3105f7.js'], (function () {
'use strict';
return {
setters: [function () {}],
setters: [null],
execute: (function () {

console.log('main2');
Expand Down
@@ -1,7 +1,7 @@
System.register(['./generated-shared.js', './generated-dep.js'], (function () {
'use strict';
return {
setters: [function () {}, function () {}],
setters: [null, null],
execute: (function () {

console.log('main1');
Expand Down

0 comments on commit b33513c

Please sign in to comment.