Skip to content

Commit

Permalink
[examples] Update examples to use Lit 3 (#1230)
Browse files Browse the repository at this point in the history
* Update v3 base config to drop pre versions

* Update motion examples

* Update react examples
  • Loading branch information
augustjk authored Oct 18, 2023
1 parent 41d024c commit 671bc83
Show file tree
Hide file tree
Showing 17 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"styles.ts": {},
"index.html": {},
"package.json": {
"content": "{\n \"dependencies\": {\n \"lit\": \"^2.7.4\",\n \"@lit-labs/motion\": \"^1.0.3\"\n }\n}",
"content": "{\n \"dependencies\": {\n \"lit\": \"^3.0.0\",\n \"@lit-labs/motion\": \"^1.0.3\"\n }\n}",
"hidden": true
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"styles.ts": {},
"index.html": {},
"package.json": {
"content": "{\n \"dependencies\": {\n \"lit\": \"^2.7.4\",\n \"@lit-labs/motion\": \"^1.0.3\"\n }\n}",
"content": "{\n \"dependencies\": {\n \"lit\": \"^3.0.0\",\n \"@lit-labs/motion\": \"^1.0.3\"\n }\n}",
"hidden": true
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"support.ts": {},
"index.html": {},
"package.json": {
"content": "{\n \"dependencies\": {\n \"lit\": \"^2.7.4\",\n \"@lit-labs/motion\": \"^1.0.3\"\n }\n}",
"content": "{\n \"dependencies\": {\n \"lit\": \"^3.0.0\",\n \"@lit-labs/motion\": \"^1.0.3\"\n }\n}",
"hidden": true
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"styles.ts": {},
"index.html": {},
"package.json": {
"content": "{\n \"dependencies\": {\n \"lit\": \"^2.7.4\",\n \"@lit-labs/motion\": \"^1.0.3\"\n }\n}",
"content": "{\n \"dependencies\": {\n \"lit\": \"^3.0.0\",\n \"@lit-labs/motion\": \"^1.0.3\"\n }\n}",
"hidden": true
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"styles.ts": {},
"index.html": {},
"package.json": {
"content": "{\n \"dependencies\": {\n \"lit\": \"^2.7.4\",\n \"@lit-labs/motion\": \"^1.0.3\"\n }\n}",
"content": "{\n \"dependencies\": {\n \"lit\": \"^3.0.0\",\n \"@lit-labs/motion\": \"^1.0.3\"\n }\n}",
"hidden": true
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"motion-slide.ts": {},
"index.html": {},
"package.json": {
"content": "{\n \"dependencies\": {\n \"lit\": \"^2.7.4\",\n \"@lit-labs/motion\": \"^1.0.3\"\n }\n}",
"content": "{\n \"dependencies\": {\n \"lit\": \"^3.0.0\",\n \"@lit-labs/motion\": \"^1.0.3\"\n }\n}",
"hidden": true
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"styles.ts": {},
"index.html": {},
"package.json": {
"content": "{\n \"dependencies\": {\n \"lit\": \"^2.0.0\",\n \"@lit-labs/motion\": \"^1.0.1\",\n \"@material/mwc-textfield\": \"^0.25.1\",\n \"@material/mwc-checkbox\": \"^0.25.1\",\n \"@material/mwc-button\": \"^0.25.1\",\n \"@material/mwc-formfield\": \"^0.25.1\"\n }\n}",
"content": "{\n \"dependencies\": {\n \"lit\": \"^3.0.0\",\n \"@lit-labs/motion\": \"^1.0.1\",\n \"@material/mwc-textfield\": \"^0.25.1\",\n \"@material/mwc-checkbox\": \"^0.25.1\",\n \"@material/mwc-button\": \"^0.25.1\",\n \"@material/mwc-formfield\": \"^0.25.1\"\n }\n}",
"hidden": true
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'https://esm.sh/react@18';
import {createRoot} from 'https://esm.sh/react-dom@18/client';
import {createComponent} from '@lit-labs/react';
import {createComponent} from '@lit/react';
import {DemoGreeting as DemoGreetingWC} from './demo-greeting.js';

// Creates a React component from a Lit component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"order": 0,
"title": "Basics",
"description": "Render web components in React apps.",
"section": "@lit-labs/react",
"section": "@lit/react",
"files": {
"app.tsx": {
"contentType": "text/typescript-jsx"
Expand All @@ -15,7 +15,7 @@
},
"index.html": {},
"package.json": {
"content": "{\n \"dependencies\": {\n \"lit\": \"^2\",\n \"@types/react\": \"18.2.7\",\n \"@types/react-dom\": \"^18\",\n \"@types/react-dom/client\": \"^18\"\n }\n}",
"content": "{\n \"dependencies\": {\n \"lit\": \"^3\",\n \"@types/react\": \"18.2.7\",\n \"@types/react-dom\": \"^18\",\n \"@types/react-dom/client\": \"^18\"\n }\n}",
"hidden": true
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'https://esm.sh/react@18';
import {createRoot} from 'https://esm.sh/react-dom@18/client';
import {createComponent} from '@lit-labs/react';
import {createComponent} from '@lit/react';
import {ClickRoulette as ClickRouletteWC} from './click-roulette.js';

const ClickRoulette = createComponent({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"order": 1,
"title": "React events",
"description": "Listen to react events from web components.",
"section": "@lit-labs/react",
"section": "@lit/react",
"files": {
"app.tsx": {"contentType": "text/typescript-jsx"},
"click-roulette.ts": {},
Expand All @@ -13,7 +13,7 @@
},
"index.html": {},
"package.json": {
"content": "{\n \"dependencies\": {\n \"lit\": \"^2\",\n \"@types/react\": \"18.2.7\",\n \"@types/react-dom\": \"^18\",\n \"@types/react-dom/client\": \"^18\"\n }\n}",
"content": "{\n \"dependencies\": {\n \"lit\": \"^3\",\n \"@types/react\": \"18.2.7\",\n \"@types/react-dom\": \"^18\",\n \"@types/react-dom/client\": \"^18\"\n }\n}",
"hidden": true
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'https://esm.sh/react@18';
import {createRoot} from 'https://esm.sh/react-dom@18/client';
import {createComponent} from '@lit-labs/react';
import {createComponent} from '@lit/react';
import {FlyingTriangles as FlyingTrianglesWC} from './flying-triangles.js';

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"order": 3,
"title": "Refs",
"description": "Interact with Web Component APIs via Refs.",
"section": "@lit-labs/react",
"section": "@lit/react",
"files": {
"app.tsx": {"contentType": "text/typescript-jsx"},
"flying-triangles.ts": {},
Expand All @@ -13,7 +13,7 @@
},
"index.html": {},
"package.json": {
"content": "{\n \"dependencies\": {\n \"lit\": \"^2\",\n \"@lit-labs/react\": \"^1.1.1\",\n \"@types/react\": \"18.2.7\",\n \"@types/react-dom\": \"^18\",\n \"@types/react-dom/client\": \"^18\"\n }\n}",
"content": "{\n \"dependencies\": {\n \"lit\": \"^3\",\n \"@lit/react\": \"^1\",\n \"@types/react\": \"18.2.7\",\n \"@types/react-dom\": \"^18\",\n \"@types/react-dom/client\": \"^18\"\n }\n}",
"hidden": true
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'https://esm.sh/react@18';
import {createRoot} from 'https://esm.sh/react-dom@18/client';
import {SimpleSlots as SimpleSlotsWC} from './simple-slots.js';
import {createComponent} from '@lit-labs/react';
import {createComponent} from '@lit/react';

const SimpleSlots = createComponent({
react: React,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"index.html": {},
"package.json": {
"content": "{\n \"dependencies\": {\n \"lit\": \"^2\",\n \"@types/react\": \"18.2.7\",\n \"@types/react-dom\": \"^18\",\n \"@types/react-dom/client\": \"^18\"\n }\n}",
"content": "{\n \"dependencies\": {\n \"lit\": \"^3\",\n \"@types/react\": \"18.2.7\",\n \"@types/react-dom\": \"^18\",\n \"@types/react-dom/client\": \"^18\"\n }\n}",
"hidden": true
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/lit-dev-content/samples/v3-base.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"files": {
"package.json": {
"content": "{\n \"dependencies\": {\n \"lit\": \"^3.0.0-pre.1\",\n \"@lit/reactive-element\": \"^2.0.0-pre.1\",\n \"lit-element\": \"^4.0.0-pre.1\",\n \"lit-html\": \"^3.0.0-pre.1\"\n }\n}",
"content": "{\n \"dependencies\": {\n \"lit\": \"^3.0.0\",\n \"@lit/reactive-element\": \"^2.0.0\",\n \"lit-element\": \"^4.0.0\",\n \"lit-html\": \"^3.0.0\"\n }\n}",
"hidden": true
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/lit-dev-content/site/_data/playground_examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const topSectionOrder = [
'Template concepts',
'Directives',
'Managing Data',
'@lit-labs/react',
'@lit/react',
'@lit-labs/motion'
];

Expand Down

0 comments on commit 671bc83

Please sign in to comment.