Skip to content

Commit

Permalink
Merge branch 'main' into dsw-000-consistent-type-imports
Browse files Browse the repository at this point in the history
  • Loading branch information
xander-marjoram authored Jul 23, 2024
2 parents 2dacf17 + 0e2456c commit 9e7e73a
Show file tree
Hide file tree
Showing 74 changed files with 1,157 additions and 618 deletions.
5 changes: 0 additions & 5 deletions .changeset/blue-yaks-mix.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/curly-tomatoes-leave.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/dry-frogs-grin.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/neat-lies-relax.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/nervous-ducks-repeat.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/nervous-singers-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wc-react18": minor
---

[Added] - pie-webc integration and switch to using vite to resolve bundling error
5 changes: 0 additions & 5 deletions .changeset/polite-bugs-think.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/red-dingos-wash.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/silver-dryers-attack.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/wicked-crews-serve.md

This file was deleted.

6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 2.62.0

### Minor Changes

- [Changed] - Let commitizen read ticket number from branch name ([#1614](https://github.com/justeattakeaway/pie/pull/1614)) by [@xander-marjoram](https://github.com/xander-marjoram)

## 2.61.3

### Patch Changes
Expand Down
11 changes: 11 additions & 0 deletions apps/examples/wc-angular12/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# wc-angular12

## 0.5.0

### Minor Changes

- [Added] pie-webc integration to angular examples app ([#1611](https://github.com/justeattakeaway/pie/pull/1611)) by [@kevinrodrigues](https://github.com/kevinrodrigues)

### Patch Changes

- Updated dependencies []:
- @justeattakeaway/pie-webc@0.5.14

## 0.4.43

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions apps/examples/wc-angular12/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wc-angular12",
"version": "0.4.43",
"version": "0.5.0",
"private": true,
"scripts": {
"ng": "ng",
Expand All @@ -18,7 +18,7 @@
"@angular/platform-browser-dynamic": "15.2.0",
"@angular/router": "15.2.0",
"@justeattakeaway/pie-css": "0.12.1",
"@justeattakeaway/pie-webc": "0.5.13",
"@justeattakeaway/pie-webc": "0.5.14",
"rxjs": "7.8.0",
"tslib": "2.3.0",
"zone.js": "0.12.0"
Expand Down
11 changes: 11 additions & 0 deletions apps/examples/wc-next10/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# wc-next10

## 0.6.0

### Minor Changes

- [Added] pie-webc integration to next10 example app ([#1617](https://github.com/justeattakeaway/pie/pull/1617)) by [@kevinrodrigues](https://github.com/kevinrodrigues)

### Patch Changes

- Updated dependencies []:
- @justeattakeaway/pie-webc@0.5.14

## 0.5.46

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions apps/examples/wc-next10/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wc-next10",
"version": "0.5.46",
"version": "0.6.0",
"private": true,
"scripts": {
"dev": "next dev",
Expand All @@ -11,7 +11,7 @@
},
"dependencies": {
"@justeattakeaway/pie-css": "0.12.1",
"@justeattakeaway/pie-webc": "0.5.13",
"@justeattakeaway/pie-webc": "0.5.14",
"@lit/react": "1.0.2",
"next": "10.2.3",
"next-transpile-modules": "4.1.0",
Expand Down
11 changes: 11 additions & 0 deletions apps/examples/wc-next13/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# wc-next13

## 0.4.0

### Minor Changes

- [Added] - pie-webc integration to next13 example apps ([#1613](https://github.com/justeattakeaway/pie/pull/1613)) by [@kevinrodrigues](https://github.com/kevinrodrigues)

### Patch Changes

- Updated dependencies []:
- @justeattakeaway/pie-webc@0.5.14

## 0.3.43

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions apps/examples/wc-next13/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "wc-next13",
"private": true,
"version": "0.3.43",
"version": "0.4.0",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -11,7 +11,7 @@
},
"dependencies": {
"@justeattakeaway/pie-css": "0.12.1",
"@justeattakeaway/pie-webc": "0.5.13",
"@justeattakeaway/pie-webc": "0.5.14",
"@lit-labs/nextjs": "0.2.0",
"@lit/react": "1.0.5",
"next": "13.5.5",
Expand Down
7 changes: 7 additions & 0 deletions apps/examples/wc-nuxt2/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# wc-nuxt2

## 0.7.1

### Patch Changes

- Updated dependencies []:
- @justeattakeaway/pie-webc@0.5.14

## 0.7.0

### Minor Changes
Expand Down
4 changes: 2 additions & 2 deletions apps/examples/wc-nuxt2/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "wc-nuxt2",
"author": "Just Eat Takeaway.com - Design System Team",
"version": "0.7.0",
"version": "0.7.1",
"private": true,
"scripts": {
"dev": "nuxt",
Expand All @@ -11,7 +11,7 @@
},
"dependencies": {
"@justeattakeaway/pie-css": "0.12.1",
"@justeattakeaway/pie-webc": "0.5.13",
"@justeattakeaway/pie-webc": "0.5.14",
"core-js": "3.30.0",
"nuxt": "2.17.0",
"vue": "2.7.16",
Expand Down
7 changes: 7 additions & 0 deletions apps/examples/wc-nuxt3/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# wc-nuxt3

## 0.6.1

### Patch Changes

- Updated dependencies []:
- @justeattakeaway/pie-webc@0.5.14

## 0.6.0

### Minor Changes
Expand Down
4 changes: 2 additions & 2 deletions apps/examples/wc-nuxt3/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wc-nuxt3",
"version": "0.6.0",
"version": "0.6.1",
"private": true,
"scripts": {
"build:examples": "nuxt build",
Expand All @@ -11,7 +11,7 @@
},
"dependencies": {
"@justeattakeaway/pie-css": "0.12.1",
"@justeattakeaway/pie-webc": "0.5.13",
"@justeattakeaway/pie-webc": "0.5.14",
"nuxt-ssr-lit": "1.6.5"
},
"devDependencies": {
Expand Down
1 change: 0 additions & 1 deletion apps/examples/wc-react18/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
module.exports = {
root: true,
extends: [
require.resolve('@justeattakeaway/eslint-config-pie/strict'),
],
Expand Down
31 changes: 22 additions & 9 deletions apps/examples/wc-react18/.gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
node_modules
dist
dist-ssr
*.local

# production
/build
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
19 changes: 10 additions & 9 deletions apps/examples/wc-react18/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
## How to use React App
# React + Vite

### `yarn dev`
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

### `yarn build`

Builds the app for production to the `build` folder.\
### `yarn dev`

Runs the app in the development mode.

#### Using Web Components in React

React 18 and previous versions don't handle web components and custom elements out of the box correctly in all cases due to how React treats custom props and events (More details can be found [here](https://lit.dev/docs/frameworks/react/)). Our solution for this is to wrap the web component to include the `[@lit/react](https://lit.dev/docs/frameworks/react/)` package, generating a `react` file inside the component's `dist` folder.
React 18 and previous versions don't handle web components and custom elements out of the box correctly in all cases due to how React treats custom props and events (More details can be found [here](https://lit.dev/docs/frameworks/react/)). Our solution for this is to wrap the web component to include the `[@lit/react](https://lit.dev/docs/frameworks/react/)` package, generating a `react` file inside the component's `dist` folder.

Therefore, in order to import the web component into your React application, please use:
### Example

import { PieButton } from '@justeattakeaway/pie-button/dist/react';
import { PieButton } from '@justeattakeaway/pie-webc/react/button.js';
13 changes: 13 additions & 0 deletions apps/examples/wc-react18/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
26 changes: 19 additions & 7 deletions apps/examples/wc-react18/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
{
"name": "wc-react18",
"version": "0.5.42",
"private": true,
"version": "0.5.42",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"@justeattakeaway/pie-button": "0.47.8",
"@justeattakeaway/pie-css": "0.12.1",
"@justeattakeaway/pie-webc": "0.5.13",
"@lit/react": "1.0.5",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-scripts": "5.0.1"
"react-dom": "18.3.1"
},
"scripts": {
"dev": "react-scripts start",
"build:examples": "react-scripts build"
"devDependencies": {
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"@vitejs/plugin-react": "4.3.1",
"eslint": "8.57.0",
"eslint-plugin-react": "7.34.3",
"eslint-plugin-react-hooks": "4.6.2",
"eslint-plugin-react-refresh": "0.4.7",
"vite": "5.3.4"
},
"browserslist": [
"extends @justeattakeaway/browserslist-config-pie"
Expand Down
20 changes: 0 additions & 20 deletions apps/examples/wc-react18/public/index.html

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,10 @@
* {
font-family: JETSansDigital, Arial, sans-serif;
}

#root {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}
Loading

0 comments on commit 9e7e73a

Please sign in to comment.