-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: adds css loader * feat: use compiled strip plugin * chore: decorates funcs * chore: clarify in comments * chore: fixes tests * chore: adds basic types for the webpack loaders * chore: adds extract to scripts * chore: adds async component * chore: adds jsdoc * feat: adds sorting plugin * chore: adds predicate * fix: fixes extract with cjs source * chore: rename to extract plugin * chore: reword comments * chore: fix lint erors * chore: stub events * chore: flush all compiled CSS through one style sheet * feat: adds sort stub func to css * chore: move predicate into utils * chore: add style loader when not extracting * chore: move ot common util * feat: adds first pass at sort plugin * fix: use double quotes to fix parsing error * chore: adds stub plugin * feat: fills in discard duplicate plugin * chore: adds css min to webpack * chore: adds tests for webpack * chore: use local webpack * chore: adds tests for babel output extraction * chore: renames to merge duplicate at rules * chore: resolves code review comments * chore: bikesheding * chore: fix build script * chore: move to private * docs(changeset): The `onFoundStyleSheet` option has been replaced by `onFoundStyleSheet`. This callback will be called once with all found styles at the end of the pass. * docs(changeset): Added new `sort` function to sort atomic style sheets. * docs(changeset): Added new `createError` and `toBoolean` functions. * chore: unlink react pkg * docs(changeset): Added new option `extract` with pairing webpack plugin `CompiledExtractPlugin`. Configuring them will strip all the runtime from your app and extract all styles to an atomic style sheet. For help getting started with this feature read the [extracting css guide](https://compiledcssinjs.com/docs/extracting-css). * feat: turns on extracting from node modules * chore: adds test fixtures * chore: refactor * feat: adds include/exclude for extract plugin * feat: adds test support * chore: fix version * chore: remove ts ignore
- Loading branch information
Showing
57 changed files
with
1,596 additions
and
145 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
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 @@ | ||
--- | ||
'@compiled/css': patch | ||
--- | ||
|
||
Added new `sort` function to sort atomic style sheets. |
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 @@ | ||
--- | ||
'@compiled/utils': patch | ||
--- | ||
|
||
Added new `createError` and `toBoolean` functions. |
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,8 @@ | ||
--- | ||
'@compiled/webpack-loader': patch | ||
--- | ||
|
||
Added new option `extract` with pairing webpack plugin `CompiledExtractPlugin`. | ||
Configuring them will strip all the runtime from your app and extract all styles to an atomic style sheet. | ||
|
||
For help getting started with this feature read the [extracting css guide](https://compiledcssinjs.com/docs/extracting-css). |
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 @@ | ||
--- | ||
'@compiled/babel-plugin-strip-runtime': patch | ||
--- | ||
|
||
The `onFoundStyleSheet` option has been replaced by `onFoundStyleSheet`. This callback will be called once with all found styles at the end of the pass. |
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,7 @@ | ||
{ | ||
"presets": [ | ||
["@babel/preset-env", { "targets": { "browsers": "last 1 version" } }], | ||
["@babel/preset-react", { "runtime": "automatic" }] | ||
], | ||
"plugins": [["@compiled/babel-plugin", { "importReact": false }]] | ||
} |
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,22 @@ | ||
{ | ||
"name": "@private/babel-component", | ||
"private": true, | ||
"version": "0.0.1", | ||
"main": "./dist/index.js", | ||
"scripts": { | ||
"build": "babel ./src --out-dir=./dist" | ||
}, | ||
"dependencies": { | ||
"@compiled/react": "*" | ||
}, | ||
"devDependencies": { | ||
"@compiled/babel-plugin": "*", | ||
"@babel/core": "^7.12.16", | ||
"@babel/cli": "^7.12.16", | ||
"@babel/preset-env": "^7.12.16", | ||
"@babel/preset-react": "^7.12.13" | ||
}, | ||
"peerDependencies": { | ||
"react": "^17.0.1" | ||
} | ||
} |
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,16 @@ | ||
import { styled } from '@compiled/react'; | ||
|
||
const Button = styled.button` | ||
color: blue; | ||
font-size: 30px; | ||
border: 2px solid blue; | ||
padding: 8px; | ||
`; | ||
|
||
export default function BabelComponent({ children }) { | ||
return ( | ||
<div css={{ marginTop: 30 }}> | ||
<Button>{children}</Button> | ||
</div> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import React from 'react'; | ||
import { hydrate } from 'react-dom'; | ||
import { render } from 'react-dom'; | ||
import App from './app'; | ||
|
||
hydrate(<App />, document.getElementById('root')); | ||
render(<App />, document.getElementById('root')); |
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 |
---|---|---|
@@ -1,12 +1,20 @@ | ||
import { Suspense, lazy } from 'react'; | ||
import '@compiled/react'; | ||
import BabelComponent from '@private/babel-component'; | ||
import { primary } from './module'; | ||
import HelloWorld from './component'; | ||
|
||
const AsyncComponent = lazy(() => import('./async')); | ||
|
||
export default function Home() { | ||
return ( | ||
<> | ||
<div css={{ fontSize: 50, color: primary }}>hello from webpack</div> | ||
<HelloWorld>TypeScript component</HelloWorld> | ||
<BabelComponent>Component from NPM</BabelComponent> | ||
<Suspense fallback="Loading..."> | ||
<AsyncComponent>I was loaded async</AsyncComponent> | ||
</Suspense> | ||
</> | ||
); | ||
} |
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,22 @@ | ||
import { styled } from '@compiled/react'; | ||
|
||
const LoadedAsync = styled.button` | ||
font-weight: 700; | ||
color: purple; | ||
border: 2px solid pink; | ||
background-color: transparent; | ||
:focus { | ||
color: blue; | ||
} | ||
:hover { | ||
color: red; | ||
} | ||
@media (min-width: 500px) { | ||
border: 2px solid red; | ||
} | ||
`; | ||
|
||
export default LoadedAsync; |
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,4 @@ | ||
body::before { | ||
display: block; | ||
content: 'CSS FROM A FILE OUTSIDE OF COMPILED'; | ||
} |
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
Oops, something went wrong.