Skip to content

Commit f9f0675

Browse files
authored
Merge pull request #50 from ahorek/terser5270
update terser to 5.27.0
2 parents 9186a10 + 0c98b42 commit f9f0675

File tree

13 files changed

+80
-253
lines changed

13 files changed

+80
-253
lines changed

.github/workflows/ruby.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ jobs:
1616
fail-fast: true
1717
matrix:
1818
include:
19-
- { ruby: 2.7, c-o-e: false }
2019
- { ruby: '3.0', c-o-e: false }
2120
- { ruby: 3.1, c-o-e: false }
2221
- { ruby: 3.2, c-o-e: false }
22+
- { ruby: 3.3, c-o-e: false }
2323
- { ruby: jruby-9.4.5.0, c-o-e: false }
2424
- { ruby: ruby-head, c-o-e: true }
2525
- { ruby: jruby-head, c-o-e: true }
2626
- { ruby: truffleruby, c-o-e: true }
2727
- { ruby: truffleruby-head, c-o-e: true }
28-
- { ruby: 3.2, gemfile: ./gemfiles/miniracer, c-o-e: false }
28+
- { ruby: 3.3, gemfile: ./gemfiles/miniracer, c-o-e: false }
2929
steps:
3030
- uses: actions/checkout@v3
3131
- name: Set up Ruby

.rubocop.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,48 @@ Style/RedundantStringEscape: # new in 1.37
310310
Enabled: true
311311
Style/SelectByRegexp: # new in 1.22
312312
Enabled: true
313+
Lint/DuplicateMatchPattern: # new in 1.50
314+
Enabled: true
315+
Lint/ItWithoutArgumentsInBlock: # new in 1.59
316+
Enabled: true
317+
Lint/LiteralAssignmentInCondition: # new in 1.58
318+
Enabled: true
319+
Lint/MixedCaseRange: # new in 1.53
320+
Enabled: true
321+
Lint/RedundantRegexpQuantifiers: # new in 1.53
322+
Enabled: true
323+
Metrics/CollectionLiteralLength: # new in 1.47
324+
Enabled: true
325+
Style/DataInheritance: # new in 1.49
326+
Enabled: true
327+
Style/DirEmpty: # new in 1.48
328+
Enabled: true
329+
Style/ExactRegexpMatch: # new in 1.51
330+
Enabled: true
331+
Style/FileEmpty: # new in 1.48
332+
Enabled: true
333+
Style/RedundantArrayConstructor: # new in 1.52
334+
Enabled: true
335+
Style/RedundantCurrentDirectoryInPath: # new in 1.53
336+
Enabled: true
337+
Style/RedundantFilterChain: # new in 1.52
338+
Enabled: true
339+
Style/RedundantLineContinuation: # new in 1.49
340+
Enabled: true
341+
Style/RedundantRegexpArgument: # new in 1.53
342+
Enabled: true
343+
Style/RedundantRegexpConstructor: # new in 1.52
344+
Enabled: true
345+
Style/ReturnNilInPredicateMethodDefinition: # new in 1.53
346+
Enabled: true
347+
Style/SingleLineDoEndBlock: # new in 1.57
348+
Enabled: true
349+
Style/SuperWithArgsParentheses: # new in 1.58
350+
Enabled: true
351+
Style/YAMLFileRead: # new in 1.53
352+
Enabled: true
353+
Performance/MapMethodChain: # new in 1.19
354+
Enabled: true
313355

314356
Performance/AncestorsInclude:
315357
Enabled: true

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
## Unreleased
2+
## 1.2.0 (22 January 2024)
3+
- update TerserJS to [5.27.0]
4+
- remove sourcemap patches
5+
- `pure_new` option added
6+
- EOL rubies are no longer tested
7+
- update rubocop
8+
29
## 1.1.20 (27 November 2023)
310
- update TerserJS to [5.24.0]
411
- fix mangle properties, thanks @khaitu!

Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ source "https://rubygems.org"
44

55
gemspec
66

7-
unless RUBY_VERSION < '2.6'
7+
unless RUBY_VERSION < '2.7'
88
group :development do
9-
gem 'rubocop', '~> 1.46.0'
10-
gem 'rubocop-performance', '~> 1.16.0', :require => false
9+
gem 'rubocop', '~> 1.60.1'
10+
gem 'rubocop-performance', '~> 1.20.2', :require => false
1111
end
1212
end

Rakefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ namespace :terser do
5454

5555
cd 'vendor/terser/' do
5656
FileUtils.rm_rf("package-lock.json")
57-
`patch -p1 -i ../../patches/terser-sync.patch`
58-
`patch -p1 -i ../../patches/revert-source-maps.patch`
5957
`npm install --no-package-lock --no-save`
6058
end
6159

lib/terser.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/terser.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ class Error < StandardError; end
7979
:negate_iife => true, # Negate immediately invoked function expressions to avoid extra parens
8080
:pure_getters => false, # Assume that object property access does not have any side-effects
8181
:pure_funcs => nil, # List of functions without side-effects. Can safely discard function calls when the result value is not used
82+
:pure_new => false, # List of functions without side-effects. Can safely discard function calls when the result value is not used
8283
:drop_console => false, # Drop calls to console.* functions
8384
:keep_fargs => false, # Preserve unused function arguments
8485
:keep_classnames => false, # Prevents discarding or mangling of class names. Pass a regular expression to only keep class names matching that regex.

lib/terser/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
class Terser
44
# Current version of Terser.
5-
VERSION = "1.1.20"
5+
VERSION = "1.2.0"
66
end

lib/terser_wrapper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function terser_wrapper(options) {
4949
inputs[inputFilename] = source;
5050

5151
try {
52-
return Terser.minifySync(inputs, options, null);
52+
return Terser.minify_sync(inputs, options, null);
5353
} catch (error) {
5454
const { message, filename, line, col, pos } = error;
5555
return {error: {message: message, filename: filename, line: line, col: col, pos: pos}}

patches/revert-source-maps.patch

Lines changed: 0 additions & 205 deletions
This file was deleted.

0 commit comments

Comments
 (0)