Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After Build , the page performance degradation, react ^17.0.37 #11693

Open
pxim opened this issue Nov 30, 2021 · 3 comments
Open

After Build , the page performance degradation, react ^17.0.37 #11693

pxim opened this issue Nov 30, 2021 · 3 comments

Comments

@pxim
Copy link

pxim commented Nov 30, 2021

I just created the code framework with this command today .

npx create-react-app my-app
cd my-app
npm start

In development mode, my code, page performance is OK . Average 50 FPS . There are only a few requestAnimationFrame warnings

But after Build, the page performance degradation, only about 15fps, and the error [Violation] 'requestAnimationFrame' handler 用时 <N> 毫秒 is not stopped.

normal , dev :
image

error , build :
image
image

http://zyzx.jingge.com:45231/releases/%E7%BA%AF%E7%94%B5%E5%8A%A8%E6%B1%BD%E8%BD%A6%E4%BA%A4%E6%B5%81%E5%85%85%E7%94%B5%E7%B3%BB%E7%BB%9F3D%E7%BB%93%E6%9E%84%E5%B1%95%E7%A4%BA/index.html

package.json

{
  "name": "w3dres-web-cra-three",
  "homepage": ".",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.11.4",
    "@testing-library/react": "^11.1.0",
    "@testing-library/user-event": "^12.1.10",
    "@types/jest": "^27.0.3",
    "@types/node": "^16.11.11",
    "@types/react": "^17.0.37",
    "@types/react-dom": "^17.0.11",
    "antd": "^4.17.2",
    "axios": "^0.24.0",
    "gsap": "^3.8.0",
    "hox": "^1.1.4",
    "mitt": "^3.0.0",
    "react": "^17.0.2",
    "react-device-detect": "^2.1.2",
    "react-dom": "^17.0.2",
    "react-helmet-async": "^1.1.2",
    "react-scripts": "4.0.3",
    "three": "^0.134.0",
    "three-spritetext": "^1.6.3",
    "typescript": "^4.5.2",
    "web-vitals": "^1.0.1"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "@types/three": "^0.134.0"
  }
}

------------------------2021-12-02---------------------------------------------------------------------
It feels like a compression plugin problem
umijs/umi#7644

@pxim pxim changed the title After Build , the page performance is arrogant, react ^17.0.37 After Build , the page performance degradation, react ^17.0.37 Nov 30, 2021
@candy4290
Copy link

same question here

@jaminmelville
Copy link

jaminmelville commented Dec 15, 2021

I'm experiencing this also. I've found that setting the production browserlist to be the same as development fixed this for me.

  "browserslist": {
    "production": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },

@candy4290
Copy link

candy4290 commented Dec 29, 2021

I'm experiencing this also. I've found that setting the production browserlist to be the same as development fixed this for me.

  "browserslist": {
    "production": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },

I tried it, don't works for me! @jaminmelville

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants