rsnext/packages/next-swc/crates/core/tests
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
..
errors feat(next-swc): Update swc crates (#35996) 2022-04-11 11:59:16 +02:00
fixture fix(next-swc/ssg): less aggressive exports drop (#36199) 2022-04-19 12:13:57 +00:00
full SWC emotion transform plugin (#34687) 2022-03-15 08:51:15 +01:00
loader feat(next-swc): Update swc crates (#35395) 2022-03-30 15:13:40 -07:00
errors.rs feat(next-swc): Update swc crates (#35996) 2022-04-11 11:59:16 +02:00
fixture.rs feat(next-swc): Update swc crates (#35996) 2022-04-11 11:59:16 +02:00
full.rs feat(next-swc): Update swc crates (#35996) 2022-04-11 11:59:16 +02:00
telemetry.rs Collect packages are used and eliminated in getServerSideProps (#35404) 2022-04-01 15:08:44 +00:00