Skip to content
New issue

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

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

Already on GitHub? # to your account

Perform escape analysis on imported types #206

Open
brigand opened this issue Sep 12, 2018 · 3 comments
Open

Perform escape analysis on imported types #206

brigand opened this issue Sep 12, 2018 · 3 comments

Comments

@brigand
Copy link
Owner

brigand commented Sep 12, 2018

Reference: react-virtualized issue

This import appears in a source file which doesn't define components or composite types.

import type WindowScroller from '../WindowScroller.js';

This line is in the output:

import { bpfrpt_proptype_WindowScroller } from '../WindowScroller.js';

As bpfrpt_proptype_WindowScroller is never referred to, the binding and import can be cleaned up.

@johnpangalos
Copy link

Hey, thought I'd follow up on this as more things are starting to use esbuild which is incompatible with this behavior. Resulting in anyone using react-virtualized not being able to use some of the more modern tooling. Some effect tools: esbuild, vite, and snowpack.

I would love to help in anyway I can including writing code. But I am not sure how to go about this.

@johnpangalos
Copy link

Looking through the code for react-virutalized, it seems to only happen for default imports of types.

Reference: https://github.com/bvaughn/react-virtualized/blob/master/source/WindowScroller/utils/onScroll.js

@mewhhaha

@johnpangalos
Copy link

Seems to actually just with files that don't have react components in them.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants