Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tags): better support for tags other than tagged templates (#1014)
- Loading branch information
Showing
29 changed files
with
663 additions
and
232 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,11 @@ | ||
--- | ||
'@linaria/babel-preset': patch | ||
'@linaria/core': patch | ||
'@linaria/griffel': patch | ||
'@linaria/react': patch | ||
'@linaria/server': patch | ||
'@linaria/tags': patch | ||
'@linaria/testkit': patch | ||
--- | ||
|
||
Tagged template-specific logic has been moved from `BaseProcessor` to `TaggedTemplateProcessor`. `BaseProcessor` now can be used to define any type of expressions for zero-runtime transformations, such as `makeStyles` from `@griffel/react`. |
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,11 @@ | ||
declare module '@babel/helper-module-imports' { | ||
import type { NodePath } from '@babel/traverse'; | ||
import type { Identifier } from '@babel/types'; | ||
|
||
function addNamed( | ||
path: NodePath, | ||
name: string, | ||
importedSource: string, | ||
opts?: { nameHint: string } | ||
): Identifier; | ||
} |
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,3 @@ | ||
const config = require('../../babel.config'); | ||
|
||
module.exports = config; |
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,55 @@ | ||
{ | ||
"name": "@linaria/griffel", | ||
"description": "Blazing fast zero-runtime CSS in JS library", | ||
"version": "3.0.0-beta.21", | ||
"bugs": "https://github.com/callstack/linaria/issues", | ||
"dependencies": { | ||
"@griffel/core": "^1.5.0", | ||
"@linaria/logger": "workspace:^", | ||
"@linaria/tags": "workspace:^", | ||
"@linaria/utils": "workspace:^", | ||
"ts-invariant": "^0.10.3" | ||
}, | ||
"devDependencies": { | ||
"@babel/types": "^7.18.9" | ||
}, | ||
"engines": { | ||
"node": "^12.16.0 || >=13.7.0" | ||
}, | ||
"files": [ | ||
"esm/", | ||
"lib/", | ||
"processors/", | ||
"types/" | ||
], | ||
"homepage": "https://github.com/callstack/linaria#readme", | ||
"keywords": [ | ||
"css", | ||
"css-in-js", | ||
"linaria", | ||
"react", | ||
"styled-components" | ||
], | ||
"license": "MIT", | ||
"linaria": { | ||
"tags": { | ||
"makeStyles": "./lib/processors/makeStyles.js" | ||
} | ||
}, | ||
"main": "lib/index.js", | ||
"module": "esm/index.js", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"repository": "git@github.com:callstack/linaria.git", | ||
"scripts": { | ||
"build": "npm run build:lib && npm run build:esm && npm run build:declarations", | ||
"build:declarations": "tsc --emitDeclarationOnly --outDir types", | ||
"build:esm": "babel src --out-dir esm --extensions '.js,.jsx,.ts,.tsx' --source-maps --delete-dir-on-start", | ||
"build:lib": "cross-env NODE_ENV=legacy babel src --out-dir lib --extensions '.js,.jsx,.ts,.tsx' --source-maps --delete-dir-on-start", | ||
"typecheck": "tsc --noEmit --composite false", | ||
"watch": "npm run build --watch" | ||
}, | ||
"sideEffects": false, | ||
"types": "types/index.d.ts" | ||
} |
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 @@ | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true, | ||
}); | ||
|
||
exports.default = require('../lib/processors/makeStyles').default; |
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 @@ | ||
export { default as makeStyles } from './makeStyles'; |
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,6 @@ | ||
export default function makeStyles<Slots extends string | number>( | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
stylesBySlots: Record<Slots, unknown> | ||
): () => Record<Slots, string> { | ||
throw new Error('Cannot be called in runtime'); | ||
} |
Oops, something went wrong.