Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example: migrate multiple-instances to ESM #4007

Merged
merged 3 commits into from Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.js
Expand Up @@ -195,6 +195,7 @@ module.exports = {
'examples/aws-presigned-url/*.js',
'examples/bundled/*.js',
'examples/custom-provider/client/*.js',
'examples/multiple-instances/*.js',
'private/dev/*.js',
'private/release/*.js',
'private/remark-lint-uppy/*.js',
Expand Down
1 change: 0 additions & 1 deletion examples/multiple-instances/.gitignore

This file was deleted.

Expand Up @@ -8,14 +8,14 @@ It has two instances on the same page, side-by-side, but with different `id`s so
To run this example, make sure you've correctly installed the **repository root**:

```bash
npm install
npm run build
corepack yarn install
corepack yarn build
```

That will also install the dependencies for this example.

Then, again in the **repository root**, start this example by doing:

```bash
npm run example multiple-instances
corepack yarn workspace @uppy-example/multiple-instances start
```
8 changes: 4 additions & 4 deletions examples/multiple-instances/index.html
Expand Up @@ -4,8 +4,6 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Uppy example: Multiple instances</title>
</head>
<body>
<style>
main {
display: flex;
Expand All @@ -14,6 +12,8 @@
}
h1 { text-align: center }
</style>
</head>
<body>
<main>
<div>
<h1>Instance A</h1>
Expand All @@ -24,8 +24,8 @@ <h1>Instance B</h1>
<div id="b"></div>
</div>
</main>
<noscript>This app requires JavaScript to be enabled.</noscript>

<link href="uppy.min.css" rel="stylesheet">
<script src="bundle.js"></script>
<script src="./main.js" type="module"></script>
</body>
</html>
8 changes: 5 additions & 3 deletions examples/multiple-instances/main.js
@@ -1,6 +1,8 @@
const Uppy = require('@uppy/core')
const Dashboard = require('@uppy/dashboard')
const GoldenRetriever = require('@uppy/golden-retriever')
import Uppy from '@uppy/core'
import Dashboard from '@uppy/dashboard'
import GoldenRetriever from '@uppy/golden-retriever'

import '@uppy/dashboard/dist/style.css'
aduh95 marked this conversation as resolved.
Show resolved Hide resolved

// Initialise two Uppy instances with the GoldenRetriever plugin,
// but with different `id`s.
Expand Down
12 changes: 6 additions & 6 deletions examples/multiple-instances/package.json
@@ -1,17 +1,17 @@
{
"name": "@uppy-example/multiple-instances",
"version": "0.0.0",
"type": "module",
"dependencies": {
"@babel/core": "^7.4.4",
"@uppy/core": "workspace:*",
"@uppy/dashboard": "workspace:*",
"@uppy/golden-retriever": "workspace:*",
"babelify": "^10.0.0",
"budo": "^11.6.1"
"@uppy/golden-retriever": "workspace:*"
},
"devDependencies": {
"vite": "^3.0.0"
},
"private": true,
"scripts": {
"css": "cp ../../packages/uppy/dist/uppy.min.css .",
"start": "yarn run css && budo main.js:bundle.js -- -t babelify"
"start": "vite"
}
}
4 changes: 1 addition & 3 deletions yarn.lock
Expand Up @@ -8392,12 +8392,10 @@ __metadata:
version: 0.0.0-use.local
resolution: "@uppy-example/multiple-instances@workspace:examples/multiple-instances"
dependencies:
"@babel/core": ^7.4.4
"@uppy/core": "workspace:*"
"@uppy/dashboard": "workspace:*"
"@uppy/golden-retriever": "workspace:*"
babelify: ^10.0.0
budo: ^11.6.1
vite: ^3.0.0
languageName: unknown
linkType: soft

Expand Down