bridgetown-lit-renderer 1.1.1 → 2.0.0.beta1

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: 8f8f4ae03c036f36ea4dd3fb5bf924a80cb0eda2ca12957484436c89b9a1e407
4
- data.tar.gz: 7a9df76765166b4c9eb06fbf6aff2df8bfc0fc1010686bd6b007f6a50ac21271
3
+ metadata.gz: d79a4e35e5a22651e3072ad4cbc1b9d257fa455db19bcc74ce53de0083681700
4
+ data.tar.gz: 476e74d005b73dea3a92b648f2d9ef11a786b9401c0399462efc550f471f8ead
5
5
  SHA512:
6
- metadata.gz: 6fffc5fc4150f49b3dfb65a550a1b5d1d4eff4243e2a750b4b4601df4d0d94ebc82332132e2bec3b7c073e71b996af66556800fb89cec52294d28a0a1999d27b
7
- data.tar.gz: 76e7648e122b98cbe75d194c6088478a2399bffbfba742c1b6cc827bd022d337c8f02a6dafce9a846b5d75ea64b415ad00d8aee1fa1896c214b5cc837ddb6af7
6
+ metadata.gz: a63d2c1a1e4954e59681999f218cf3170cbc994861861dbf883c511a9a0be569f6be080f64933d612bb0b84c46794a49e16ee416136d7167eadd4efc84b1ff21
7
+ data.tar.gz: ca21d55e857d7571e12800927779110d1b98b9a986019c1ba7d96984d112037321fed0a44a3f6c11f7292c948404b9a94b0fb9c0e22a56347ded2603f112468c
@@ -0,0 +1,31 @@
1
+ name: CI Test
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - "*"
7
+ push:
8
+ branches:
9
+ - main
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ubuntu-latest
14
+ env:
15
+ BUNDLE_JOBS: 4
16
+ BUNDLE_PATH: "vendor/bundle"
17
+ steps:
18
+ - uses: actions/checkout@v2
19
+ - name: Set up Ruby and Yarn
20
+ uses: ruby/setup-ruby@v1
21
+ with:
22
+ ruby-version: "3.0"
23
+ bundler-cache: true
24
+ - uses: actions/setup-node@v2
25
+ with:
26
+ node-version: '15'
27
+ cache: 'yarn'
28
+ - name: Install NPM packages
29
+ run: yarn install
30
+ - name: Run tests
31
+ run: script/test # should be cibuild but Rubocop is acting weird
data/.rubocop.yml CHANGED
@@ -4,7 +4,7 @@ inherit_gem:
4
4
  rubocop-bridgetown: .rubocop.yml
5
5
 
6
6
  AllCops:
7
- TargetRubyVersion: 2.5
7
+ TargetRubyVersion: 2.7
8
8
 
9
9
  Exclude:
10
10
  - "*.gemspec"
data/CHANGELOG.md CHANGED
@@ -5,18 +5,20 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## Unreleased
8
+ ## [Unreleased]
9
9
 
10
- - ...
10
+ ## [2.0.0.beta1] - 2022-05-14
11
11
 
12
- ## 1.1.0 - 2021-12-03
12
+ - Various updates to the configuration flow, enhanced helper syntax, and a more robust sidecar infra
13
+
14
+ ## [1.1.0] - 2021-12-03
13
15
 
14
16
  - Fix issue with loading project root's node_modules path
15
17
 
16
- ## 1.1.0 - 2021-12-03
18
+ ## [1.1.0] - 2021-12-03
17
19
 
18
20
  - Switch to processing SSR through Node sidecar server and various other performance & caching enhancements
19
21
 
20
- ## 1.0.0 - 2021-09-25
22
+ ## [1.0.0] - 2021-09-25
21
23
 
22
24
  - First release (currently experimental stage).
data/README.md CHANGED
@@ -5,13 +5,21 @@
5
5
  [![npm][npm]][npm-url]
