Docusaurus: Replant Playground (#1331)
Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1331 This lifts and copies code from the Yoga Playground component of the old website, to the new one, using a live workspace version of JS Yoga. This may eventually be used if the new website is fleshed out, but this also gives us real-world validation of the Yoga bindings in a web scenario, compared to the Node test runner. There is still some cleanup here needed, but we are able to bundle, typecheck, and render the playground now. The code here is mostly the same as before, but I removed some of the cruftier bits (e.g. URL shortener that goes to some private Heroku instance), and needed to do some tweaks for the new Yoga package, and TypeScript. This is currently using `yoga-layout/sync`, the asmjs bindings. But I had previously checked bundling against the wasm ones. Reviewed By: cortinico Differential Revision: D46884439 fbshipit-source-id: f53f0855c131cd2b81975bf05f71c43713600616
This commit is contained in:
committed by
Facebook GitHub Bot
parent
6ae890dccd
commit
45088187a7
28
website-next/src/components/Playground/PositionRecord.tsx
Normal file
28
website-next/src/components/Playground/PositionRecord.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {Record} from 'immutable';
|
||||
|
||||
export type PositionRecordType = ReturnType<PositionRecordFactory>;
|
||||
|
||||
export type PositionRecordFactory = Record.Factory<{
|
||||
top: string | number,
|
||||
right: string | number,
|
||||
bottom: string | number,
|
||||
left: string | number,
|
||||
}>;
|
||||
|
||||
const r: PositionRecordFactory = Record({
|
||||
top: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
});
|
||||
|
||||
export default r;
|
Reference in New Issue
Block a user