autoprefixer-rails 9.8.6.3 → 10.4.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cceb0d96d5300da9f5eb5143e92e983155d2443e2a197d075ace21ddb27e4249
4
- data.tar.gz: ef105b9dd600eddd88f3cbd1c65a31a1d134f26aaa5e00afb8adec9652990dd0
3
+ metadata.gz: 57c218760a92a4c4449c643e59d5c9b99d187c228aaa68c563d03c468fc2a055
4
+ data.tar.gz: fa282be312c5ad55816deb7475a3d2f3357266a806ac96a624f125f2f0d0fc4b
5
5
  SHA512:
6
- metadata.gz: de40aec8323df0618d786e630ef2cbfbc7274e45c51961f3efab57666b5403d59059d4cf4082330eac398c28fb3b9dd7a0daefb17769252b2b4d67745167137a
7
- data.tar.gz: 443269aef43c26cda2476a727c153a793e10bb6d5837de2b228f6b9e232fecd264e7281bdd5e29023b5ac6c00f9bcde51f3335b4ad32bebf8d5887842b61bc0d
6
+ metadata.gz: f20ccf58b1661fe3082f9d0487979c42146b21115df430269ca6d7a3a35dfa2f44cb04c1f4f3eb01eaf00bd360f4823d00106101c38bb80a8c278e4d9b764ed4
7
+ data.tar.gz: beb69b97fb7f92d970fae59bfefff484b1f59973bfcf26b049ecbc738a61db9044e660040531b0f959cb50f17f6ec5412ee8b1f226ba30b0cec359e902ac9bfa
data/CHANGELOG.md CHANGED
@@ -1,5 +1,87 @@
1
1
  # Change Log
2
2
 