6
6
  [![Demo Site](https://img.shields.io/badge/Demo%20Site-teal?style=for-the-badge&logo=safari)](https://bridgetown-lit-renderer.onrender.com)
7
7
 
8
- Simple pipeline for SSR + hydration of Lit components in your [Bridgetown](https://www.bridgetownrb.com) site.
8
+ This [Bridgetown](https://www.bridgetownrb.com) plugin provides you with an easy-to-use pipeline for SSR + hydration of Lit components. Create "islands" of interactivity using Lit-based web components which are fully supported in all major browsers, and take full advantage of scoped component styling via the shadow DOM.
9
9
 
10
10
  [Check out the demo site repo](https://github.com/bridgetownrb/lit-renderer-example), or keep reading to get started.
11
11
 
12
12
  ## Installation
13
13
 
14
- Run this command to add this plugin to your site's Gemfile, along with Lit 2 and Lit's SSR support:
14
+ Starting in Bridgetown v1.1, you can install this plugin via a bundled configuration:
15
+
16
+ ```shell
17
+ $ bin/bridgetown configure lit
18
+ ```
19
+
20
+ Keep reading for a manual installation overview, or [skip this section](#take-lit-for-a-spin) to continue reading about plugin usage.
21
+
22
+ Run this command to add this plugin to your site's Gemfile, along with Lit and SSR support:
15
23
 
16
24
  ```shell
17
25
  $ bundle add bridgetown-lit-renderer -g bridgetown_plugins
@@ -23,21 +31,50 @@ Create a file in `config/lit-ssr.config.js` with the following:
23
31
 
24
32
  ```js
25
33
  const build = require("bridgetown-lit-renderer/build")
34
+ const { plugins } = require("./esbuild-plugins.js")
26
35
 
27
- // You can customize this as you wish, perhaps add new esbuild plugins
28
- const esbuildOptions = {}
36
+ const esbuildOptions = { plugins }
29
37
 
30
38
  build(esbuildOptions)
31
39
  ```
32
40
 
33
- Add the following to the top of your `frontend/javascript/index.js` file:
41
+ and `config/esbuild-plugins.js`:
42
+
43
+ ```js
44
+ // You can add esbuild plugins here you wish to share between the frontend bundles and Lit SSR:
45
+ module.exports = {
46
+ plugins: []
47
+ }
48
+ ```
49
+
50
+ and if you're using esbuild for your Bridgetown site, modify `esbuild.config.js``:
51
+
52
+ ```js
53
+ // at the top of your file:
54
+ const { plugins } = require("./config/esbuild-plugins.js")
55
+
56
+ const esbuildOptions = {
57
+ // other options
58
+
59
+ plugins: [...plugins]
60
+ }
61
+ ```
62
+
63
+ To ensure all `.lit.js`/`.lit.js.rb` files in your `src/_components` are automatically made available to the Lit SSR process, create the following `config/lit-components-entry.js` file:
64
+
65
+ ```js
66
+ import components from "bridgetownComponents/**/*.{lit.js,lit.js.rb}"
67
+ ```
68
+
69
+ Now add the following to the top of your `frontend/javascript/index.js` file:
34
70
 
35
71
  ```js
36
72
  import "bridgetown-lit-renderer"
37
- import "./lit-components"
38
73
  ```
39
74
 
40
- For the purposes of testing your install, add the following to `frontend/javascript/lit-components.js`:
75
+ ### Take Lit for a Spin
76
+
77
+ For the purposes of testing your install, create the `src/_components/happy-days.lit.js` file:
41
78
 
42
79
  ```js
43
80
  import "lit/experimental-hydrate-support.js"
@@ -70,28 +107,46 @@ customElements.define('happy-days', HappyDaysElement)
70
107
  Finally, create a new `.erb` page somewhere in `src`, and add this to your template:
71
108
 
72
109
  ```erb
73
- <%= lit data: { hello: "there" } do %>
74
- <happy-days hello="${data.hello}"></happy-days>
75
- <% end %>
110
+ <%= lit :happy_days, hello: "there" %>
76
111
  ```
77
112
 
113
+ (The helper will know how to convert the tag name and attribute keywords to HTML output.)
114
+
78
115
  Now start up your Bridgetown site, visit the page, and if all goes well, you should see a box containing "Hello there!" and a timestamp when the page was first rendered.
79
116
 
80
- You can reload the page several times and see that the timestamp doesn't change, because Lit's SSR + Hydration support knows not to re-render the component. However, if you change the `hello` attribute in the HTML, you'll get a re-render and thus see a new timestamp. _How cool is that?!_
117
+ You can reload the page several times and see that the timestamp doesn't change, because Lit's SSR + Hydration support knows not to re-render the component. However, if you change the `hello` attribute, you'll get a re-render and thus see a new timestamp. _How cool is that?!_
81
118
 
82
- ### Usage and Configuration Options
119
+ ### Lit Helper Options
83
120
 
84
- The `lit` helper works in any Ruby template language and let's you pass data down to the Lit SSR build process. As long as your `data` value is an object that can be converted to JSON (via Ruby's `to_json`), you're set. In fact, you can even pass your page/resource front matter along for the ride:
121
+ The `lit` helper works in any Ruby template language and let's you pass data down to the Lit SSR build process. Any value that's not alreadey a string will be converted to JSON (via Ruby's `to_json`). You can use a symbol or string for the tag name and underscores are automatically converted to dashes.
122
+
123
+ ```erb
124
+ <%= lit :page_header, title: resource.data.title %>
125
+ ```
126
+
127
+ (Remember, all custom elements always must have at least one dash within the HTML.)
128
+
129
+ If you pass a block to `lit`, it will add that additional HTML into the Lit template output:
130
+
131
+ ```erb
132
+ <%= lit :ui_sidebar do %>
133
+ <h2 slot="title">Nice Sidebar</h2>
134
+ <% end %>
135
+ ```
136
+
137
+ You can also pass page/resource front matter and other data along via the `data` keyword, which then can be used in the block. In addition, if a tag name isn't present, you can add it yourself in within the block.
85
138
 
86
139
  ```erb
87
140
  <%= lit data: resource.data do %>
88
- <page-header title="${data.title}"></page-header>
141
+ <page-header>
142
+ <h1>${data.title}</h1>
143
+ </page-header>
89
144
  <% end %>
90
145
  ```
91
146
 
92
147
  When the component is hydrated, it will utilize the same data that was passed at build time and avoid a client-side re-render. However, from that point forward you're free to mutate component attribute/properties to trigger re-renders as normal. [Check out Lit's `firstUpdated` method](https://lit.dev/docs/components/lifecycle/#reactive-update-cycle-completing) as a good place to start.
93
148
 
94
- You also have the option of choosing a different entry point (aka your JS file that contains or imports one or more Lit components). The default is `./frontend/javascript/lit-components.js`, but you can specify any other file you wish (the path should be relative to your project root).
149
+ You also have the option of choosing a different entry point (aka your JS file that contains or imports one or more Lit components). The default is `./config/lit-components-entry.js`, but you can specify any other file you wish (the path should be relative to your project root).
95
150
 
96
151
  ```erb
97
152
  <%= lit data: resource.data, entry: "./frontend/javascript/components/headers.js" do %>
@@ -99,19 +154,34 @@ You also have the option of choosing a different entry point (aka your JS file t
99
154
  <% end %>
100
155
  ```
101
156
 
102
- This would typically coincide with a strategy of having multiple Webpack entry points, and loading different entry points on different parts of your site. An exercise left for the reader…
157
+ This would typically coincide with a strategy of having multiple esbuild/Webpack entry points, and loading different entry points on different parts of your site. An exercise left for the reader…
158
+
159
+ ### Sidecar CSS Files
160
+
161
+ The "default" manner in which you author styles in Lit components is to use `css` tagged template literals (as you saw in the `happy-days` example above). However, some people prefer authoring styles in dedicated CSS files.
162
+
163
+ The [esbuild-plugin-lit-css](https://github.com/bennypowers/lit-css/tree/main/packages/esbuild-plugin-lit-css) plugin allows you to author perfectly vanilla CSS files alongside your component files and import them.
164
+
165
+ In order to separate the "globally-accessible" stylesheets you may have in `src/_components` from the Lit component-specific stylesheets (which we only want to get instantiated within component shadow roots), we'll use the following file conventions:
166
+
167
+ * For global stylesheets, use a `.global.css` suffix.
168
+ * For Lit component stylesheets, use a `.lit.css` suffix.
169
+
170
+ If you used Bridgetown v1.1 or later's Lit bundled configuration, this is already installed and configured for you. Otherwise, you'll need to do just a bit of manual setup to get things working.
171
+
172
+ TBD
103
173
 
104
174
  ### Technical and Performance Considerations
105
175
 
106
- The Bridgetown Lit render helper works by compiling your entry point together with your code block via esbuild and caching the resulting JS snippet. A second pass combines your `data` with the snippet and executes it via a temporary "sidecar" Node server which utilizes Lit's SSR rendering pipeline. That output is again cached in a way which persists on-disk for use across builds.
176
+ The Bridgetown Lit render helper works by compiling your entry point together with your code block via esbuild and caching the resulting JS snippet. A second pass combines your `data` with the snippet and executes it via a temporary "sidecar" Node server which utilizes Lit's SSR rendering pipeline.
107
177
 
108
178
  This for performance reasons. If you have added a Lit template to a layout used by, say, a thousand products, your first build will indeed execute Lit SSR for those thousand products, but thereafter it will be cached. If you change the data for one product, such as a price, Lit SSR will reexecute _only_ for that one product. In addition, for a data-only change the previously compiled JS snippet via esbuild _won't_ need to be recompiled. Of course if you also modify either the HTML markup within the helper block or the entry point itself, recompilation must take place.
109
179
 
110
180
  It's also recommended you don't include any Ruby template code _within_ the helper code block (e.g., using `<%= %>` tags) which results in constantly changing output, as that would necessitate recompiling with esbuild on a regular basis.
111
181
 
112
- Thus with a bit of careful planning of which entry point(s) you create, the data you provide, and the structure of your HTML markup within the `lit` helper, you can achieve good Lit SSR performance while still taking full advantage of the Ruby templates and components you know and love.
182
+ In v2.0 of this plugin, we only persist these caches during the build process and then the cache is cleared. To cache in a way which persists on-disk for use across builds, you can add `enable_lit_caching: true` to your Bridgetown config. For instance, if you're mainly working on content or other aspects of the site and not directly modifying Lit component code, you'll gain back some build performance by enabling full caching.
113
183
 
114
- (If you do run into major issues and want to outright disable the esbuild/SSR caching, you can add `disable_lit_caching: true` to your Bridgetown config.)
184
+ In summary—with a bit of careful planning of which entry point(s) you create, the data you provide, and the structure of your HTML markup within the `lit` helper, you can achieve good Lit SSR performance while still taking full advantage of the Ruby templates and components you know and love.
115
185
 
116
186
  **A note about Lit templates:** in case you're wondering, the markup within the `lit` helper is actually executed inside Lit's `html` tagged template literal, and [all the usual rules of Lit templates apply](https://lit.dev/docs/templates/overview/). It's recommended you keep the markup within the helper block brief, and let the web component itself do most of the heavy lifting.
117
187
 
@@ -145,8 +215,6 @@ you should be doing this:
145
215
 
146
216
  ## Testing
147
217
 
148
- _Note: a proper site fixture and tests are in the works._
149
-
150
218
  * Run `bundle exec rake test` to run the test suite
151
219
  * Or run `script/cibuild` to validate with Rubocop and Minitest together.
152
220
 
@@ -19,9 +19,9 @@ Gem::Specification.new do |spec|
19
19
  spec.metadata = { "yarn-add" => "bridgetown-lit-renderer@#{BridgetownLitRenderer::VERSION}",
20
20
  "rubygems_mfa_required" => "true", }
21
21
 
22
- spec.required_ruby_version = ">= 2.5.0"
22
+ spec.required_ruby_version = ">= 2.7.0"
23
23
 
24
- spec.add_dependency "bridgetown", ">= 0.15", "< 2.0"
24
+ spec.add_dependency "bridgetown", ">= 1.0", "< 2.0"
25
25
  spec.add_dependency "random-port", ">= 0.5"
26
26
 
27
27
  spec.add_development_dependency "bundler"
@@ -2,39 +2,75 @@
2
2
 
3
3
  module BridgetownLitRenderer
4
4
  class Builder < Bridgetown::Builder
5
- def build # rubocop:todo Metrics/AbcSize, Metrics/MethodLength
5
+ def build # rubocop:todo Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity
6
6
  BridgetownLitRenderer::Renderer.instance.site = site
7
7
  BridgetownLitRenderer::Renderer.instance.reset
8
+
9
+ hook :site, :post_read do
10
+ BridgetownLitRenderer::Renderer.instance.cache.clear unless site.config.enable_lit_caching
11
+ end
12
+
8
13
  hook :site, :post_render do
9
14
  BridgetownLitRenderer::Renderer.stop_node_server
10
15
  end
11
16
 
12
- helper "lit", helpers_scope: true do |
17
+ hook :site, :server_shutdown do
18
+ BridgetownLitRenderer::Renderer.stop_node_server
19
+ end
20
+
21
+ process_tag = ->(tag, attributes, code) do
22
+ valid_tag = tag.to_s.tr("_", "-")
23
+ segments = ["<#{valid_tag}"]
24
+ attributes.each do |attr, _|
25
+ attr = attr.to_s.tr("_", "-")
26
+ segments << %( #{attr}="${data.#{attr}}")
27
+ end
28
+ segments << ">"
29
+ segments << code
30
+ segments << "</#{valid_tag}>"
31
+ segments.join
32
+ end
33
+
34
+ jsonify_data = ->(data) do
35
+ data.to_h do |k, v|
36
+ processed_value = case v
37
+ when String
38
+ v
39
+ else
40
+ v.to_json
41
+ end
42
+ [k, processed_value]
43
+ end
44
+ end
45
+
46
+ helper "lit", helpers_scope: true do | # rubocop:todo Metrics/ParameterLists
47
+ tag = nil,
13
48
  data: {},
14
49
  hydrate_root: true,
15
- entry: "./frontend/javascript/lit-components.js",
50
+ entry: "./config/lit-components-entry.js",
51
+ **kwargs,
16
52
  &block
17
53
  |
18
- code = view.capture(&block)
54
+ code = block ? view.capture(&block) : ""
55
+ code = process_tag.(tag, kwargs, code) if tag
56
+
19
57
  if hydrate_root
20
58
  code = "<hydrate-root>#{code.sub(%r{<([a-zA-Z]+-[a-zA-Z-]*)}, "<\\1 defer-hydration")}</hydrate-root>" # rubocop:disable Layout/LineLength
21
59
  end
22
60
 
23
- render_fn = -> do
61
+ data = data.merge(kwargs)
62
+ data = jsonify_data.(data)
63
+
64
+ entry_key = BridgetownLitRenderer::Renderer.instance.entry_key(entry)
65
+ BridgetownLitRenderer::Renderer.instance.cache.getset(
66
+ "output-#{code}#{data}#{entry_key}"
67
+ ) do
24
68
  BridgetownLitRenderer::Renderer.instance.render(
25
69
  code,
26
70
  data: data,
27
- entry: entry,
28
- caching: !site.config.disable_lit_caching
71
+ entry: entry
29
72
  )
30
73
  end
31
-
32
- next render_fn.() if site.config.disable_lit_caching
33
-
34
- entry_key = BridgetownLitRenderer::Renderer.instance.entry_key(entry)
35
- BridgetownLitRenderer::Renderer.instance.cache.getset(
36
- "output-#{code}#{data}#{entry_key}"
37
- ) { render_fn.() }
38
74
  end
39
75
  end
40
76
  end
@@ -54,6 +54,14 @@ module BridgetownLitRenderer
54
54
  @cache ||= Bridgetown::Cache.new("LitSSR")
55
55
  end
56
56
 
57
+ def call_http_server(payload)
58
+ Faraday.post(
59
+ "http://127.0.0.1:#{self.class.serverport}",
60
+ payload,
61
+ "Authorization" => "Bearer #{self.class.authtoken}"
62
+ ).body.force_encoding("utf-8")
63
+ end
64
+
57
65
  def esbuild(code)
58
66
  raise "You must first assign the `site' accessor" unless site
59
67
 
@@ -62,6 +70,7 @@ module BridgetownLitRenderer
62
70
  @esbuild_notice_printed = true
63
71
  end
64
72
 
73
+ # TODO: shouldn't this use the sidecar Node process as well?
65
74
  IO.popen(["node", site.in_root_dir("./config/lit-ssr.config.js")], "r+") do |pipe|
66
75
  pipe.puts({ code: code }.to_json)
67
76
  pipe.close_write
@@ -69,18 +78,12 @@ module BridgetownLitRenderer
69
78
  end
70
79
  end
71
80
 
72
- def render(code, data:, entry:, caching: true) # rubocop:todo Metrics/MethodLength, Metrics/AbcSize
81
+ def render(code, data:, entry:)
73
82
  raise "You must first assign the `site' accessor" unless site
74
83
 
75
84
  cache_key = "esbuild-#{code}#{entry}#{entry_key(entry)}"
76
85
 
77
- esbuild_fn = -> { esbuild(js_code_block(entry, code)) }
78
-
79
- built_code = if caching
80
- cache.getset(cache_key) { esbuild_fn.() }
81
- else
82
- esbuild_fn.()
83
- end
86
+ built_code = cache.getset(cache_key) { esbuild(js_code_block(entry, code)) }
84
87
 
85
88
  unless @render_notice_printed
86
89
  Bridgetown.logger.info "Lit SSR:", "Rendering components..."
@@ -89,11 +92,7 @@ module BridgetownLitRenderer
89
92
 
90
93
  self.class.start_node_server(site.in_root_dir("node_modules"))
91
94
 
92
- output = Faraday.post(
93
- "http://127.0.0.1:#{self.class.serverport}",
94
- "const data = #{data.to_json}; #{built_code}",
95
- "Authorization" => "Bearer #{self.class.authtoken}"
96
- ).body
95
+ output = call_http_server("const data = #{data.to_json}; #{built_code}")
97
96
 
98
97
  if output == "SCRIPT NOT VALID!"
99
98
  output = <<~HTML
@@ -101,7 +100,7 @@ module BridgetownLitRenderer
101
100
  Lit SSR error in #{entry}, see logs
102
101
  </ssr-error>
103
102
  HTML
104
- cache.delete(cache_key) if caching
103
+ cache.delete(cache_key)
105
104
  end
106
105
 
107
106
  output.html_safe
@@ -110,7 +109,6 @@ module BridgetownLitRenderer
110
109
  def js_code_block(entry, code)
111
110
  entry_import = "import #{entry.to_json}"
112
111
  <<~JS
113
- import { Readable } from "stream"
114
112
  import { render } from "@lit-labs/ssr/lib/render-with-global-dom-shim.js"
115
113
  import { html } from "lit"
116
114
  #{entry_import}
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BridgetownLitRenderer
4
- VERSION = "1.1.1"
4
+ VERSION = "2.0.0.beta1"
5
5
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bridgetown-lit-renderer",
3
- "version": "1.1.1",
3
+ "version": "2.0.0.beta1",
4
4
  "main": "frontend/javascript/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -27,6 +27,11 @@
27
27
  "dependencies": {
28
28
  "@webcomponents/template-shadowroot": "^0.1.0",
29
29
  "colors": "^1.4.0",
30
- "esbuild": "^0.12"
30
+ "esbuild": "^0.14",
31
+ "glob": "^7.2.0"
32
+ },
33
+ "devDependencies": {
34
+ "@lit-labs/ssr": "^2.1.0",
35
+ "lit": "^2.2.3"
31
36
  }
32
37
  }
data/src/build.js CHANGED
@@ -1,4 +1,50 @@
1
1
  const path = require("path")
2
+ const glob = require("glob")
3
+
4
+ // Glob plugin derived from:
5
+ // https://github.com/thomaschaaf/esbuild-plugin-import-glob
6
+ // https://github.com/xiaohui-zhangxh/jsbundling-rails/commit/b15025dcc20f664b2b0eb238915991afdbc7cb58
7
+ const importGlobPlugin = () => ({
8
+ name: "import-glob",
9
+ setup: (build) => {
10
+ build.onResolve({ filter: /\*/ }, async (args) => {
11
+ if (args.resolveDir === "") {
12
+ return; // Ignore unresolvable paths
13
+ }
14
+
15
+ const adjustedPath = args.path.replace(/^bridgetownComponents\//, "../src/_components/")
16
+
17
+ return {
18
+ path: adjustedPath,
19
+ namespace: "import-glob",
20
+ pluginData: {
21
+ path: adjustedPath,
22
+ resolveDir: args.resolveDir,
23
+ },
24
+ }
25
+ })
26
+
27
+ build.onLoad({ filter: /.*/, namespace: "import-glob" }, async (args) => {
28
+ const files = glob.sync(args.pluginData.path, {
29
+ cwd: args.pluginData.resolveDir,
30
+ }).sort()
31
+
32
+ const importerCode = `
33
+ ${files
34
+ .map((module, index) => `import * as module${index} from '${module}'`)
35
+ .join(';')}
36
+ const modules = {${files
37
+ .map((module, index) => `
38
+ "${module.replace("../src/_components/", "")}": module${index},`)
39
+ .join("")}
40
+ };
41
+ export default modules;
42
+ `
43
+
44
+ return { contents: importerCode, resolveDir: args.pluginData.resolveDir }
45
+ })
46
+ },
47
+ })
2
48
 
3
49
  module.exports = (esbuildOptions) => {
4
50
  let inputData = [];
@@ -13,6 +59,9 @@ module.exports = (esbuildOptions) => {
13
59
  process.stdin.on('end', () => {
14
60
  const inputValues = JSON.parse(inputData.join())
15
61
 
62
+ esbuildOptions.plugins = esbuildOptions.plugins || []
63
+ esbuildOptions.plugins.unshift(importGlobPlugin())
64
+
16
65
  require('esbuild').build({
17
66
  ...esbuildOptions,
18
67
  stdin: {
@@ -21,7 +70,7 @@ module.exports = (esbuildOptions) => {
21
70
  sourcefile: 'lit-ssr-output.js' // imaginary file
22
71
  },
23
72
  platform: "node",
24
- inject: [path.join(__dirname, "import-meta-url-shim.js")],
73
+ inject: [path.join(__dirname, "server", "import-meta-url-shim.js")],
25
74
  define: { "import.meta.url": "import_meta_url" },
26
75
  bundle: true,
27
76
  write: false,
data/src/serve.js CHANGED
@@ -1,5 +1,5 @@
1
1
  const http = require("http")
2
- const litexec = require("./ssr_exec")
2
+ const litexec = require("./server/ssr_exec")
3
3
 
4
4
  const server = http.createServer((req, res) => {
5
5
  if (req.method === "POST" && req.headers.authorization?.endsWith(process.env.LIT_SSR_AUTH_TOKEN)) {
File without changes
data/yarn.lock CHANGED
@@ -2,17 +2,341 @@
2
2
  # yarn lockfile v1
3
3
 
4
4
 
5
+ "@lit-labs/ssr-client@^1.0.0":
6
+ version "1.0.1"
7
+ resolved "https://registry.yarnpkg.com/@lit-labs/ssr-client/-/ssr-client-1.0.1.tgz#b97e121184aa201bbe6f165f3a7dc919f67129a2"
8
+ integrity sha512-rr/UVhxbKWNUr+3qRyvZk+glC7v7ph8Gk/W0z96YG64COJKf9ilnWY6JGW77TRqhrRMmS2nsvAXOyQgcF+4jrA==
9
+ dependencies:
10
+ "@lit/reactive-element" "^1.0.0"
11
+ lit "^2.0.0"
12
+ lit-html "^2.0.0"
13
+
14
+ "@lit-labs/ssr@^2.1.0":
15
+ version "2.1.0"
16
+ resolved "https://registry.yarnpkg.com/@lit-labs/ssr/-/ssr-2.1.0.tgz#28de42723a9d7224d5e9ab53c420ae102502a033"
17
+ integrity sha512-Tnz/S99G57QKQkI+5QhpfOyVxdHM/IbSa3DZmbF5aeIugivONjurHOuMn6AHzzgdteae3ihcGV2eehKPJuG4/w==
18
+ dependencies:
19
+ "@lit-labs/ssr-client" "^1.0.0"
20
+ "@lit/reactive-element" "^1.1.0"
21
+ "@types/node" "^16.0.0"
22
+ lit "^2.1.0"
23
+ lit-element "^3.1.0"
24
+ lit-html "^2.1.0"
25
+ node-fetch "^2.6.0"
26
+ parse5 "^6.0.1"
27
+ resolve "^1.10.1"
28
+
29
+ "@lit/reactive-element@^1.0.0", "@lit/reactive-element@^1.1.0", "@lit/reactive-element@^1.3.0":
30
+ version "1.3.2"
31
+ resolved "https://registry.yarnpkg.com/@lit/reactive-element/-/reactive-element-1.3.2.tgz#43e470537b6ec2c23510c07812616d5aa27a17cd"
32
+ integrity sha512-A2e18XzPMrIh35nhIdE4uoqRzoIpEU5vZYuQN4S3Ee1zkGdYC27DP12pewbw/RLgPHzaE4kx/YqxMzebOpm0dA==
33
+
34
+ "@types/node@^16.0.0":
35
+ version "16.11.35"
36
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.35.tgz#6642bdce5b5cee23314b91a7c069981c6bd68791"
37
+ integrity sha512-QXu45LyepgnhUfnIAj/FyT4uM87ug5KpIrgXfQtUPNAlx8w5hmd8z8emqCLNvG11QkpRSCG9Qg2buMxvqfjfsQ==
38
+
39
+ "@types/trusted-types@^2.0.2":
40
+ version "2.0.2"
41
+ resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.2.tgz#fc25ad9943bcac11cceb8168db4f275e0e72e756"
42
+ integrity sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg==
43
+
5
44
  "@webcomponents/template-shadowroot@^0.1.0":
6
45
  version "0.1.0"
7
46
  resolved "https://registry.yarnpkg.com/@webcomponents/template-shadowroot/-/template-shadowroot-0.1.0.tgz#adb3438d0d9a18e8fced08abc253f56b7eadab00"
8
47
  integrity sha512-ry84Vft6xtRBbd4M/ptRodbOLodV5AD15TYhyRghCRgIcJJKmYmJ2v2BaaWxygENwh6Uq3zTfGPmlckKT/GXsQ==
9
48
 
49
+ balanced-match@^1.0.0:
50
+ version "1.0.2"
51
+ resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
52
+ integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
53
+
54
+ brace-expansion@^1.1.7:
55
+ version "1.1.11"
56
+ resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
57
+ integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
58
+ dependencies:
59
+ balanced-match "^1.0.0"
60
+ concat-map "0.0.1"
61
+
10
62
  colors@^1.4.0:
11
63
  version "1.4.0"
12
64
  resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78"
13
65
  integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==
14
66
 
15
- esbuild@^0.12:
16
- version "0.12.29"
17
- resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.12.29.tgz#be602db7c4dc78944a9dbde0d1ea19d36c1f882d"
18
- integrity sha512-w/XuoBCSwepyiZtIRsKsetiLDUVGPVw1E/R3VTFSecIy8UR7Cq3SOtwKHJMFoVqqVG36aGkzh4e8BvpO1Fdc7g==
67
+ concat-map@0.0.1:
68
+ version "0.0.1"
69
+ resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
70
+ integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
71
+
72
+ esbuild-android-64@0.14.39:
73
+ version "0.14.39"
74
+ resolved "https://registry.yarnpkg.com/esbuild-android-64/-/esbuild-android-64-0.14.39.tgz#09f12a372eed9743fd77ff6d889ac14f7b340c21"
75
+ integrity sha512-EJOu04p9WgZk0UoKTqLId9VnIsotmI/Z98EXrKURGb3LPNunkeffqQIkjS2cAvidh+OK5uVrXaIP229zK6GvhQ==
76
+
77
+ esbuild-android-arm64@0.14.39:
78
+ version "0.14.39"
79
+ resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.14.39.tgz#f608d00ea03fe26f3b1ab92a30f99220390f3071"
80
+ integrity sha512-+twajJqO7n3MrCz9e+2lVOnFplRsaGRwsq1KL/uOy7xK7QdRSprRQcObGDeDZUZsacD5gUkk6OiHiYp6RzU3CA==
81
+
82
+ esbuild-darwin-64@0.14.39:
83
+ version "0.14.39"
84
+ resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.14.39.tgz#31528daa75b4c9317721ede344195163fae3e041"
85
+ integrity sha512-ImT6eUw3kcGcHoUxEcdBpi6LfTRWaV6+qf32iYYAfwOeV+XaQ/Xp5XQIBiijLeo+LpGci9M0FVec09nUw41a5g==
86
+
87
+ esbuild-darwin-arm64@0.14.39:
88
+ version "0.14.39"
89
+ resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.39.tgz#247f770d86d90a215fa194f24f90e30a0bd97245"
90
+ integrity sha512-/fcQ5UhE05OiT+bW5v7/up1bDsnvaRZPJxXwzXsMRrr7rZqPa85vayrD723oWMT64dhrgWeA3FIneF8yER0XTw==
91
+
92
+ esbuild-freebsd-64@0.14.39:
93
+ version "0.14.39"
94
+ resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.39.tgz#479414d294905055eb396ebe455ed42213284ee0"
95
+ integrity sha512-oMNH8lJI4wtgN5oxuFP7BQ22vgB/e3Tl5Woehcd6i2r6F3TszpCnNl8wo2d/KvyQ4zvLvCWAlRciumhQg88+kQ==
96
+
97
+ esbuild-freebsd-arm64@0.14.39:
98
+ version "0.14.39"
99
+ resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.39.tgz#cedeb10357c88533615921ae767a67dc870a474c"
100
+ integrity sha512-1GHK7kwk57ukY2yI4ILWKJXaxfr+8HcM/r/JKCGCPziIVlL+Wi7RbJ2OzMcTKZ1HpvEqCTBT/J6cO4ZEwW4Ypg==
101
+
102
+ esbuild-linux-32@0.14.39:
103
+ version "0.14.39"
104
+ resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.14.39.tgz#d9f008c4322d771f3958f59c1eee5a05cdf92485"
105
+ integrity sha512-g97Sbb6g4zfRLIxHgW2pc393DjnkTRMeq3N1rmjDUABxpx8SjocK4jLen+/mq55G46eE2TA0MkJ4R3SpKMu7dg==
106
+
107
+ esbuild-linux-64@0.14.39:
108
+ version "0.14.39"
109
+ resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.14.39.tgz#ba58d7f66858913aeb1ab5c6bde1bbd824731795"
110
+ integrity sha512-4tcgFDYWdI+UbNMGlua9u1Zhu0N5R6u9tl5WOM8aVnNX143JZoBZLpCuUr5lCKhnD0SCO+5gUyMfupGrHtfggQ==
111
+
112
+ esbuild-linux-arm64@0.14.39:
113
+ version "0.14.39"
114
+ resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.39.tgz#708785a30072702b5b1c16b65cf9c25c51202529"
115
+ integrity sha512-23pc8MlD2D6Px1mV8GMglZlKgwgNKAO8gsgsLLcXWSs9lQsCYkIlMo/2Ycfo5JrDIbLdwgP8D2vpfH2KcBqrDQ==
116
+
117
+ esbuild-linux-arm@0.14.39:
118
+ version "0.14.39"
119
+ resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.14.39.tgz#4e8b5deaa7ab60d0d28fab131244ef82b40684f4"
120
+ integrity sha512-t0Hn1kWVx5UpCzAJkKRfHeYOLyFnXwYynIkK54/h3tbMweGI7dj400D1k0Vvtj2u1P+JTRT9tx3AjtLEMmfVBQ==
121
+
122
+ esbuild-linux-mips64le@0.14.39:
123
+ version "0.14.39"
124
+ resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.39.tgz#6f3bf3023f711084e5a1e8190487d2020f39f0f7"
125
+ integrity sha512-epwlYgVdbmkuRr5n4es3B+yDI0I2e/nxhKejT9H0OLxFAlMkeQZxSpxATpDc9m8NqRci6Kwyb/SfmD1koG2Zuw==
126
+
127
+ esbuild-linux-ppc64le@0.14.39:
128
+ version "0.14.39"
129
+ resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.39.tgz#900e718a4ea3f6aedde8424828eeefdd4b48d4b9"
130
+ integrity sha512-W/5ezaq+rQiQBThIjLMNjsuhPHg+ApVAdTz2LvcuesZFMsJoQAW2hutoyg47XxpWi7aEjJGrkS26qCJKhRn3QQ==
131
+
132
+ esbuild-linux-riscv64@0.14.39:
133
+ version "0.14.39"
134
+ resolved "https://registry.yarnpkg.com/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.39.tgz#dcbff622fa37047a75d2ff7a1d8d2949d80277e4"
135
+ integrity sha512-IS48xeokcCTKeQIOke2O0t9t14HPvwnZcy+5baG13Z1wxs9ZrC5ig5ypEQQh4QMKxURD5TpCLHw2W42CLuVZaA==
136
+
137
+ esbuild-linux-s390x@0.14.39:
138
+ version "0.14.39"
139
+ resolved "https://registry.yarnpkg.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.39.tgz#3f725a7945b419406c99d93744b28552561dcdfd"
140
+ integrity sha512-zEfunpqR8sMomqXhNTFEKDs+ik7HC01m3M60MsEjZOqaywHu5e5682fMsqOlZbesEAAaO9aAtRBsU7CHnSZWyA==
141
+
142
+ esbuild-netbsd-64@0.14.39:
143
+ version "0.14.39"
144
+ resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.39.tgz#e10e40b6a765798b90d4eb85901cc85c8b7ff85e"
145
+ integrity sha512-Uo2suJBSIlrZCe4E0k75VDIFJWfZy+bOV6ih3T4MVMRJh1lHJ2UyGoaX4bOxomYN3t+IakHPyEoln1+qJ1qYaA==
146
+
147
+ esbuild-openbsd-64@0.14.39:
148
+ version "0.14.39"
149
+ resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.39.tgz#935ec143f75ce10bd9cdb1c87fee00287eb0edbc"
150
+ integrity sha512-secQU+EpgUPpYjJe3OecoeGKVvRMLeKUxSMGHnK+aK5uQM3n1FPXNJzyz1LHFOo0WOyw+uoCxBYdM4O10oaCAA==
151
+
152
+ esbuild-sunos-64@0.14.39:
153
+ version "0.14.39"
154
+ resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.14.39.tgz#0e7aa82b022a2e6d55b0646738b2582c2d72c3c0"
155
+ integrity sha512-qHq0t5gePEDm2nqZLb+35p/qkaXVS7oIe32R0ECh2HOdiXXkj/1uQI9IRogGqKkK+QjDG+DhwiUw7QoHur/Rwg==
156
+
157
+ esbuild-windows-32@0.14.39:
158
+ version "0.14.39"
159
+ resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.14.39.tgz#3f1538241f31b538545f4b5841b248cac260fa35"
160
+ integrity sha512-XPjwp2OgtEX0JnOlTgT6E5txbRp6Uw54Isorm3CwOtloJazeIWXuiwK0ONJBVb/CGbiCpS7iP2UahGgd2p1x+Q==
161
+
162
+ esbuild-windows-64@0.14.39:
163
+ version "0.14.39"
164
+ resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.14.39.tgz#b100c59f96d3c2da2e796e42fee4900d755d3e03"
165
+ integrity sha512-E2wm+5FwCcLpKsBHRw28bSYQw0Ikxb7zIMxw3OPAkiaQhLVr3dnVO8DofmbWhhf6b97bWzg37iSZ45ZDpLw7Ow==
166
+
167
+ esbuild-windows-arm64@0.14.39:
168
+ version "0.14.39"
169
+ resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.39.tgz#00268517e665b33c89778d61f144e4256b39f631"
170
+ integrity sha512-sBZQz5D+Gd0EQ09tZRnz/PpVdLwvp/ufMtJ1iDFYddDaPpZXKqPyaxfYBLs3ueiaksQ26GGa7sci0OqFzNs7KA==
171
+
172
+ esbuild@^0.14:
173
+ version "0.14.39"
174
+ resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.14.39.tgz#c926b2259fe6f6d3a94f528fb42e103c5a6d909a"
175
+ integrity sha512-2kKujuzvRWYtwvNjYDY444LQIA3TyJhJIX3Yo4+qkFlDDtGlSicWgeHVJqMUP/2sSfH10PGwfsj+O2ro1m10xQ==
176
+ optionalDependencies:
177
+ esbuild-android-64 "0.14.39"
178
+ esbuild-android-arm64 "0.14.39"
179
+ esbuild-darwin-64 "0.14.39"
180
+ esbuild-darwin-arm64 "0.14.39"
181
+ esbuild-freebsd-64 "0.14.39"
182
+ esbuild-freebsd-arm64 "0.14.39"
183
+ esbuild-linux-32 "0.14.39"
184
+ esbuild-linux-64 "0.14.39"
185
+ esbuild-linux-arm "0.14.39"
186
+ esbuild-linux-arm64 "0.14.39"
187
+ esbuild-linux-mips64le "0.14.39"
188
+ esbuild-linux-ppc64le "0.14.39"
189
+ esbuild-linux-riscv64 "0.14.39"
190
+ esbuild-linux-s390x "0.14.39"
191
+ esbuild-netbsd-64 "0.14.39"
192
+ esbuild-openbsd-64 "0.14.39"
193
+ esbuild-sunos-64 "0.14.39"
194
+ esbuild-windows-32 "0.14.39"
195
+ esbuild-windows-64 "0.14.39"
196
+ esbuild-windows-arm64 "0.14.39"
197
+
198
+ fs.realpath@^1.0.0:
199
+ version "1.0.0"
200
+ resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
201
+ integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
202
+
203
+ function-bind@^1.1.1:
204
+ version "1.1.1"
205
+ resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
206
+ integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
207
+
208
+ glob@^7.2.0:
209
+ version "7.2.2"
210
+ resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.2.tgz#29deb38e1ef90f132d5958abe9c3ee8e87f3c318"
211
+ integrity sha512-NzDgHDiJwKYByLrL5lONmQFpK/2G78SMMfo+E9CuGlX4IkvfKDsiQSNPwAYxEy+e6p7ZQ3uslSLlwlJcqezBmQ==
212
+ dependencies:
213
+ fs.realpath "^1.0.0"
214
+ inflight "^1.0.4"
215
+ inherits "2"
216
+ minimatch "^3.1.1"
217
+ once "^1.3.0"
218
+ path-is-absolute "^1.0.0"
219
+
220
+ has@^1.0.3:
221
+ version "1.0.3"
222
+ resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796"
223
+ integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==
224
+ dependencies:
225
+ function-bind "^1.1.1"
226
+
227
+ inflight@^1.0.4:
228
+ version "1.0.6"
229
+ resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
230
+ integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=
231
+ dependencies:
232
+ once "^1.3.0"
233
+ wrappy "1"
234
+
235
+ inherits@2:
236
+ version "2.0.4"
237
+ resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
238
+ integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
239
+
240
+ is-core-module@^2.8.1:
241
+ version "2.9.0"
242
+ resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.9.0.tgz#e1c34429cd51c6dd9e09e0799e396e27b19a9c69"
243
+ integrity sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==
244
+ dependencies:
245
+ has "^1.0.3"
246
+
247
+ lit-element@^3.1.0, lit-element@^3.2.0:
248
+ version "3.2.0"
249
+ resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-3.2.0.tgz#9c981c55dfd9a8f124dc863edb62cc529d434db7"
250
+ integrity sha512-HbE7yt2SnUtg5DCrWt028oaU4D5F4k/1cntAFHTkzY8ZIa8N0Wmu92PxSxucsQSOXlODFrICkQ5x/tEshKi13g==
251
+ dependencies:
252
+ "@lit/reactive-element" "^1.3.0"
253
+ lit-html "^2.2.0"
254
+
255
+ lit-html@^2.0.0, lit-html@^2.1.0, lit-html@^2.2.0:
256
+ version "2.2.3"
257
+ resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-2.2.3.tgz#dcb2744d0f0c1800b2eb2de37bc42384434a74f7"
258
+ integrity sha512-vI4j3eWwtQaR8q/O63juZVliBIFMio716X719/lSsGH4UWPy2/7Qf377jsNs4cx3gCHgIbx8yxFgXFQ/igZyXQ==
259
+ dependencies:
260
+ "@types/trusted-types" "^2.0.2"
261
+
262
+ lit@^2.0.0, lit@^2.1.0, lit@^2.2.3:
263
+ version "2.2.3"
264
+ resolved "https://registry.yarnpkg.com/lit/-/lit-2.2.3.tgz#77203d8f247de7c0d4955817f89e40c927349b9c"
265
+ integrity sha512-5/v+r9dH3Pw/o0rhp/qYk3ERvOUclNF31bWb0FiW6MPgwdQIr+/KCt/p3zcd8aPl8lIGnxdGrVcZA+gWS6oFOQ==
266
+ dependencies:
267
+ "@lit/reactive-element" "^1.3.0"
268
+ lit-element "^3.2.0"
269
+ lit-html "^2.2.0"
270
+
271
+ minimatch@^3.1.1:
272
+ version "3.1.2"
273
+ resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
274
+ integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
275
+ dependencies:
276
+ brace-expansion "^1.1.7"
277
+
278
+ node-fetch@^2.6.0:
279
+ version "2.6.7"
280
+ resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
281
+ integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==
282
+ dependencies:
283
+ whatwg-url "^5.0.0"
284
+
285
+ once@^1.3.0:
286
+ version "1.4.0"
287
+ resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
288
+ integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
289
+ dependencies:
290
+ wrappy "1"
291
+
292
+ parse5@^6.0.1:
293
+ version "6.0.1"
294
+ resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b"
295
+ integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==
296
+
297
+ path-is-absolute@^1.0.0:
298
+ version "1.0.1"
299
+ resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
300
+ integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
301
+
302
+ path-parse@^1.0.7:
303
+ version "1.0.7"
304
+ resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
305
+ integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
306
+
307
+ resolve@^1.10.1:
308
+ version "1.22.0"
309
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198"
310
+ integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==
311
+ dependencies:
312
+ is-core-module "^2.8.1"
313
+ path-parse "^1.0.7"
314
+ supports-preserve-symlinks-flag "^1.0.0"
315
+
316
+ supports-preserve-symlinks-flag@^1.0.0:
317
+ version "1.0.0"
318
+ resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
319
+ integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
320
+
321
+ tr46@~0.0.3:
322
+ version "0.0.3"
323
+ resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
324
+ integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=
325
+
326
+ webidl-conversions@^3.0.0:
327
+ version "3.0.1"
328
+ resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
329
+ integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=
330
+
331
+ whatwg-url@^5.0.0:
332
+ version "5.0.0"
333
+ resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d"
334
+ integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0=
335
+ dependencies:
336
+ tr46 "~0.0.3"
337
+ webidl-conversions "^3.0.0"
338
+
339
+ wrappy@1:
340
+ version "1.0.2"
341
+ resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
342
+ integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridgetown-lit-renderer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 2.0.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-04 00:00:00.000000000 Z
11
+ date: 2022-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bridgetown
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.15'
19
+ version: '1.0'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '2.0'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '0.15'
29
+ version: '1.0'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '2.0'
@@ -86,12 +86,13 @@ dependencies:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0.3'
89
- description:
89
+ description:
90
90
  email: maintainers@bridgetownrb.com
91
91
  executables: []
92
92
  extensions: []
93
93
  extra_rdoc_files: []
94
94
  files:
95
+ - ".github/workflows/ci.yml"
95
96
  - ".gitignore"
96
97
  - ".rubocop.yml"
97
98
  - CHANGELOG.md
@@ -106,17 +107,17 @@ files:
106
107
  - lib/bridgetown-lit-renderer/version.rb
107
108
  - package.json
108
109
  - src/build.js
109
- - src/import-meta-url-shim.js
110
110
  - src/serve.js
111
- - src/ssr_exec.js
111
+ - src/server/import-meta-url-shim.js
112
+ - src/server/ssr_exec.js
112
113
  - yarn.lock
113
114
  homepage: https://github.com/bridgetownrb/bridgetown-lit-renderer
114
115
  licenses:
115
116
  - MIT
116
117
  metadata:
117
- yarn-add: bridgetown-lit-renderer@1.1.1
118
+ yarn-add: bridgetown-lit-renderer@2.0.0.beta1
118
119
  rubygems_mfa_required: 'true'
119
- post_install_message:
120
+ post_install_message:
120
121
  rdoc_options: []
121
122
  require_paths:
122
123
  - lib
@@ -124,15 +125,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
124
125
  requirements:
125
126
  - - ">="
126
127
  - !ruby/object:Gem::Version
127
- version: 2.5.0
128
+ version: 2.7.0
128
129
  required_rubygems_version: !ruby/object:Gem::Requirement
129
130
  requirements:
130
- - - ">="
131
+ - - ">"
131
132
  - !ruby/object:Gem::Version
132
- version: '0'
133
+ version: 1.3.1
133
134
  requirements: []
134
- rubygems_version: 3.1.4
135
- signing_key:
135
+ rubygems_version: 3.2.22
136
+ signing_key:
136
137
  specification_version: 4
137
138
  summary: Simple pipeline for SSR + hydration of Lit components
138
139
  test_files: []