-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* new looks of tabs * add graphiql react too * all fixes * more polishing * more * more * more * more * more * prettier * polish changeset * disable shrinking while changing the operation name * Update packages/graphiql-react/src/ui/tabs.css Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com> * yarn i * apply new design changes * prettier * vite more more more * fix demo * fix cspell * fix dev * update cypress to v13 * upd cache key * Update .changeset/thirty-spoons-call.md * Update packages/graphiql/vite.config.mts * merge * add changeset * yarn.lock --------- Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
- Loading branch information
1 parent
3c1a345
commit 5d90e0e
Showing
14 changed files
with
632 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'graphiql': major | ||
--- | ||
|
||
migrate from `webpack` to `vite` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/test/images/logo.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>GraphiQL</title> | ||
<style> | ||
body { | ||
margin: 0; | ||
} | ||
|
||
#graphiql { | ||
height: 100dvh; | ||
} | ||
|
||
.loading { | ||
height: 100%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: 4rem; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="graphiql"> | ||
<div class="loading">Loading…</div> | ||
</div> | ||
<script type="module"> | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom/client'; | ||
import GraphiQL from './src/cdn'; | ||
|
||
Object.assign(globalThis, { | ||
React, | ||
ReactDOM, | ||
GraphiQL, | ||
}); | ||
</script> | ||
<script type="module" src="resources/renderExample.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
module.exports = ({ options, webpackLoaderContext }) => ({ | ||
module.exports = { | ||
plugins: { | ||
// https://github.com/postcss/postcss-import/issues/442#issuecomment-822427606 | ||
'postcss-import': { root: webpackLoaderContext.context }, | ||
// contains autoprefixer, etc | ||
'postcss-preset-env': options['postcss-preset-env'] || false, | ||
cssnano: process.env.NODE_ENV === 'production' ? options.cssnano : false, | ||
'postcss-import': '', | ||
'postcss-lightningcss': { | ||
browsers: '>= .25%', | ||
}, | ||
}, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/test/images/logo.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>GraphiQL</title> | ||
<style> | ||
body { | ||
margin: 0; | ||
} | ||
|
||
#graphiql { | ||
height: 100dvh; | ||
} | ||
|
||
.loading { | ||
height: 100%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: 4rem; | ||
} | ||
</style> | ||
<script | ||
crossorigin | ||
src="https://unpkg.com/react@18/umd/react.development.js" | ||
></script> | ||
<script | ||
crossorigin | ||
src="https://unpkg.com/react-dom@18/umd/react-dom.development.js" | ||
></script> | ||
<link href="/dist/style.css" rel="stylesheet" /> | ||
<script src="/dist/index.umd.js"></script> | ||
</head> | ||
<body> | ||
<div id="graphiql"> | ||
<div class="loading">Loading…</div> | ||
</div> | ||
<script type="module" src="/resources/renderExample.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { defineConfig } from 'vite'; | ||
import packageJSON from './package.json'; | ||
import dts from 'vite-plugin-dts'; | ||
import commonjs from 'vite-plugin-commonjs'; | ||
|
||
const umdConfig = defineConfig({ | ||
define: { | ||
'process.env.NODE_ENV': `"${process.env.NODE_ENV}"`, | ||
}, | ||
// To bundle `const { createClient } = require('graphql-ws')` in `createWebsocketsFetcherFromUrl` function | ||
plugins: [commonjs()], | ||
build: { | ||
sourcemap: true, | ||
emptyOutDir: false, | ||
lib: { | ||
entry: 'src/cdn.ts', | ||
// 👇 The name of the exposed global variable. Required when the formats option includes umd or iife | ||
name: 'GraphiQL', | ||
fileName: 'index', | ||
formats: ['umd'], | ||
}, | ||
rollupOptions: { | ||
external: ['react', 'react-dom'], | ||
output: { | ||
globals: { | ||
react: 'React', | ||
'react-dom': 'ReactDOM', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
||
const esmConfig = defineConfig({ | ||
build: { | ||
minify: false, | ||
sourcemap: true, | ||
lib: { | ||
entry: 'src/index.ts', | ||
fileName: 'index', | ||
formats: ['cjs', 'es'], | ||
}, | ||
rollupOptions: { | ||
external: [ | ||
// Exclude peer dependencies and dependencies from bundle | ||
...Object.keys(packageJSON.peerDependencies), | ||
...Object.keys(packageJSON.dependencies), | ||
], | ||
}, | ||
}, | ||
server: { | ||
// prevent browser window from opening automatically | ||
open: false, | ||
proxy: { | ||
'/graphql': 'http://localhost:8080', | ||
'/bad/graphql': 'http://localhost:8080', | ||
'/http-error/graphql': 'http://localhost:8080', | ||
'/graphql-error/graphql': 'http://localhost:8080', | ||
'/subscriptions': { | ||
target: 'ws://localhost:8081', | ||
ws: true, | ||
}, | ||
}, | ||
}, | ||
plugins: [dts({ rollupTypes: true })], | ||
}); | ||
|
||
export default process.env.UMD === 'true' ? umdConfig : esmConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,6 +114,7 @@ linenumber | |
linenumbers | ||
linkify | ||
listbox | ||
lightningcss | ||
listvalues | ||
lostplan | ||
maint | ||
|
Oops, something went wrong.