8000 Support names export statment · Issue #1098 · facebook/stylex · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Support names export statment #1098
Open
@husseinraoouf

Description

@husseinraoouf

Describe the feature request

The problem

The return value of stylex.defineVars() must be bound to a named export

How to reproduce

import * as stylex from '@stylexjs/stylex';

// works
export const vars = stylex.defineVars({ color: 'red' });

// does not work
const vars = stylex.defineVars({ color: 'red' });
export { vars };

I know from the doc that 5527 :

The variable must be exported directly

But the export { vars } syntax is generated by rollup, and I don't know if this behavior can be changed through the rollup config.

The issue is directly copied from #348, which i think is still a valid case that is not solved

our project is a big monorepo, and having typescript package in the monorepo imnported directly in our apps without trasnpiling really slows down the typescript lsp, so we prefer to pre-transpile packages using tsdown ( using rolldown under the hood ) and just use the .d.ts types, the only exception for this setup now is the design-system because of stylex requiring the defineVars() return to be directly exported instead of exporting it at the end of the file which is how rolldown handle named exports

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0