Code Monkey home page Code Monkey logo

Comments (14)

Simon-He95 avatar Simon-He95 commented on September 27, 2024 1

@antfu @Simon-He95 I was able to reproduce the issue. Please check https://github.com/tobiasdalhof/unocss-issue-3733/

VSCode slows down when I open my laravel routes file. It contains a fair amount of square brackets, which is probably causing the issue

Regular expression was recently changed in #3712

Thank you very much for providing a particularly detailed reproduction demo.

from unocss.

antfu avatar antfu commented on September 27, 2024

@Simon-He95 Can you help to take a look? Thank you

from unocss.

tobiasdalhof avatar tobiasdalhof commented on September 27, 2024

Probably caused by #3728

from unocss.

Simon-He95 avatar Simon-He95 commented on September 27, 2024

Probably caused by #3728

hi, @tobiasdalhof can you provide a reproduced demo

from unocss.

tobiasdalhof avatar tobiasdalhof commented on September 27, 2024

Hey @Simon-He95,

I'm unable to whip up a demo for you right now, but here are some additional details: I've got a monorepo using pnpm. Inside, I've got a bunch of frontends built with Vite, and they all share a single unocss.config.ts file.

Here's what my repo structure looks like:

๐Ÿ“ /backend
๐Ÿ“ /frontend-1
  ๐Ÿ“„ package.json
  ๐Ÿ“„ vite.config.ts
๐Ÿ“ /frontend-2
  ๐Ÿ“„ package.json
  ๐Ÿ“„ vite.config.ts
๐Ÿ“ /frontend-3
  ๐Ÿ“„ package.json
  ๐Ÿ“„ vite.config.ts
๐Ÿ“„ package.json
๐Ÿ“„ unocss.config.ts

And here's a snippet from a vite.config.ts file as an example:

import { resolve } from 'node:path'
import { defineConfig } from 'vite'
import UnoCSS from 'unocss/vite'

export default defineConfig({
  plugins: [
    UnoCSS(resolve(__dirname, '../unocss.config.ts')),
  ],
})

Let me know if you need more info or if there's anything else I can assist you with.

from unocss.

Simon-He95 avatar Simon-He95 commented on September 27, 2024

@tobiasdalhof,
If possible, please provide a link to the smallest reproduction warehouse so that I can better troubleshoot, thx~

from unocss.

tobiasdalhof avatar tobiasdalhof commented on September 27, 2024

I was able to solve the issue by adding a unocss.config.ts to each package. My structure now looks like this:

๐Ÿ“ /backend
๐Ÿ“ /frontend-1
  ๐Ÿ“„ package.json
  ๐Ÿ“„ unocss.config.ts
  ๐Ÿ“„ vite.config.ts
๐Ÿ“ /frontend-2
  ๐Ÿ“„ package.json
  ๐Ÿ“„ unocss.config.ts
  ๐Ÿ“„ vite.config.ts
๐Ÿ“ /frontend-3
  ๐Ÿ“„ package.json
  ๐Ÿ“„ unocss.config.ts
  ๐Ÿ“„ vite.config.ts
๐Ÿ“ /shared
  ๐Ÿ“„ package.json
  ๐Ÿ“„ unocss.config.ts
๐Ÿ“„ package.json

Helper function in /shared/unocss.config.ts to create UnoCSS UserConfig:

import type { UserConfig } from 'unocss'

export function createConfig(): UserConfig {
  return {
    // ...
  }
}

from unocss.

Simon-He95 avatar Simon-He95 commented on September 27, 2024

@tobiasdalhof Can you help me test whether this version of the plugin can solve this problem? Please disable unocss and use this test version unocss-test

from unocss.

tobiasdalhof avatar tobiasdalhof commented on September 27, 2024

@tobiasdalhof Can you help me test whether this version of the plugin can solve this problem? Please disable unocss and use this test version unocss-test

@Simon-He95 Thanks for looking into it. The issue still persists

from unocss.

Simon-He95 avatar Simon-He95 commented on September 27, 2024

@tobiasdalhof Can you help me test whether this version of the plugin can solve this problem? Please disable unocss and use this test version unocss-test

@Simon-He95 Thanks for looking into it. The issue still persists

I think the best way is for you to provide a repo that reproduces the problem you mentioned so that I can track it.

from unocss.

antfu avatar antfu commented on September 27, 2024

We temporarily closed this due to the lack of enough information. We could not identify whether it was a bug or a userland misconfiguration with the given info.
Please provide a minimal reproduction to reopen the issue.
Thanks.

Why reproduction is required

from unocss.

tobiasdalhof avatar tobiasdalhof commented on September 27, 2024

@antfu @Simon-He95 I was able to reproduce the issue. Please check https://github.com/tobiasdalhof/unocss-issue-3733/

VSCode slows down when I open my laravel routes file. It contains a fair amount of square brackets, which is probably causing the issue

Regular expression was recently changed in #3712

from unocss.

oommgg avatar oommgg commented on September 27, 2024

@Simon-He95 @antfu

Hi, I have the same issue with this problem.

the test file is:

https://github.com/tobiasdalhof/unocss-issue-3733/blob/main/test.php

with

Route::get('/some-route', [SomeController::class, 'someMethod']);
Route::get('/some-route', [SomeController::class, 'someMethod']);
Route::get('/some-route', [SomeController::class, 'someMethod']);
...

and my api.php for laravel router is:

Route::get('test', 'TestController@index');
Route::get('test', 'TestController@index');
Route::get('test', 'TestController@index');
ๆˆชๅœ– 2024-04-24 16 23 28

I clone https://github.com/tobiasdalhof/unocss-issue-3733/ this repo

and it still happend on unocss 0.59.4 vscode extension

from unocss.

Simon-He95 avatar Simon-He95 commented on September 27, 2024

@Simon-He95 @antfu

Hi, I have the same issue with this problem.

the test file is:

https://github.com/tobiasdalhof/unocss-issue-3733/blob/main/test.php

with

Route::get('/some-route', [SomeController::class, 'someMethod']);
Route::get('/some-route', [SomeController::class, 'someMethod']);
Route::get('/some-route', [SomeController::class, 'someMethod']);
...

and my api.php for laravel router is:

Route::get('test', 'TestController@index');
Route::get('test', 'TestController@index');
Route::get('test', 'TestController@index');
ๆˆชๅœ– 2024-04-24 16 23 28 I clone `https://github.com/tobiasdalhof/unocss-issue-3733/` this repo

and it still happend on unocss 0.59.4 vscode extension

0.59.4 did not merge this pr๐Ÿ˜‚

from unocss.

Related Issues (20)

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.