Skip to content

Commit

Permalink
Perf: Remove runtime injection from runtime (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmn authored Dec 14, 2023
1 parent 5ee758d commit f5e9b5e
Show file tree
Hide file tree
Showing 28 changed files with 1,631 additions and 1,008 deletions.
4 changes: 4 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ describe('Evaluation of imported values works based on configuration', () => {
);
expect(transformation.code).toContain(expectedVarName);
expect(transformation.code).toMatchInlineSnapshot(`
"import stylex from 'stylex';
"import _inject from "@stylexjs/stylex/lib/stylex-inject";
import stylex from 'stylex';
import 'otherFile.stylex';
import { MyTheme } from 'otherFile.stylex';
stylex.inject(".__hashed_var__1r7rkhg{color:var(--__hashed_var__1jqb1tb)}", 3000);
_inject(".__hashed_var__1r7rkhg{color:var(--__hashed_var__1jqb1tb)}", 3000);
"__hashed_var__1r7rkhg";"
`);
expect(transformation.metadata.stylex).toMatchInlineSnapshot(`
Expand Down Expand Up @@ -103,10 +104,11 @@ describe('Evaluation of imported values works based on configuration', () => {
);
expect(transformation.code).toContain(expectedVarName);
expect(transformation.code).toMatchInlineSnapshot(`
"import stylex from 'stylex';
"import _inject from "@stylexjs/stylex/lib/stylex-inject";
import stylex from 'stylex';
import 'otherFile.stylex.js';
import { MyTheme } from 'otherFile.stylex.js';
stylex.inject(".__hashed_var__1r7rkhg{color:var(--__hashed_var__1jqb1tb)}", 3000);
_inject(".__hashed_var__1r7rkhg{color:var(--__hashed_var__1jqb1tb)}", 3000);
"__hashed_var__1r7rkhg";"
`);
expect(transformation.metadata.stylex).toMatchInlineSnapshot(`
Expand Down Expand Up @@ -141,10 +143,11 @@ describe('Evaluation of imported values works based on configuration', () => {
);
expect(transformation.code).toContain(expectedVarName);
expect(transformation.code).toMatchInlineSnapshot(`
"import stylex from 'stylex';
"import _inject from "@stylexjs/stylex/lib/stylex-inject";
import stylex from 'stylex';
import 'otherFile.stylex.js';
import { MyTheme as mt } from 'otherFile.stylex.js';
stylex.inject(".__hashed_var__1r7rkhg{color:var(--__hashed_var__1jqb1tb)}", 3000);
_inject(".__hashed_var__1r7rkhg{color:var(--__hashed_var__1jqb1tb)}", 3000);
"__hashed_var__1r7rkhg";"
`);
expect(transformation.metadata.stylex).toMatchInlineSnapshot(`
Expand Down
Loading

0 comments on commit f5e9b5e

Please sign in to comment.