-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: handle stripping flow types from popular packages (#765)
* refactor: add getModulePaths to utils index * feat: add rules for transpiling flow typed modules * chore: add jsdocs for other rules as well * chore: add flow rule to v5 templates * fix: add flow rules to index * chore: add flow rule to testers * chore: add changeset
- Loading branch information
Showing
12 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@callstack/repack": minor | ||
--- | ||
|
||
Add default rules for transpiling popular flow typed packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import type { RuleSetRule } from '@rspack/core'; | ||
import { getModulePaths } from '../utils'; | ||
|
||
/** | ||
* @constant FLOW_TYPED_MODULES_LOADING_RULES | ||
* @type {RuleSetRule} | ||
* @description Module rule configuration for loading flow-typed modules. | ||
*/ | ||
export const FLOW_TYPED_MODULES_LOADING_RULES: RuleSetRule = { | ||
type: 'javascript/auto', | ||
test: /\.jsx?$/, | ||
include: getModulePaths([ | ||
'react-native-blob-util', | ||
'react-native-pdf', | ||
'@react-native-picker/picker', | ||
'react-native-config', | ||
'react-native-fs', | ||
'react-native-image-size', | ||
'react-native-performance', | ||
'react-native-vector-icons', | ||
'@react-native-community/datetimepicker', | ||
]), | ||
use: { | ||
loader: '@callstack/repack/flow-loader', | ||
options: { all: true }, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './reactNativeLoadingRules'; | ||
export * from './reactNativeCodegenRules'; | ||
export * from './nodeModulesLoadingRules'; | ||
export * from './flowTypedModulesLoadingRules'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters