Coder Social home page Coder Social logo

next-linaria's People

Contributors

m1r1k avatar mistereo avatar sidletski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

next-linaria's Issues

Support for version 3

Hi @Mistereo ,

Thank you for this package!

Do you plan on supporting version 3 of Linaria (currently in beta)?
It splits Linaria into different packages (@linaria/webpack-loader, etc.).

From the Linaria docs the installation process seems the same, except the different naming, so in next-linaria I tried replacing this:

            loader: require.resolve('linaria/loader'),

With this:

            loader: '@linaria/webpack-loader',

But got some weird errors.

Anyway, I still got it to work with the previous version. Thanks.

next.js css-modules styles omitted from resulting class names

Hi @Mistereo,

when using the built-in css-modules from next.js together with next-linaria the css-modules classnames are stripped away from the final html. (e.g. import styles from "../styles/some.module.css and then use it like className={styles.someClassname}) This was working ok with version 0.10.

Affected Version: 0.11 and 1.0.1-beta

I tracked the problem down to the rules that were added in 0.11 specifically
rule.options.modules.exportOnlyLocals = false
seems to be the problem.

[BABEL] Note: The code generator has deoptimised the styling of D:\Nodejs\next.js-canary\examples\with-tailwindcss\node_modules\react-dom\cjs\react-dom.development.js as it exceeds the max of 500KB.

Nothing special, just run example of Nextjs and get this warning babel.
[BABEL] Note: The code generator has deoptimised the styling of D:\Nodejs\next.js-canary\examples\with-tailwindcss\node_modules\react-dom\cjs\react-dom.development.js as it exceeds the max of 500KB.

If I remove next-linaria from next.config.js, everything will be ok.

Tag the commits for 0.10.0, 0.11.0, 1.0.0-beta

๐Ÿ‘‹ thanks for creating this valuable plugin, I wonder if you can tag commits for the recent releases and potentially make some release notes so that it is easy to navigate the changes? Thanks!

TypeScript issues when using "export default withLinaria(nextConfig)"

Hi there! ๐Ÿ™‚
I'm getting TS issues when using export default withLinaria(nextConfig)
Screenshot 2023-10-27 at 17 25 47

It only occurs when I change from export default nextConfig to export default withLinaria(nextConfig)
The error doesn't occur using a different config wrapper like export default WithNextMDX(nextConfig)
So I believe this is an issue with next-linaria.

Repo - https://github.com/AshConnolly/linaria-bug
codesandbox of repo - https://codesandbox.io/p/github/AshConnolly/linaria-bug/master

Any ideas on how to solve this?

next-linaria breaks sass

Error:
Warning: Prop className did not match. Server: "" Client: "Typography_Typography__ZuFWQ Typography_Typography_Style_TextM__4q3nY"

And elements that used Sass are not styled.

Typography is using Sass only, without linaria. But if i remove "withLinaria" from next.config, sass works good.

Env:

"next": "^12.1.1",
"next-transpile-modules": "^9.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"linaria": "^2.3.1",
"next-linaria": "0.11.0",

Next.config:

/** @type {import('next').NextConfig} */
const path = require('path');
const withTM = require('next-transpile-modules')(["cdc-ui"]); // pass the modules you would like to see transpiled
const withLinaria = require('next-linaria');

const IS_DEV = process.env.NODE_ENV === 'development';

const nextConfig = withLinaria(withTM({
	sassOptions: {
		includePaths: [path.join(__dirname, 'styles')],
	},
	linaria:{
		displayName: IS_DEV,
	},
	reactStrictMode: true,
	poweredByHeader: false,
	generateEtags: false,
	distDir: 'build',
	maxInactiveAge: 25 * 1000,
	trailingSlash: true,
	swcMinify: false,
	productionBrowserSourceMaps: true,
}));

module.exports = nextConfig;

Cannot wrap React components with styled

Doing so produces this error:
An unexpected runtime error ocurred during dependencies evaluation: Error: Cannot find module '@babel/preset-env'

You can reproduce this error in the stackblitz implementation of the documentation on this repo like this:

Screen Shot 2022-02-25 at 5 05 12 PM

Support for :global() rules

Something like this within a component:

const globals = css`
  :global() {
    html {
      font-size: large;
    }
  }
`;
errors with:

Error: Syntax error: Selector "html" is not pure (pure selectors must contain at least one local class or id)


It works okay if it's in an `_app.tsx` file.

Known issue in https://github.com/callstack/linaria/issues/589#issuecomment-730219118

Documenting here for anyone coming to this project.

unable to handle png file type

During the 0.11.0 or even 1.0.0-beta upgrades, I have run into some issue as below:

$ next build
warn  - No build cache found. Please configure build caching for faster rebuilds. Read more: https://err.sh/next.js/no-cache
info  - Creating an optimized production build...
info  - Using external babel configuration from /home/runner/work/build-meetup/build-meetup/packages/web-next/packages/web/.babelrc
Failed to compile.

./public/images/register/video-background.png 1:0
Module parse failed: Unexpected character '๏ฟฝ' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)

I am using all things default in next.config.js as with 0.10.0

  withLinaria({
    linaria: {},

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.