This document is a work-in-progress exploration of how the "oneOf" solution to input polymorphism might work within a GraphQL schema.
For the examples below, we'll be using the following shared types using existing GraphQL syntax:
| const defaultTheme = require('tailwindcss/defaultTheme'); | |
| module.exports = { | |
| purge: [ | |
| './vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php', | |
| './storage/framework/views/*.php', | |
| './resources/views/**/*.blade.php', | |
| './resources/js/**/*.vue', | |
| ], | |
| <!-- | |
| * Copyright (c) 2021 GraphQL Contributors | |
| * All rights reserved. | |
| * | |
| * This code is licensed under the MIT license. | |
| * Use it however you wish. | |
| --> | |
| <!DOCTYPE html> | |
| <html> | |
| <head> |
| /** | |
| * This is a Live Query polyfill, as graphql-js does not strictly have support for that. Instead, we leave it up to the | |
| * client to recognize a Live Query is requested with the `@live` directive on a `query` operation and here we | |
| * transform it into a `live` subscription instead. | |
| * | |
| * Consider a schema like the following: | |
| * | |
| * ```graphql | |
| type Badge { | |
| id: ID! |
Recently, I've been working a lot more with GitHub Actions - both writing actions and creating CI pipelines for projects.
Last week I picked up a project I started a bit ago: the nodejs/examples repository.
Note: The examples repository is still in early stages. As such, there's still a bunch of WIP work we're doing - we've intentionally not talked a bunch publicly about it yet. That said, if you're interested in helping, feel free to reach out to me on Twitter or the OpenJS Slack ❤️
The goal of this repository is to be home to a bunch of distinct and well-tested examples of real-world Node.js that go beyond "hello, world!". This means there's hopefully going to be a boatload of distinct projects in there.
Install, build and debug a react native app in WSL2 (Windows Subsystem for Linux) and Ubuntu.
| const env = new Environment({ | |
| network, | |
| store, | |
| handlerProvider: RelayDefaultHandlerProvider, | |
| log: isDev ? relayTransactionLogger : null, | |
| }); | |
| if (isDev) { | |
| window.relayEnvironment = env; | |
| window.debugRelayStore = () => |
A compile-time 4-Bit Virtual Machine implemented in TypeScript's type system. Capable of running a sample 'FizzBuzz' program.
Syntax emits zero JavaScript.
type RESULT = VM<
[
["push", N_1], // 1
["push", False], // 2
["peek", _], // 3| const NO_VALUE_SYMBOL = Symbol("USE_RESET_STATE_NO_VALUE"); | |
| const useResetState = (createValue, deps = []) => { | |
| const [, triggerRerender] = useState(createValue); | |
| const stateRef = useRef(NO_VALUE_SYMBOL); | |
| const depsRef = useRef(deps); | |
| if (stateRef.current === NO_VALUE_SYMBOL) { | |
| stateRef.current = createValue(); | |
| } | |
| if (depsRef.current.some((value, index) => value !== deps[index])) { |
| diff --git a/node_modules/react-scripts/config/webpack.config.js b/node_modules/react-scripts/config/webpack.config.js | |
| index 8f70442..dfd86d8 100644 | |
| --- a/node_modules/react-scripts/config/webpack.config.js | |
| +++ b/node_modules/react-scripts/config/webpack.config.js | |
| @@ -47,6 +47,10 @@ const shouldInlineRuntimeChunk = process.env.INLINE_RUNTIME_CHUNK !== 'false'; | |
| // Check if TypeScript is setup | |
| const useTypeScript = fs.existsSync(paths.appTsConfig); | |
| +// Skip TypeScript type checking | |
| +const typeCheckTypeScript = |