Skip to content

Conversation

@SimenB
Copy link
Contributor

@SimenB SimenB commented Apr 6, 2022

Summary

Jest 28 will error if only a string is returned from a transfomer, it needs to be an object of {code: string, map?: object}. Returning an object has been supported since jestjs/jest#2290, released in Jest v20.

Changelog

[Internal] [Fixed] - Return object from Jest preprocessor

Test Plan

Green CI?

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 6, 2022
@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Apr 6, 2022
@facebook-github-bot
Copy link
Contributor

@robhogan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@SimenB
Copy link
Contributor Author

SimenB commented Apr 6, 2022

sorry @robhogan, missed a spot

@analysis-bot
Copy link

analysis-bot commented Apr 6, 2022

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 9573d7b
Branch: main

@facebook-github-bot
Copy link
Contributor

@robhogan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@analysis-bot
Copy link

analysis-bot commented Apr 6, 2022

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,766,188 +112
android hermes armeabi-v7a 7,169,990 +82
android hermes x86 8,072,401 +60
android hermes x86_64 8,052,482 +31
android jsc arm64-v8a 9,643,379 +68
android jsc armeabi-v7a 8,417,611 +31
android jsc x86 9,592,561 +15
android jsc x86_64 10,189,750 -10

Base commit: 9573d7b
Branch: main

@facebook-github-bot
Copy link
Contributor

@robhogan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @SimenB in e89c93f.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Apr 7, 2022
@SimenB SimenB deleted the patch-1 branch April 7, 2022 15:49
facebook-github-bot pushed a commit that referenced this pull request Jun 17, 2022
Summary:
Fixes #33751
Relates to #33576

Jest 28 removed support for returning a string in the process method of a transformer (https://jestjs.io/docs/upgrading-to-jest28#transformer).

This PR changes assetFileTransformer to return an object instead of a string.

## Changelog

[Internal] [Fixed] - Return object from assetFileTransformer

Pull Request resolved: #33756

Test Plan: Tests pass with Jest 28 when this change is made.

Reviewed By: cipolleschi

Differential Revision: D37242038

Pulled By: cortinico

fbshipit-source-id: d8a5054f5378183f644cd1458785084b26782193
kelset pushed a commit that referenced this pull request Jul 12, 2022
Summary:
Fixes #33751
Relates to #33576

Jest 28 removed support for returning a string in the process method of a transformer (https://jestjs.io/docs/upgrading-to-jest28#transformer).

This PR changes assetFileTransformer to return an object instead of a string.

## Changelog

[Internal] [Fixed] - Return object from assetFileTransformer

Pull Request resolved: #33756

Test Plan: Tests pass with Jest 28 when this change is made.

Reviewed By: cipolleschi

Differential Revision: D37242038

Pulled By: cortinico

fbshipit-source-id: d8a5054f5378183f644cd1458785084b26782193
danilobuerger pushed a commit to feastr/react-native that referenced this pull request Jul 25, 2022
Summary:
Fixes facebook#33751
Relates to facebook#33576

Jest 28 removed support for returning a string in the process method of a transformer (https://jestjs.io/docs/upgrading-to-jest28#transformer).

This PR changes assetFileTransformer to return an object instead of a string.

## Changelog

[Internal] [Fixed] - Return object from assetFileTransformer

Pull Request resolved: facebook#33756

Test Plan: Tests pass with Jest 28 when this change is made.

Reviewed By: cipolleschi

Differential Revision: D37242038

Pulled By: cortinico

fbshipit-source-id: d8a5054f5378183f644cd1458785084b26782193
danilobuerger pushed a commit to feastr/react-native that referenced this pull request Aug 10, 2022
Summary:
Fixes facebook#33751
Relates to facebook#33576

Jest 28 removed support for returning a string in the process method of a transformer (https://jestjs.io/docs/upgrading-to-jest28#transformer).

This PR changes assetFileTransformer to return an object instead of a string.

## Changelog

[Internal] [Fixed] - Return object from assetFileTransformer

Pull Request resolved: facebook#33756

Test Plan: Tests pass with Jest 28 when this change is made.

Reviewed By: cipolleschi

Differential Revision: D37242038

Pulled By: cortinico

fbshipit-source-id: d8a5054f5378183f644cd1458785084b26782193
danilobuerger pushed a commit to feastr/react-native that referenced this pull request Nov 18, 2022
Summary:
Fixes facebook#33751
Relates to facebook#33576

Jest 28 removed support for returning a string in the process method of a transformer (https://jestjs.io/docs/upgrading-to-jest28#transformer).

This PR changes assetFileTransformer to return an object instead of a string.

## Changelog

[Internal] [Fixed] - Return object from assetFileTransformer

Pull Request resolved: facebook#33756

Test Plan: Tests pass with Jest 28 when this change is made.

Reviewed By: cipolleschi

Differential Revision: D37242038

Pulled By: cortinico

fbshipit-source-id: d8a5054f5378183f644cd1458785084b26782193
Saadnajmi pushed a commit to Saadnajmi/react-native-macos that referenced this pull request Jan 15, 2023
Summary:
Jest 28 will error if only a string is returned from a transfomer, it needs to be an object of `{code: string, map?: object}`. Returning an object has been supported since jestjs/jest#2290, released in Jest v20.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Internal] [Fixed] - Return object from Jest preprocessor

Pull Request resolved: facebook#33576

Test Plan: Green CI?

Reviewed By: motiz88

Differential Revision: D35426748

Pulled By: robhogan

fbshipit-source-id: 3edb79b62b2d34274be192061817d3fcd8a7ba17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants