porous 0.3.1 → 0.3.2

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: 87c6a954ddaf691739b880123048bf3345ece37389404d7a1c7163b27119c0ac
4
- data.tar.gz: d13c2be795c751e8eb6095e0642560065e4815ff04ac17ffd7605e1092d775ba
3
+ metadata.gz: 97c2c2c1012060cf7e94ce3a27576d5d0deeee6f5dff85f60bc3b546ddf124f3
4
+ data.tar.gz: df1fcc99004ba224f1fab40355e958112ae56c512bc11412558c493adbc398eb
5
5
  SHA512:
6
- metadata.gz: 84e53a85958c58e66417eeadc77fd35332ac0f30b7b59eaef49e39ebeb1cc83d8f3dc906d848c40eb1f4ca08604e36d06efc6b72de0427911a185f705278ce95
7
- data.tar.gz: 7e42e43664d2329d25f47999bddf7e0c28cbd2ccd36c69ce81e4e94a4e6894a5c905bc5f9ddce41b0ce6770f5f116c369b48c6d2622135e8b2e32221e7d1a6d5
6
+ metadata.gz: a9ccbf9700c5fcf531c8421357fef48631bfdb0c60a9fb4bb51282847f72b6d8505d2464b0b10587d935aea1b9d3f7c4abc769d39fc316b4910dbb5b0d4acdd2
7
+ data.tar.gz: b49424e0903cd012bd54ddd0c99c219bdb475b6fe81a1e3c8177256f81479bfeaac0e8c285059e06190b7840ce46f8bc26d06110c77be60cf41d85141cfd8f3f
data/CHANGELOG.md CHANGED
@@ -14,6 +14,11 @@
14
14
 
15
15
  ## [Unreleased]
16
16
 
17
+ ## [0.3.2] - 25 February 2024
18
+
19
+ - Serve static files with Agoo
20
+ - Split Porous JavaScripts from application scripts
21
+
17
22
  ## [0.3.1] - 24 February 2024
18
23
 
19
24
  - Production Mode
@@ -18,9 +18,10 @@ module Porous
18
18
  end
19
19
  meta name: 'description', content: props[:description] if props[:description]
20
20
 
21
- script src: '/static/dist/application.js', id: 'application'
21
+ script src: '/porous.js'
22
+ script src: '/app.js'
22
23
  script src: 'https://cdn.tailwindcss.com'
23
- link rel: 'icon', href: '/static/favicon.svg'
24
+ link rel: 'icon', href: '/favicon.svg'
24
25
  end
25
26
 
26
27
  body class: 'bg-gray-50 dark:bg-gray-900' do
@@ -14,7 +14,7 @@ module Porous
14
14
 
15
15
  desc 'build ENV', 'Build static assets for environment (default: development)'
16
16
  def build(env = :development)
17
- empty_directory 'static/dist', verbose: false, force: options[:force]
17
+ empty_directory 'static', verbose: false, force: options[:force]
18
18
  Porous::Server::Builder.new(env.to_sym).build
19
19
  end
20
20
  end
@@ -7,7 +7,7 @@ module Porous
7
7
  namespace :dev
8
8
 
9
9
  desc 'dev', 'Starts a Porous development server'
10
- def dev # rubocop:todo Metrics/MethodLength, Metrics/AbcSize
10
+ def dev # rubocop:todo Metrics/MethodLength
11
11
  empty_directory 'static/dist', verbose: false, force: options[:force]
12
12
 
13
13
  Agoo::Log.configure(
@@ -19,16 +19,15 @@ module Porous
19
19
  INFO: true,
20
20
  DEBUG: false,
21
21
  connect: false,
22
- request: false,
22
+ request: true,
23
23
  response: false,
24
- eval: true,
25
- push: true
24
+ eval: false,
25
+ push: false
26
26
  }
27
27
  )
28
28
 
29
- Agoo::Server.init 9292, Dir.pwd, thread_count: 1
29
+ Agoo::Server.init 9292, 'static', thread_count: 1, root_first: true
30
30
  Agoo::Server.use Rack::ContentLength
31
- Agoo::Server.use Rack::Static, urls: ['/static']
32
31
  Agoo::Server.use Rack::ShowExceptions
33
32
 
34
33
  # Socket Communication
@@ -23,17 +23,14 @@ module Porous
23
23
  })
24
24
 
25
25
  Agoo::Server.init(
26
- 80, '.',
26
+ 0, 'static',
27
+ root_first: true,
27
28
  thread_count: 0,
28
29
  ssl_cert: 'ssl/cert.pem',
29
30
  ssl_key: 'ssl/key.pem',
30
- bind: [
31
- 'http://127.0.0.1:80',
32
- 'https://127.0.0.1:443'
33
- ]
31
+ bind: 'https://:443'
34
32
  )
35
33
  Agoo::Server.use Rack::ContentLength
36
- Agoo::Server.use Rack::Static, urls: ['/static']
37
34
 
38
35
  # Socket Communication
39
36
  $socket ||= Porous::Server::Socket.new
@@ -1,2 +1,3 @@
1
- static/dist
1
+ static/porous.js
2
+ static/app.js
2
3
  ssl
@@ -12,17 +12,22 @@ module Porous
12
12
  @latest_change = Dir.glob(File.join('**', '*.rb')).map { |f| File.mtime f }.max
13
13
  end
14
14
 
15
- def build
15
+ def build # rubocop:todo Metrics/AbcSize
16
16
  components = Dir.glob(File.join('**', '*.rb')).map do |relative_path|
17
17
  modified = File.mtime relative_path
18
18
  @latest_change = modified if modified > @latest_change
19
19
  "require '#{relative_path}'"
20
20
  end
21
- build_string = "require 'porous'; #{components.join ";"}; ".gsub '.rb', ''
21
+ # Porous
22
+ builder = Opal::Builder.new scheduler: Opal::BuilderScheduler::Sequential, cache: false
23
+ builder.build_str "require 'porous'", '(inline)'
24
+ File.binwrite "#{Dir.pwd}/static/porous.js", builder.to_s
25
+ # App
26
+ build_string = "#{components.join ";"}; ".gsub '.rb', ''
22
27
  build_string << inject_socket_connection
23
28
  builder = Opal::Builder.new scheduler: Opal::BuilderScheduler::Sequential, cache: false
24
29
  builder.build_str build_string, '(inline)'
25
- File.binwrite "#{Dir.pwd}/static/dist/application.js", builder.to_s
30
+ File.binwrite "#{Dir.pwd}/static/app.js", builder.to_s
26
31
  @last_build = Time.now
27
32
  self
28
33
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Porous
4
- VERSION = '0.3.1'
4
+ VERSION = '0.3.2'
5
5
  end
data/opal/porous.rb CHANGED
@@ -3,11 +3,22 @@
3
3
  require 'opal'
4
4
  require 'native'
5
5
  require 'promise'
6
- require 'browser/setup/full'
7
-
8
6
  require 'js'
9
7
  require 'console'
10
8
 
9
+ require 'browser/version'
10
+ require 'browser/utils'
11
+ require 'browser/form_data'
12
+ require 'browser/support'
13
+ require 'browser/event'
14
+ require 'browser/window'
15
+ require 'browser/dom'
16
+ require 'browser/delay'
17
+ require 'browser/interval'
18
+ require 'browser/animation_frame'
19
+ require 'browser/socket'
20
+ require 'browser/history'
21
+
11
22
  require 'virtual_dom'
12
23
  require 'virtual_dom/support/browser'
13
24
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: porous
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Exa Stencil
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-24 00:00:00.000000000 Z
11
+ date: 2024-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: agoo