opal 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 849fd3ee9a34f471ea70ff0069aedfc41b66471e846b81c59e6fd17370e881a6
4
- data.tar.gz: 71220b09662aef06681fadb4e0841eb110afa4a3e15b14e77de9a6e0666f0564
3
+ metadata.gz: 1c701c29f145e065c4abcaf8ab8884b6c72bc2d4b7f1a4c20dd293e05b4ab824
4
+ data.tar.gz: c42cd06d101ed3cab5b7c116f87bb8de200b1eaacee107228f2cad20a6bde94d
5
5
  SHA512:
6
- metadata.gz: 62c5c2f184630d3fc92ec3792e5022434668d33023b89c36a49e128991a7aeea26d61f7ed7559e57e9def93577a94d784f6308c65a78c3ac83726d50942e3435
7
- data.tar.gz: b7ede6f69220d31c0b8dc0f8350b3699c428d50471ef8d9df47a1a6c9b197116994d1b682681ee37a83b2a0c8547b93e059295c555074a093403ebe9d6ccf84a
6
+ metadata.gz: cb68516917eccc5b981fed3f71b31ddd96378a0bc5d7a56d3d8d0728b80dee4dbe0fb7f00b998e4c85a87cd8a6925268046b817f9741ef015ef17f8d7e18f922
7
+ data.tar.gz: f296bfaa2d953d3b966bda9b6ae3ebff0b43d711c60a4816810adcc091afcec09608a3c7895b156b8267bfac99dd67e93f9868100356939e92bbd9609a715a60
data/CHANGELOG.md CHANGED
@@ -16,7 +16,7 @@ Changes are grouped as follows:
16
16
 
17
17
 
18
18
 
19
- ## [1.6.0](https://github.com/opal/opal/compare/v1.5.1...v1.6.0) - 2022-11-24
19
+ ## [1.6.1](https://github.com/opal/opal/compare/v1.6.0...v1.6.1) - 2022-12-09
20
20
 
21
21
 
22
22
  <!--
@@ -29,6 +29,20 @@ Changes are grouped as follows:
29
29
  ### Fixed
30
30
  -->
31
31
 
