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

[REFACTOR] twenty-ui multi barrel #11203

Draft
wants to merge 30 commits into
base: main
Choose a base branch
from
Draft

[REFACTOR] twenty-ui multi barrel #11203

wants to merge 30 commits into from

Conversation

prastoin
Copy link
Contributor

Introduction

WIP

@prastoin prastoin changed the title Twenty UI multi barrel [REFACTOR] Twenty UI multi barrel Mar 26, 2025
@prastoin prastoin changed the title [REFACTOR] Twenty UI multi barrel [REFACTOR] twenty-ui multi barrel Mar 26, 2025
@prastoin
Copy link
Contributor Author

Closing from now as need to refactor generate barrel in prior

@prastoin prastoin closed this Mar 26, 2025
@prastoin
Copy link
Contributor Author

prastoin commented Mar 26, 2025

Need to handle:

const toto = 'toto';
export {toto as FooBar};

const foo = 'foo';
const bar = 'bar';
export { foo, bar };

export const {foo, bar} = {foo: 'foo', bar: 'bar'};

export const {foo: somehow, bar} = {foo: 'foo', bar: 'bar'};

@prastoin
Copy link
Contributor Author

prastoin commented Mar 26, 2025

Should add to migration script the tsx d.ts manually fixed for twenty-front atm also the .storybook folder

@prastoin prastoin reopened this Mar 26, 2025
@prastoin
Copy link
Contributor Author

prastoin commented Mar 26, 2025

has to fix AppRootErrorFallback manually by consuming theme directly

motion } from 'framer-motion';
import { IconReload } from 'twenty-ui/display';
import { GRAY_SCALE, THEME_LIGHT } from 'twenty-ui/theme';

type AppRootErrorFallbackProps = AppErrorDisplayProps;

const StyledContainer = styled.div`
  background: ${THEME_LIGHT.background.noisy};
  box-sizing: border-box;
  display: flex;
  height: 100vh;
  width: 100vw;

@prastoin
Copy link
Contributor Author

prastoin commented Mar 26, 2025

I need to handle lingui using babel

@prastoin
Copy link
Contributor Author

Tags.tsx has a circular dep, omitting from now

error twenty-ui EvalError: Circular dependency detected: /Users/paulrastoin/ws/twenty/node_modules/@emotion/react/dist/emotion-element-b1930563.cjs.js -> /Users/paulrastoin/ws/twenty/node_modules/@emotion/react/dist/emotion-react.cjs.js -> /Users/paulrastoin/ws/twenty/packages/twenty-ui/src/theme/constants/HoverBackground.ts -> /Users/paulrastoin/ws/twenty/packages/twenty-ui/src/theme/index.ts -> /Users/paulrastoin/ws/twenty/packages/twenty-ui/src/display/tag/components/Tag.tsx -> /Users/paulrastoin/ws/twenty/node_modules/@emotion/cache/dist/emotion-cache.cjs.js in/Users/paulrastoin/ws/twenty/node_modules/@emotion/react/dist/emotion-element-b1930563.cjs.js
🎁 error twenty-ui | /Users/paulrastoin/ws/twenty/node_modules/@emotion/react/dist/emotion-react.cjs.js
🎁 error twenty-ui | /Users/paulrastoin/ws/twenty/packages/twenty-ui/src/theme/constants/HoverBackground.ts
🎁 error twenty-ui | /Users/paulrastoin/ws/twenty/packages/twenty-ui/src/theme/index.ts
🎁 error twenty-ui | /Users/paulrastoin/ws/twenty/packages/twenty-ui/src/display/tag/components/Tag.tsx

@prastoin
Copy link
Contributor Author

Sometimes twenty-front just crashes

> nx run twenty-front:start

  ➜  Local:   http://localhost:3001/
  ➜  Network: use --host to expose

[TypeScript] Found 0 errors. Watching for file changes.
node:events:492
      throw er; // Unhandled 'error' event
      ^

Error: Worker terminated due to reaching memory limit: JS heap out of memory
    at new NodeError (node:internal/errors:405:5)
    at [kOnExit] (node:internal/worker:287:26)
    at Worker.<computed>.onexit (node:internal/worker:209:20)
Emitted 'error' event on Worker instance at:
    at [kOnExit] (node:internal/worker:287:12)
    at Worker.<computed>.onexit (node:internal/worker:209:20) {
  code: 'ERR_WORKER_OUT_OF_MEMORY'
}

Node.js v18.17.1

@prastoin
Copy link
Contributor Author

[wyw-in-js] /Users/paulrastoin/ws/twenty/packages/twenty-ui/dist/objectSpread2-c2a27e3d.esm.js has a module-resolver plugin in its babelrc, but it is not present in the babelOptions for the wyw-in-js plugin. This works for now but will be an error 
in the future. Please add the module-resolver plugin to the babelOptions for the wyw-in-js plugin.

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

Successfully merging this pull request may close these issues.

2 participants