Skip to content

Commit

Permalink
remove es5 support from js generator (#12033)
Browse files Browse the repository at this point in the history
  • Loading branch information
wing328 authored Apr 3, 2022
1 parent 48d0aa0 commit 224a082
Show file tree
Hide file tree
Showing 21 changed files with 0 additions and 1,822 deletions.
1 change: 0 additions & 1 deletion docs/generators/javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |src|
|useES6|use JavaScript ES6 (ECMAScript 6). Default is ES6. (This option has been deprecated and will be removed in the 5.x release as ES5 is no longer supported)| |true|
|useInheritance|use JavaScript prototype chains & delegation for inheritance| |true|
|usePromises|use Promises as return values from the client API, instead of superagent callbacks| |false|

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,6 @@ public JavascriptClientCodegen() {
.defaultValue(Boolean.TRUE.toString()));
cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC)
.defaultValue(Boolean.TRUE.toString()));
cliOptions.add(new CliOption(USE_ES6,
"use JavaScript ES6 (ECMAScript 6). Default is ES6. (This option has been deprecated and will be removed in the 5.x release as ES5 is no longer supported)")
.defaultValue(Boolean.TRUE.toString()));
cliOptions.add(new CliOption(CodegenConstants.MODEL_PROPERTY_NAMING, CodegenConstants.MODEL_PROPERTY_NAMING_DESC).defaultValue("camelCase"));
cliOptions.add(new CliOption(NPM_REPOSITORY, "Use this property to set an url your private npmRepo in the package.json"));
}
Expand All @@ -226,11 +223,6 @@ public String getHelp() {

@Override
public void processOpts() {
if (additionalProperties.containsKey(USE_ES6)) {
setUseES6(convertPropertyToBooleanAndWriteBack(USE_ES6));
} else {
setUseES6(true); // default to ES6
}
super.processOpts();

if (StringUtils.isEmpty(System.getenv("JS_POST_PROCESS_FILE"))) {
Expand Down Expand Up @@ -455,17 +447,6 @@ public void setNpmRepository(String npmRepository) {
this.npmRepository = npmRepository;
}

public void setUseES6(boolean useES6) {
this.useES6 = useES6;
if (useES6) {
embeddedTemplateDir = templateDir = "Javascript/es6";
LOGGER.info("Using JS ES6 templates");
} else {
embeddedTemplateDir = templateDir = "Javascript";
LOGGER.info("Using JS ES5 templates");
}
}

public void setUseInheritance(boolean useInheritance) {
this.supportsInheritance = useInheritance;
this.supportsMixins = useInheritance;
Expand Down
Loading

0 comments on commit 224a082

Please sign in to comment.