32
+ ### Fixed
33
+
34
+ - Fix builder.dup breaking Tilt support ([#2479](https://github.com/opal/opal/pull/2479))
35
+
36
+ ### Changed
37
+
38
+ - Build also opal variants for the CDN: opal/mini.js etc. ([#2489](https://github.com/opal/opal/pull/2489))
39
+
40
+
41
+
42
+
43
+ ## [1.6.0](https://github.com/opal/opal/compare/v1.5.1...v1.6.0) - 2022-11-24
44
+
45
+
32
46
  ### Changed
33
47
 
34
48
  - No longer truncate stacktraces to 15 lines ([#2440](https://github.com/opal/opal/pull/2440))
data/Gemfile CHANGED
@@ -10,6 +10,7 @@ rack_version = ENV['RACK_VERSION']
10
10
  sprockets_version = ENV['SPROCKETS_VERSION']
11
11
 
12
12
  gem 'json', '< 1.8.1', platform: :ruby if ruby_version < v['2.2']
13
+ gem 'psych', '< 5.0.0', platform: :ruby if ruby_version < v['3.2a']
13
14
  gem 'rack-test', '< 0.8' if ruby_version <= v['2.0']
14
15
  gem 'coveralls', platform: :mri
15
16
 
data/UNRELEASED.md CHANGED
@@ -7,4 +7,3 @@
7
7
  ### Performance
8
8
  ### Fixed
9
9
  -->
10
-
data/lib/opal/builder.rb CHANGED
@@ -123,6 +123,7 @@ module Opal
123
123
  @compiler_options = other.compiler_options.dup
124
124
  @missing_require_severity = other.missing_require_severity.to_sym
125
125
  @processed = other.processed.dup
126
+ @scheduler = other.scheduler.dup.tap { |i| i.builder = self }
126
127
  end
127
128
 
128
129
  def to_s
@@ -175,7 +176,7 @@ module Opal
175
176
  attr_reader :processed
176
177
 
177
178
  attr_accessor :processors, :path_reader, :stubs, :prerequired, :preload,
178
- :compiler_options, :missing_require_severity, :cache
179
+ :compiler_options, :missing_require_severity, :cache, :scheduler
179
180
 
180
181
  def esm?
181
182
  @compiler_options[:esm]
@@ -8,7 +8,7 @@ module Opal
8
8
  @builder = builder
9
9
  end
10
10
 
11
- attr_reader :builder
11
+ attr_accessor :builder
12
12
  end
13
13
 
14
14
  singleton_class.attr_accessor :builder_scheduler
data/lib/opal/version.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  module Opal
4
4
  # WHEN RELEASING:
5
5
  # Remember to update RUBY_ENGINE_VERSION in opal/corelib/constants.rb too!
6
- VERSION = '1.6.0'
6
+ VERSION = '1.6.1'
7
7
  end
@@ -1,8 +1,8 @@
1
1
  ::RUBY_PLATFORM = 'opal'
2
2
  ::RUBY_ENGINE = 'opal'
3
3
  ::RUBY_VERSION = '3.1.0'
4
- ::RUBY_ENGINE_VERSION = '1.6.0'
5
- ::RUBY_RELEASE_DATE = '2022-11-24'
4
+ ::RUBY_ENGINE_VERSION = '1.6.1'
5
+ ::RUBY_RELEASE_DATE = '2022-12-09'
6
6
  ::RUBY_PATCHLEVEL = 0
7
7
  ::RUBY_REVISION = '0'
8
8
  ::RUBY_COPYRIGHT = 'opal - Copyright (C) 2013-2022 Adam Beynon and the Opal contributors'
@@ -68,6 +68,16 @@ RSpec.describe Opal::Builder do
68
68
  b2.send(m).should_not equal(builder.send(m))
69
69
  end
70
70
  end
71
+
72
+ it 'processes dependencies correctly' do
73
+ b2 = builder
74
+ 2.times do
75
+ b2 = b2.dup
76
+ source = 'require "json"'
77
+ b2.build_str(source, 'bar.rb')
78
+ b2.to_s.should include("$to_json")
79
+ end
80
+ end
71
81
  end
72
82
 
73
83
  describe 'requiring a native .js file' do
data/tasks/building.rake CHANGED
@@ -15,6 +15,7 @@ DESC
15
15
  task :dist do
16
16
  require 'opal/util'
17
17
  require 'opal/config'
18
+ require 'fileutils'
18
19
 
19
20
  Opal::Config.arity_check_enabled = false
20
21
  Opal::Config.const_missing_enabled = false
@@ -23,7 +24,8 @@ task :dist do
23
24
 
24
25
  build_dir = ENV['DIR'] || 'build'
25
26
  files = ENV['FILES'] ? ENV['FILES'].split(',') :
26
- Dir['{opal,stdlib}/*.rb'].map { |lib| File.basename(lib, '.rb') }
27
+ Dir['{opal,stdlib}/*.rb'].map { |lib| File.basename(lib, '.rb') } +
28
+ Dir['opal/opal/*.rb'].map { |lib| 'opal/' + File.basename(lib, '.rb') }
27
29
  formats = (ENV['FORMATS'] || 'js,min,gz').split(',')
28
30
 
29
31
  mkdir_p build_dir unless File.directory? build_dir
@@ -36,7 +38,7 @@ task :dist do
36
38
  $stdout.flush
37
39
 
38
40
  # Set requirable to true, unless building opal. This allows opal to be auto-loaded.
39
- requirable = (lib != 'opal')
41
+ requirable = (%w[opal opal/mini opal/base].include? lib)
40
42
  builder = Opal::Builder.build(lib, requirable: requirable)
41
43
 
42
44
  src = builder.to_s if (formats & %w[js min gz]).any?
@@ -44,6 +46,8 @@ task :dist do
44
46
  min = Opal::Util.uglify src if (formats & %w[min gz]).any?
45
47
  gzp = Opal::Util.gzip min if (formats & %w[gz]).any?
46
48
 
49
+ FileUtils.mkdir_p(File.dirname("#{build_dir}/#{lib}.js"))
50
+
47
51
  File.open("#{build_dir}/#{lib}.js", 'w+') { |f| f << src }
48
52
  File.open("#{build_dir}/#{lib}.min.js", 'w+') { |f| f << min } if min
49
53
  File.open("#{build_dir}/#{lib}.min.js.gz", 'w+') { |f| f << gzp } if gzp
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elia Schito
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2022-11-24 00:00:00.000000000 Z
13
+ date: 2022-12-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ast
@@ -1169,10 +1169,10 @@ licenses:
1169
1169
  metadata:
1170
1170
  homepage_uri: https://opalrb.com/
1171
1171
  bug_tracker_uri: https://github.com/opal/opal/issues
1172
- changelog_uri: https://github.com/opal/opal/blob/v1.6.0/CHANGELOG.md
1173
- readme_uri: https://github.com/opal/opal/blob/v1.6.0/README.md
1174
- api_documentation_uri: http://opalrb.com/docs/api/v1.6.0/index.html
1175
- guides_uri: http://opalrb.com/docs/guides/v1.6.0/index.html
1172
+ changelog_uri: https://github.com/opal/opal/blob/v1.6.1/CHANGELOG.md
1173
+ readme_uri: https://github.com/opal/opal/blob/v1.6.1/README.md
1174
+ api_documentation_uri: http://opalrb.com/docs/api/v1.6.1/index.html
1175
+ guides_uri: http://opalrb.com/docs/guides/v1.6.1/index.html
1176
1176
  chat_uri: https://gitter.im/opal/opal
1177
1177
  source_code_uri: https://github.com/opal/opal
1178
1178
  post_install_message:
@@ -1190,7 +1190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1190
1190
  - !ruby/object:Gem::Version
1191
1191
  version: '0'
1192
1192
  requirements: []
1193
- rubygems_version: 3.3.22
1193
+ rubygems_version: 3.3.26
1194
1194
  signing_key:
1195
1195
  specification_version: 4
1196
1196
  summary: Ruby runtime and core library for JavaScript