Skip to content

Commit 160186f

Browse files
committed
fix: remove stray comments etc
1 parent 8ce010e commit 160186f

File tree

5 files changed

+69
-97
lines changed

5 files changed

+69
-97
lines changed

packages/babel-plugin/__fixtures__/colorThemes.js

+8-31
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { colors } from './colors.stylex';
1313

1414
import * as stylex from '@stylexjs/stylex';
1515

16-
// Base WDS color palette; not meant to be used directly. Instead use semantic colors.
1716
const baseColorPalette = {
1817
neutralGray50: '#FAFAFA',
1918
neutralGray75: '#F4F4F4',
@@ -29,29 +28,7 @@ const baseColorPalette = {
2928
neutralGray850: '#1D1F1F',
3029
neutralGray900: '#161717',
3130
neutralGray1000: '#0A0A0A',
32-
// Cool grays left out intentionally; they are not used in Web WDS.
33-
// coolGray50: '#F7F8FA',
34-
// coolGray75: '#F1F2F4',
35-
// coolGray100: '#EAEDEE',
36-
// coolGray200: '#D4D6D8',
37-
// coolGray300: '#B3B9BD',
38-
// coolGray400: '#8D9599',
39-
// coolGray500: '#6C757A',
40-
// coolGray600: '#5B6368',
41-
// coolGray700: '#3E474D',
42-
// coolGray800: '#20272B',
43-
// coolGray900: '#12181C',
44-
// coolGray1000: '#0A1014',
45-
// coolGrayAlpha05: 'rgba(17, 27, 33, 0.05)',
46-
// coolGrayAlpha10: 'rgba(17, 27, 33, 0.1)',
47-
// coolGrayAlpha20: 'rgba(17, 27, 33, 0.2)',
48-
// coolGrayAlpha30: 'rgba(17, 27, 33, 0.3)',
49-
// coolGrayAlpha40: 'rgba(17, 27, 33, 0.4)',
50-
// coolGrayAlpha50: 'rgba(17, 27, 33, 0.5)',
51-
// coolGrayAlpha60: 'rgba(17, 27, 33, 0.6)',
52-
// coolGrayAlpha70: 'rgba(17, 27, 33, 0.7)',
53-
// coolGrayAlpha80: 'rgba(17, 27, 33, 0.8)',
54-
// coolGrayAlpha90: 'rgba(17, 27, 33, 0.9)',
31+
5532
warmGray50: '#FBFAF9',
5633
warmGray75: '#F7F5F3',
5734
warmGray100: '#F1EEEB',
@@ -340,23 +317,23 @@ const colorsDark = {
340317
persistentAlwaysWhite: baseColorPalette.whiteOpaque,
341318
persistentActivityIndicator: baseColorPalette.green400,
342319

343-
productSystemsBubbleSurfaceIncoming: baseColorPalette.neutralGray850, // surfaceElevatedDefault
320+
productSystemsBubbleSurfaceIncoming: baseColorPalette.neutralGray850,
344321
productSystemsBubbleSurfaceOutgoing: baseColorPalette.green750,
345-
productSystemsBubbleContentDeemphasized: baseColorPalette.whiteAlpha60, // contentDeemphasized
322+
productSystemsBubbleContentDeemphasized: baseColorPalette.whiteAlpha60,
346323
productSystemsBubbleSurfaceOverlay: baseColorPalette.blackAlpha20,
347324
productSystemsBubbleSurfaceSystem: baseColorPalette.neutralGray850,
348325
productSystemsBubbleSurfaceE2E: baseColorPalette.neutralGray850,
349-
productSystemsBubbleContentE2E: baseColorPalette.yellow300, // secondaryWarning
326+
productSystemsBubbleContentE2E: baseColorPalette.yellow300,
350327
productSystemsBubbleSurfaceBusiness: baseColorPalette.neutralGray850,
351328
productSystemsBubbleContentBusiness: baseColorPalette.emerald400,
352-
productSystemsChatSurfaceComposer: baseColorPalette.neutralGray800, // surfaceElevatedEmphasized
329+
productSystemsChatSurfaceComposer: baseColorPalette.neutralGray800,
353330
productSystemsChatBackgroundWallpaper: baseColorPalette.neutralGray900,
354331
productSystemsChatForegroundWallpaper: baseColorPalette.whiteAlpha10,
355-
productSystemsChatSurfaceTray: baseColorPalette.neutralGray900, // surfaceDefault
332+
productSystemsChatSurfaceTray: baseColorPalette.neutralGray900,
356333
productSystemsStatusSeen: baseColorPalette.neutralGray500,
357334

358-
internalComponentsSurfaceNavBar: baseColorPalette.neutralGray850, // surfaceEmphasized
359-
internalComponentsActiveListRow: baseColorPalette.whiteAlpha10, // surfaceHighlight
335+
internalComponentsSurfaceNavBar: baseColorPalette.neutralGray850,
336+
internalComponentsActiveListRow: baseColorPalette.whiteAlpha10,
360337
};
361338

362339
const DARK = '@media (prefers-color-scheme: dark)';

packages/babel-plugin/__fixtures__/colors.stylex.js

+54-57
Original file line numberDiff line numberDiff line change
@@ -14,74 +14,71 @@ import * as stylex from '@stylexjs/stylex';
1414
opaque type SemanticColorsTheme: 'theme' = 'theme';
1515

1616
const SemanticColors = {
17-
'--accent': null as null | string,
18-
'--accent-deemphasized': null as null | string,
19-
'--accent-emphasized': null as null | string,
17+
'--accent': 'blue',
18+
'--accent-deemphasized': '#4B91F1',
19+
'--accent-emphasized': 'blue',
2020

21-
'--secondary-negative': null as null | string,
22-
'--secondary-negative-deemphasized': null as null | string,
23-
'--secondary-negative-emphasized': null as null | string,
24-
'--secondary-positive': null as null | string,
25-
'--secondary-positive-deemphasized': null as null | string,
26-
'--secondary-warning': null as null | string,
27-
'--secondary-warning-deemphasized': null as null | string,
21+
'--secondary-negative': '#FF3B30',
22+
'--secondary-negative-deemphasized': '#FF6B61',
23+
'--secondary-negative-emphasized': '#D63029',
24+
'--secondary-positive': '#34C759',
25+
'--secondary-positive-deemphasized': '#65D683',
26+
'--secondary-warning': '#FFCC00',
27+
'--secondary-warning-deemphasized': '#FFD633',
2828

29-
'--content-default': null as null | string,
30-
'--content-deemphasized': null as null | string,
31-
'--content-disabled': null as null | string,
32-
'--content-on-accent': null as null | string,
33-
'--content-action-default': null as null | string,
34-
'--content-action-emphasized': null as null | string,
35-
'--content-external-link': null as null | string,
36-
'--content-inverse': null as null | string,
37-
'--content-read': null as null | string,
29+
'--content-default': '#000000',
30+
'--content-deemphasized': '#666666',
31+
'--content-disabled': '#999999',
32+
'--content-on-accent': '#FFFFFF',
33+
'--content-action-default': '#0A84FF',
34+
'--content-action-emphasized': '#007AFF',
35+
'--content-external-link': '#0A84FF',
36+
'--content-inverse': '#FFFFFF',
37+
'--content-read': '#8E8E93',
3838

39-
'--background-wash-plain': null as null | string,
40-
'--background-wash-inset': null as null | string,
41-
'--background-elevated-wash-plain': null as null | string,
42-
'--background-elevated-wash-inset': null as null | string,
43-
'--background-dimmer': null as null | string,
39+
'--background-wash-plain': '#F2F2F7',
40+
'--background-wash-inset': '#E5E5EA',
41+
'--background-elevated-wash-plain': '#F8F8F8',
42+
'--background-elevated-wash-inset': '#EBEBEB',
43+
'--background-dimmer': 'rgba(0, 0, 0, 0.4)',
4444

45-
'--surface-default': null as null | string,
46-
'--surface-emphasized': null as null | string,
47-
'--surface-elevated-default': null as null | string,
48-
'--surface-elevated-emphasized': null as null | string,
49-
'--surface-highlight': null as null | string,
50-
'--surface-inverse': null as null | string,
51-
'--surface-pressed': null as null | string,
45+
'--surface-default': '#FFFFFF',
46+
'--surface-emphasized': '#F2F2F7',
47+
'--surface-elevated-default': '#FFFFFF',
48+
'--surface-elevated-emphasized': '#F2F2F7',
49+
'--surface-highlight': 'rgba(0, 122, 255, 0.1)',
50+
'--surface-inverse': '#000000',
51+
'--surface-pressed': 'rgba(0, 0, 0, 0.1)',
5252

53-
'--lines-divider': null as null | string,
54-
'--lines-outline-default': null as null | string,
55-
'--lines-outline-deemphasized': null as null | string,
53+
'--lines-divider': '#C6C6C8',
54+
'--lines-outline-default': '#C6C6C8',
55+
'--lines-outline-deemphasized': '#E5E5EA',
5656

57-
'--persistent-always-branded': null as null | string,
58-
'--persistent-always-black': null as null | string,
59-
'--persistent-always-white': null as null | string,
60-
'--persistent-activity-indicator': null as null | string,
57+
'--persistent-always-branded': '#007AFF',
58+
'--persistent-always-black': '#000000',
59+
'--persistent-always-white': '#FFFFFF',
60+
'--persistent-activity-indicator': '#007AFF',
6161

62-
'--systems-bubble-surface-incoming': null as null | string,
63-
'--systems-bubble-surface-outgoing': null as null | string,
64-
'--systems-bubble-content-deemphasized': null as null | string,
65-
'--systems-bubble-surface-overlay': null as null | string,
66-
'--systems-bubble-surface-system': null as null | string,
67-
'--systems-bubble-surface-e2e': null as null | string,
68-
'--systems-bubble-content-e2e': null as null | string,
69-
'--systems-bubble-surface-business': null as null | string,
70-
'--systems-bubble-content-business': null as null | string,
71-
'--systems-chat-surface-composer': null as null | string,
72-
'--systems-chat-background-wallpaper': null as null | string,
73-
'--systems-chat-foreground-wallpaper': null as null | string,
74-
'--systems-chat-surface-tray': null as null | string,
75-
'--systems-status-seen': null as null | string,
62+
'--systems-bubble-surface-incoming': '#E9E9EB',
63+
'--systems-bubble-surface-outgoing': '#007AFF',
64+
'--systems-bubble-content-deemphasized': '#8E8E93',
65+
'--systems-bubble-surface-overlay': 'rgba(0, 0, 0, 0.5)',
66+
'--systems-bubble-surface-system': '#F2F2F7',
67+
'--systems-bubble-surface-e2e': '#34C759',
68+
'--systems-bubble-content-e2e': '#FFFFFF',
69+
'--systems-bubble-surface-business': '#5856D6',
70+
'--systems-bubble-content-business': '#FFFFFF',
71+
'--systems-chat-surface-composer': '#FFFFFF',
72+
'--systems-chat-background-wallpaper': '#FFFFFF',
73+
'--systems-chat-foreground-wallpaper': '#000000',
74+
'--systems-chat-surface-tray': '#F2F2F7',
75+
'--systems-status-seen': '#007AFF',
7676

77-
'--internal-components-surface-nav-bar': null as null | string,
78-
'--internal-components-active-list-row': null as null | string,
77+
'--internal-components-surface-nav-bar': '#F9F9F9',
78+
'--internal-components-active-list-row': '#F2F2F7',
7979
};
8080

8181
export type SemanticColorsType = typeof SemanticColors;
82-
export type SemanticColorsFull = {
83-
[Key in keyof SemanticColorsType]: $NonMaybeType<SemanticColorsType[Key]>,
84-
};
8582

8683
export const colors: VarGroup<SemanticColorsType, SemanticColorsTheme> =
8784
stylex.defineVars(SemanticColors);

packages/babel-plugin/__tests__/__snapshots__/stylex-perf-create-theme-test.js.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`create theme should transform complex theme file 1`] = `
3+
exports[`create theme transform complex theme file 1`] = `
44
"import type { Theme } from '@stylexjs/stylex';
55
import { colors } from './colors.stylex';
66
import * as stylex from '@stylexjs/stylex';
@@ -639,7 +639,7 @@ export const WDSDarkTheme: Theme<typeof colors> = {
639639
};"
640640
`;
641641
642-
exports[`create theme should transform complex theme file 2`] = `
642+
exports[`create theme transform complex theme file 2`] = `
643643
[
644644
[
645645
"x122jrhm",

packages/babel-plugin/__tests__/stylex-perf-create-theme-test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jest.autoMockOff();
1414
const { transformFileSync } = require('@babel/core');
1515
const stylexPlugin = require('../src/index');
1616
const path = require('path');
17-
// const rootDir = path.resolve(__dirname, './__fixtures__');
17+
1818
const classNamePrefix = 'x';
1919
const defaultOpts = {
2020
stylexSheetName: '<>',
@@ -40,7 +40,7 @@ function transform(file, opts = defaultOpts) {
4040
const themeFile = path.resolve(__dirname, '../__fixtures__/colorThemes.js');
4141

4242
describe('create theme', () => {
43-
it('should transform complex theme file', () => {
43+
it('transform complex theme file', () => {
4444
const result = transform(themeFile);
4545
expect(result.code).toMatchSnapshot();
4646
expect(result.styles).toMatchSnapshot();

packages/babel-plugin/src/utils/evaluate-path.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,6 @@ function _evaluate(path: NodePath<>, state: State): any {
523523
const elems: $ReadOnlyArray<NodePath<>> = arrPath.get('elements');
524524
for (const elem of elems) {
525525
const elemValue = evaluate(elem, state.traversalState, state.functions);
526-
// const elemValue = evaluateCached(elem, state);
527526

528527
if (elemValue.confident) {
529528
arr.push(elemValue.value);
@@ -568,7 +567,7 @@ function _evaluate(path: NodePath<>, state: State): any {
568567
state.functions,
569568
state.seen,
570569
);
571-
// evaluateCached(keyPath, state);
570+
572571
if (!confident) {
573572
resultDeopt &&
574573
deopt(resultDeopt, state, deoptReason ?? 'unknown error');
@@ -578,10 +577,10 @@ function _evaluate(path: NodePath<>, state: State): any {
578577
} else if (keyPath.isIdentifier()) {
579578
key = keyPath.node.name;
580579
} else {
581-
// TODO: This is'nt handling all possible types that `keyPath` could be
580+
// TODO: This isn't handling all possible types that `keyPath` could be
582581
key = (keyPath.node as $FlowFixMe).value;
583582
}
584-
// todo(flow->ts): remove typecast
583+
585584
const valuePath: NodePath<> = prop.get('value');
586585
let value = evaluate(
587586
valuePath,
@@ -804,7 +803,6 @@ function _evaluate(path: NodePath<>, state: State): any {
804803
state.traversalState,
805804
state.functions,
806805
);
807-
// const parsedObj = evaluateCached(object, state);
808806
if (parsedObj.confident && property.isIdentifier()) {
809807
func = parsedObj.value[property.node.name];
810808
context = parsedObj.value;

0 commit comments

Comments
 (0)