Skip to content

Commit 8b2d079

Browse files
committed
more lit-element => lit v2 doc updates
1 parent 21581ca commit 8b2d079

File tree

7 files changed

+49
-13
lines changed

7 files changed

+49
-13
lines changed

docs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@
4545
"animated-scroll-to": "^2.0.12",
4646
"bridgetown-quick-search": "1.0.5",
4747
"bulma": "^0.9.1",
48-
"lit-element": "^2.4.0"
48+
"lit": "^2.0.0"
4949
}
5050
}

docs/src/_docs/filters/esm.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ import Something from "./lib/something"
2222
import Something, "./lib/something"
2323
# => import Something from "./lib/something"
2424

25-
import [ LitElement, html, css ], from: "lit-element"
26-
# => import { LitElement, html, css } from "lit-element"
25+
import [ LitElement, html, css ], from: "lit"
26+
# => import { LitElement, html, css } from "lit"
2727

2828
import React, from: "react"
2929
# => import React from "react"
@@ -80,12 +80,12 @@ to the `Ruby2JS.convert` method. (NOTE: use camelCase names, not snake_case.) Ex
8080
```ruby
8181
require "ruby2js/filter/esm"
8282
puts Ruby2JS.convert('class MyElement < LitElement; end',
83-
eslevel: 2020, autoimports: {[:LitElement] => "lit-element"})
83+
eslevel: 2020, autoimports: {[:LitElement] => "lit"})
8484
```
8585

8686
```js
8787
// JavaScript output:
88-
import { LitElement } from "lit-element"
88+
import { LitElement } from "lit"
8989
class MyElement extends LitElement {}
9090
```
9191

