rsnext/packages/next-swc/crates/core/tests/fixture
OJ Kwon deb82802a4
fix(next-swc/ssg): less aggressive exports drop (#36199)
This PR attempts to fix #31855, by loosening conditions to determine what to drop when swc runs transform. Currently, it drops all the export declaration if it's being referenced only in getstatic* in local scope. But as `export` implies, there's no guarantee given export will be used in other modules even if it's not being used in local scope. PR tries to not to drop exports declarations as much if it's not being used locally other than getstatic*. This makes dropping bit ineffecient, but as long as we can't cross-ref across modules that's something unavoidable in my opinion.

I don't think implementation itself is quite acceptable: probably need review & revise to the logics. 

## Bug

- Attempt to close #31855

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-04-19 12:13:57 +00:00
..
amp/amp-classname Extract next-swc Rust code into its own package (#31635) 2021-11-21 12:59:56 +01:00
next-dynamic feat(next-swc): Update swc crates (#35395) 2022-03-30 15:13:40 -07:00
page-config feat(next-swc): Update swc crates (#35395) 2022-03-30 15:13:40 -07:00
react-remove-properties Add support for removing React properties. (#31606) 2021-11-26 14:45:03 +01:00
relay Relay Support in Rust Compiler (#33702) 2022-02-01 18:18:55 +00:00
remove-console/all Extract next-swc Rust code into its own package (#31635) 2021-11-21 12:59:56 +01:00
shake-exports feat(next-swc): Update swc crates (#35395) 2022-03-30 15:13:40 -07:00
ssg fix(next-swc/ssg): less aggressive exports drop (#36199) 2022-04-19 12:13:57 +00:00