Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Atomic atomizer running before custom preprocessor

オープン
#1,411 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
scss

調査の方向性

issue に記載されているカスタムプリプロセッサ設定と @linaria/atomic の再現手順から始めます。アトミック抽出が前処理より先に実行されるかを追跡します。完了条件は、宣言がアトミックスタイルに分割される前に SCSS 変数がコンパイルされることです。

索引モデルが issue の本文から書いたものです。

説明

bug report 🦗 bundler: webpack 📦 needs: complete repro 🖥️

Environment

{
  "dependencies": {
    "@linaria/atomic": "^6.2.0",
    "@linaria/core": "6.2.0",
    "@linaria/react": "6.2.1",
    
    "@wyw-in-js/babel-preset": "0.5.3",
    "@wyw-in-js/shared": "0.5.3",
    "@wyw-in-js/transform": "0.5.3",
    "@wyw-in-js/vite": "0.5.3"
  }
}
linaria({
	sourceMap: isDev,
	preprocessor: (selector, cssText) => {
		try {
			const result = sass.compileString(`${selector} {${cssText}}\n`);
			return result.css.toString();
		} catch (error) {
			console.error("Error processing SCSS:", error);
			return "";
		}
	}
})
  • Linaria version: 6.2.0
  • Bundler (+ version):
  • Node.js version: v20.8.0
  • OS: windows 11

Description

I am using a SCSS preprocessor (with great success), but getting errors when trying out the @linaria/atomic package.

I think, and created a small test which I believe confirms this, that the atomizer is running before the preprocessor (which naturally causes problems since all the SCSS needs to be compiled together, after which it can be safely atomized).

Simple example below showing the SCSS variable is not compiled when the atomizer is ran, resulting in color: $purple-900; being split out before SCSS can compile it alongside the variable declaration.

NB this example works just fine when using @linaria/core, the error is exclusive to @linaria/atomic

image

image

Reproducible Demo

Use the a custom preprocessor alongside @linaria/atomic.

主要言語
TypeScript
スター
12.4k
フォーク
413
平均マージ
3日 4時間
マージ済み PR(30日)
2

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

callstack/linaria のほかの issue

callstack/linaria の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。