docs/src/_docs/options.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ See [the ESM filter](filters/esm#autoimports) for details.
2929
```ruby
3030
require 'ruby2js/filter/esm'
3131
puts Ruby2JS.convert('class MyElement < LitElement; end',
32-
eslevel: 2020, autoimports: {[:LitElement] => 'lit-element'})
32+
eslevel: 2020, autoimports: {[:LitElement] => 'lit'})
3333
```
3434

3535
## Binding

docs/src/_docs/snowpack.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ An example of all of the supported options:
5252
```json
5353
{
5454
"autoexports": true,
55-
"autoimports": {"[:LitElement]": "lit-element"},
55+
"autoimports": {"[:LitElement]": "lit"},
5656
"comparison": "identity",
5757
"defs": {"A": ["x", "@y"]},
5858
"eslevel": 2021,

docs/src/_docs/webpack.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ You'll need to edit your Webpack config so it can use the `@ruby2js/webpack-load
9393

9494
Now wherever you save your `.js` files, you can write `.js.rb` files which will be converted to Javascript and processed through Babel. You'll probably have a main `index.js` file already, so you can simply import the Ruby files from there and elsewhere. You'll have to include the full extension in the import statement, i.e. `import MyClass from "./lib/my_class.js.rb"`.
9595

96-
See the next example in the Rails section for how to write a web component based on open standards using [LitElement](https://lit-element.polymer-project.org).
96+
See the next example in the Rails section for how to write a web component based on open standards using [LitElement](https://lit.dev/).
9797

9898
## Source Maps
9999

@@ -147,7 +147,7 @@ environment.loaders.append('rb2js', {
147147

148148
Now, by way of example, let's create a wrapper component around the [Duet Date Picker](https://duetds.github.io/date-picker/) component we can use to customize the picker component and handle change events.
149149

150-
First, run `yarn add lit-element @duetds/date-picker` to add the Javascript dependencies.
150+
First, run `yarn add lit @duetds/date-picker` to add the Javascript dependencies.
151151

152152
Next, in `app/javascript/packs/application.js`, add:
153153

@@ -183,12 +183,14 @@ And the Rails view template: `app/components/date_picker_component.html.erb`:
183183
<app-date-picker identifier="<%= @identifier %>" value="<%= @date.strftime("%Y-%m-%d") %>"></app-date-picker>
184184
```
185185

186-
Hey, what's all this custom element stuff? Well that's what we're going to define now! Let's use Ruby to write a web component using the [LitElement library](https://lit-element.polymer-project.org).
186+
Hey, what's all this custom element stuff? Well that's what we're going to
187+
define now! Let's use Ruby to write a web component using the
188+
[LitElement library](https://lit.dev/).
187189

188190
Simply create `app/components/date_picker_element.js.rb`:
189191

190192
```ruby
191-
import [ LitElement, html ], from: "lit-element"
193+
import [ LitElement, html ], from: "lit"
192194
import [ DuetDatePicker ], from: "@duetds/date-picker/custom-element"
193195
import "@duetds/date-picker/dist/duet/themes/default.css"
194196

docs/src/_examples/rails/lit.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ contents:
4949

5050
<div data-controller="combo" data-options='{
5151
"eslevel": 2022,
52-
"filters": ["esm", "lit-element", "functions"]
52+
"filters": ["esm", "lit", "functions"]
5353
}'></div>
5454

5555
```ruby

docs/yarn.lock

+35-1
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,11 @@
10701070
resolved "https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.0.0-beta.2.tgz#64ca67af9cc473ca97bb99d98fee5bc08e4c3914"
10711071
integrity sha512-rp2XojlugD0mvqi3qbqM660PbjqS7hnq/8FYa7SK/DL2rvWDu0/Ka3KW8cyXtcB1RiVG4nX5Oh4oq3nmuDjENQ==
10721072

1073+
"@lit/reactive-element@^1.0.0":
1074+
version "1.0.0"
1075+
resolved "https://registry.yarnpkg.com/@lit/reactive-element/-/reactive-element-1.0.0.tgz#7b6e6a85709cda0370c47e425ac2f3b553696a4b"
1076+
integrity sha512-Kpgenb8UNFsKCsFhggiVvUkCbcFQSd6N8hffYEEGjz27/4rw3cTSsmP9t3q1EHOAsdum60Wo64HvuZDFpEwexA==
1077+
10731078
"@nodelib/fs.scandir@2.1.4":
10741079
version "2.1.4"
10751080
resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz"
@@ -1180,6 +1185,11 @@
11801185
dependencies:
11811186
"@types/node" "*"
11821187

1188+
"@types/trusted-types@^2.0.2":
1189+
version "2.0.2"
1190+
resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.2.tgz#fc25ad9943bcac11cceb8168db4f275e0e72e756"
1191+
integrity sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg==
1192+
11831193
"@webassemblyjs/ast@1.9.0":
11841194
version "1.9.0"
11851195
resolved "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz"
@@ -3980,18 +3990,42 @@ limiter@^1.0.5:
39803990
resolved "https://registry.npmjs.org/limiter/-/limiter-1.1.5.tgz"
39813991
integrity sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA==
39823992

3983-
lit-element@^2.3.1, lit-element@^2.4.0:
3993+
lit-element@^2.3.1:
39843994
version "2.4.0"
39853995
resolved "https://registry.npmjs.org/lit-element/-/lit-element-2.4.0.tgz"
39863996
integrity sha512-pBGLglxyhq/Prk2H91nA0KByq/hx/wssJBQFiYqXhGDvEnY31PRGYf1RglVzyLeRysu0IHm2K0P196uLLWmwFg==
39873997
dependencies:
39883998
lit-html "^1.1.1"
39893999

4000+
lit-element@^3.0.0:
4001+
version "3.0.0"
4002+
resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-3.0.0.tgz#0e9e64ddbc3dd6a8da4d6fbfadbc070a54cf0597"
4003+
integrity sha512-oPqRhhBBhs+AlI62QLwtWQNU/bNK/h2L1jI3IDroqZubo6XVAkyNy2dW3CRfjij8mrNlY7wULOfyyKKOnfEePA==
4004+
dependencies:
4005+
"@lit/reactive-element" "^1.0.0"
4006+
lit-html "^2.0.0"
4007+
39904008
lit-html@^1.1.1:
39914009
version "1.3.0"
39924010
resolved "https://registry.npmjs.org/lit-html/-/lit-html-1.3.0.tgz"
39934011
integrity sha512-0Q1bwmaFH9O14vycPHw8C/IeHMk/uSDldVLIefu/kfbTBGIc44KGH6A8p1bDfxUfHdc8q6Ct7kQklWoHgr4t1Q==
39944012

4013+
lit-html@^2.0.0:
4014+
version "2.0.0"
4015+
resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-2.0.0.tgz#ba6779269c382e66d7403a96ed99516ccc3d658b"
4016+
integrity sha512-tJsCapCmc0vtLj6harqd6HfCxnlt/RSkgowtz4SC9dFE3nSL38Tb33I5HMDiyJsRjQZRTgpVsahrnDrR9wg27w==
4017+
dependencies:
4018+
"@types/trusted-types" "^2.0.2"
4019+
4020+
lit@^2.0.0:
4021+
version "2.0.0"
4022+
resolved "https://registry.yarnpkg.com/lit/-/lit-2.0.0.tgz#7710095dc518d9858dde579e9c76b9eed71e98ba"
4023+
integrity sha512-pqi5O/wVzQ9Bn4ERRoYQlt1EAUWyY5Wv888vzpoArbtChc+zfUv1XohRqSdtQZYCogl0eHKd+MQwymg2XJfECg==
4024+
dependencies:
4025+
"@lit/reactive-element" "^1.0.0"
4026+
lit-element "^3.0.0"
4027+
lit-html "^2.0.0"
4028+
39954029
load-json-file@^1.0.0:
39964030
version "1.1.0"
39974031
resolved "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz"

0 commit comments

Comments
 (0)