3
+ ## 10.4.2.0
4
+ * Fixed missed `-webkit-` prefix for `width: stretch`.
5
+ * Fixed `::file-selector-button` data (by Luke Warlow).
6
+ * Ensure sprockets-rails is loaded before autoprefixer-rails (by Thomas Morgan)
7
+
8
+ ## 10.4.0.0
9
+ * Added `:autofill` support (by Luke Warlow).
10
+
11
+ ## 10.3.3.0
12
+ * Fixed `::file-selector-button` support (by Usman Yunusov).
13
+ * Fixed wrong `-moz-` prefix from `::file-selector-button` (by Usman Yunusov).
14
+
15
+ ## 10.3.1.0
16
+ * Added `::file-selector-button` support (by Luke Warlow).
17
+ * Fixed adding wrong prefixes to `content` (by Luke Warlow).
18
+ * Fix `ReferenceError: Can't find variable: URL` (#213)
19
+
20
+ ## 10.2.5.1
21
+ * Remove nodejs version check via ExecJS, to be compatible with 2.8.1 (#203)
22
+
23
+ ## 10.2.5.0
24
+ * Fixed `:` support in `@supports` (by Dmitry Semigradsky).
25
+ * Update Can I Use data.
26
+ * Lock to execjs < 2.8.0 for now (#203)
27
+
28
+ ## 10.2.4.0
29
+ * Fixed `transition-property` warnings (by @Sheraff).
30
+
31
+ ## 10.2.0.0 "Sub rosa"
32
+ * Added TypeScript definitions (by Dmitry Semigradsky).
33
+ * Fixed docs (by Florian Pellet).
34
+ * Update Can I Use data.
35
+ * Update postcss to 8.2.2
36
+
37
+ ## 10.1.0.0 "Pula"
38
+ * Fixed `Cannot read property 'proxyOf' of undefined` error (by Igor Kamyshev).
39
+ * Added `dpcm` unit support to `min-resolution: 2dppx` (by Robert Eisele).
40
+ * Fixed rational approximation in `min-resolution` (by Robert Eisele).
41
+
42
+ ## 10.0.3.0
43
+ * Fixed `substract` to `subtract` value for `mask-composite` (by Michelle Enos).
44
+ * Update Can I Use data
45
+
46
+ ## 10.0.2.0
47
+ * Removed -ms-user-select: all because IE and old Edge don’t support it.
48
+ * Fixed Grid Layout warning.
49
+ * Update Can I Use data
50
+
51
+ ## 10.0.1.3
52
+ * Fix `fileURL.replace is not a function` when reporting warnings (#194)
53
+
54
+ ## 10.0.1.2
55
+ * Workaround `existsSync not a function` (#193)
56
+
57
+ ## 10.0.1.1
58
+ * Update Can I Use data.
59
+ * Update postcss to 8.1.4
60
+ * Fix issue with source map (#190)
61
+
62
+ ## 10.0.1.0
63
+ * Update Can I Use data.
64
+ * Update autoprefixer to 10.0.1
65
+ * Update postcss to 8.1.1
66
+
67
+ ## 10.0.0.2
68
+ * Update postcss to 8.0.5
69
+ * Update browserslist & caniuse-lite
70
+
71
+ ## 10.0.0.1
72
+ * Improved error message for old environments.
73
+ * Reduced gem file size.
74
+
75
+ ## 10.0 “Alis volat propriis”
76
+ * Removed support for Node.js 6.x, 8.x, 11.x.
77
+ * Moved to PostCSS 8.
78
+
79
+ ## 9.8.6.5
80
+ * Fix `9.8.6.4` regression.
81
+
82
+ ## 9.8.6.4
83
+ * Remove deprecation warnings.
84
+
3
85
  ## 9.8.6.3
4
86
  * Fix deprecation warning for non-Rails environment.
5
87
 
data/README.md CHANGED
@@ -4,8 +4,6 @@
4
4
  src="http://postcss.github.io/autoprefixer/logo.svg"
5
5
  title="Autoprefixer logo by Anton Lovchikov">
6
6
 
7
- **DEPRECATED. [Migration Guide.]**
8
-
9
7
  [Autoprefixer] is a tool to parse CSS and add vendor prefixes to CSS rules
10
8
  using values from the [Can I Use] database. This gem provides Ruby
11
9
  and Ruby on Rails integration with this JavaScript tool.
@@ -14,7 +12,6 @@ and Ruby on Rails integration with this JavaScript tool.
14
12
  <img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg" alt="Sponsored by Evil Martians" width="236" height="54">
15
13
  </a>
16
14
 
17
- [Migration Guide.]: https://github.com/ai/autoprefixer-rails/wiki/Deprecated
18
15
  [Autoprefixer]: https://github.com/postcss/autoprefixer
19
16
  [Can I Use]: http://caniuse.com/
20
17
  [PostCSS]: https://postcss.org/
@@ -36,8 +33,8 @@ Windows users should install [Node.js]. Autoprefixer Rails doesn’t work with
36
33
  old JScript in Windows.
37
34
 
38
35
  Autoprefixer Rails uses [ExecJS] that will use the best available JavaScript
39
- runtime. Currently this gem is tested to work with Node.js version 6 and up and
40
- with [mini_racer], but will not work with [therubyracer].
36
+ runtime. Currently this gem is tested to work with Node.js version 10 and up
37
+ and with [mini_racer], but will not work with [therubyracer].
41
38
 
42
39
  [Node.js]: http://nodejs.org/
43
40
  [ExecJS]: https://github.com/rails/execjs
@@ -7,21 +7,10 @@ require "json"
7
7
  IS_SECTION = /^\s*\[(.+)\]\s*$/.freeze
8
8
 
9
9
  module AutoprefixerRails
10
- def self.show_deprecation_message!
11
- return unless defined?(ActiveSupport::Deprecation)
12
-
13
- return if defined?(@deprecation_shown)
14
-
15
- ActiveSupport::Deprecation.warn(
16
- "autoprefixer-rails was deprected. Migration guide:\n" \
17
- "https://github.com/ai/autoprefixer-rails/wiki/Deprecated"
18
- )
19
-
20
- @deprecation_shown = true
21
- end
22
-
23
10
  # Ruby to JS wrapper for Autoprefixer processor instance
24
11
  class Processor
12
+ SUPPORTED_RUNTIMES = [ExecJS::Runtimes::Node, ExecJS::Runtimes::MiniRacer]
13
+
25
14
  def initialize(params = {})
26
15
  @params = params || {}
27
16
  end
@@ -33,15 +22,8 @@ module AutoprefixerRails
33
22
  # * `to` with output CSS file name.
34
23
  # * `map` with true to generate new source map or with previous map.
35
24
  def process(css, opts = {})
36
- AutoprefixerRails.show_deprecation_message!
37
-
38
25
  opts = convert_options(opts)
39
26
 
40
- apply_wrapper =
41
- "(function(opts, pluginOpts) {" \
42
- "return eval(process.apply(this, opts, pluginOpts));" \
43
- "})"
44
-
45
27
  plugin_opts = params_with_browsers(opts[:from]).merge(opts)
46
28
  process_opts = {
47
29
  from: plugin_opts.delete(:from),
@@ -50,10 +32,10 @@ module AutoprefixerRails
50
32
  }
51
33
 
52
34
  begin
53
- result = runtime.call(apply_wrapper, [css, process_opts, plugin_opts])
35
+ result = runtime.call("autoprefixer.process", css, process_opts, plugin_opts)
54
36
  rescue ExecJS::ProgramError => e
55
37
  contry_error = "BrowserslistError: " \
56
- "Country statistics is not supported " \
38
+ "Country statistics are not supported " \
57
39
  "in client-side build of Browserslist"
58
40
  if e.message == contry_error
59
41
  raise "Country statistics is not supported in AutoprefixerRails. " \
@@ -68,7 +50,7 @@ module AutoprefixerRails
68
50
 
69
51
  # Return, which browsers and prefixes will be used
70
52
  def info
71
- runtime.eval("autoprefixer(#{js_params}).info()")
53
+ runtime.call("autoprefixer.info", params_with_browsers)
72
54
  end
73
55
 
74
56
  # Parse Browserslist config
@@ -113,13 +95,6 @@ module AutoprefixerRails
113
95
  params
114
96
  end
115
97
 
116
- # Convert params to JS string and add browsers from Browserslist config
117
- def js_params
118
- "{ " +
119
- params_with_browsers.map { |k, v| "#{k}: #{v.inspect}" }.join(", ") +
120
- " }"
121
- end
122
-
123
98
  # Convert ruby_options to jsOptions
124
99
  def convert_options(opts)
125
100
  converted = {}
@@ -155,55 +130,36 @@ module AutoprefixerRails
155
130
  # Lazy load for JS library
156
131
  def runtime
157
132
  @runtime ||= begin
158
- if ExecJS.eval("typeof Uint8Array") != "function"
159
- if ExecJS.runtime.name.start_with?("therubyracer")
160
- raise "ExecJS::RubyRacerRuntime is not supported. " \
161
- "Please replace therubyracer with mini_racer " \
162
- "in your Gemfile or use Node.js as ExecJS runtime."
163
- else
164
- raise "#{ExecJS.runtime.name} runtime does’t support ES6. " \
165
- "Please update or replace your current ExecJS runtime."
166
- end
167
- end
168
-
169
- if ExecJS.runtime == ExecJS::Runtimes::Node
170
- version = ExecJS.runtime.eval("process.version")
171
- first = version.match(/^v(\d+)/)[1].to_i
172
- raise "Autoprefixer doesn’t support Node #{version}. Update it." if first < 6
173
- end
174
-
175
133
  ExecJS.compile(build_js)
134
+ rescue ExecJS::RuntimeError
135
+ # Only complain about unsupported runtimes when it failed to parse our script.
136
+
137
+ case ExecJS.runtime
138
+ when ExecJS::Runtimes::Node
139
+ node_command = ExecJS.runtime.send(:binary) rescue "Unknown"
140
+
141
+ raise <<~MSG
142
+ Your nodejs binary failed to load autoprefixer script file,
143
+ please check if you're running a supported version (10, 12, 14+)
144
+
145
+ ENV["PATH"] = #{ENV["PATH"]}
146
+ binary = #{node_command}
147
+ MSG
148
+ when *SUPPORTED_RUNTIMES
149
+ raise
150
+ else
151
+ raise <<~MSG
152
+ Your ExecJS runtime #{ExecJS.runtime.name} isn't supported by autoprefixer-rails,
153
+ please switch to #{SUPPORTED_RUNTIMES.map(&:name).join(' or ')}
154
+ MSG
155
+ end
176
156
  end
177
157
  end
178
158
 
179
- # Cache autoprefixer.js content
180
- def read_js
181
- @read_js ||= begin
182
- root = Pathname(File.dirname(__FILE__))
183
- path = root.join("../../vendor/autoprefixer.js")
184
- path.read
185
- end
186
- end
187
-
188
- # Return processor JS with some extra methods
189
159
  def build_js
190
- "var global = this;" + read_js + process_proxy
191
- end
192
-
193
- # Return JS code for process method proxy
194
- def process_proxy
195
- <<-JS
196
- var processor;
197
- var process = function() {
198
- var result = autoprefixer.process.apply(autoprefixer, arguments);
199
- var warns = result.warnings().map(function (i) {
200
- delete i.plugin;
201
- return i.toString();
202
- });
203
- var map = result.map ? result.map.toString() : null;
204
- return { css: result.css, map: map, warnings: warns };
205
- };
206
- JS
160
+ root = Pathname(File.dirname(__FILE__))
161
+ path = root.join("../../vendor/autoprefixer.js")
162
+ path.read
207
163
  end
208
164
  end
209
165
  end
@@ -1,6 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "yaml"
4
+ begin
5
+ require "sprockets/railtie"
6
+ rescue LoadError
7
+ end
4
8
 
5
9
  begin
6
10
  module AutoprefixedRails
@@ -57,7 +57,7 @@ module AutoprefixerRails
57
57
  end
58
58
 
59
59
  # Sprockets 2 API new and render
60
- def render(_, _)
60
+ def render(*)
61
61
  self.class.run(@filename, @source)
62
62
  end
63
63
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AutoprefixerRails # :nodoc:
4
- VERSION = "9.8.6.3" unless defined? AutoprefixerRails::VERSION
4
+ VERSION = "10.4.2.0" unless defined? AutoprefixerRails::VERSION
5
5
  end