Skip to content
This repository has been archived by the owner on Dec 21, 2022. It is now read-only.

Fix pluggable widgets tools native bundling #291

Merged
merged 13 commits into from Sep 3, 2020

Conversation

IIsaku
Copy link
Contributor

@IIsaku IIsaku commented Aug 25, 2020

  • pluggable-widgets-tools release for native widgets now creates bundles for production environments when there is no local webpack production config.
  • All native widget bundles are now transpiled for RN JavaScript runtime with metro-react-native-babel-preset.
  • TypeScript compiler now emits esnext modules, which allows Webpack to tree shake widget code before bundling. This can lead to smaller bundle sizes for all (web & native) widgets.
  • Mono repo specific native webpack config is removed, so native widgets directly use the native webpack config of PIW tools.
  • Removed @babel/preset-env for native widgets, because RN will handle transpilation.
  • For generator-widget fix test project ignore path in .prettierignore.

@IIsaku IIsaku requested a review from a team August 25, 2020 07:52
@IIsaku IIsaku force-pushed the fix/pluggable-widgets-tools-native-bundling branch from f2d76e1 to 9b3db33 Compare August 27, 2020 10:11
@IIsaku IIsaku requested a review from mijay August 27, 2020 11:37
mijay
mijay previously approved these changes Aug 27, 2020
Copy link
Contributor

@diego-antonelli diego-antonelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

mijay
mijay previously approved these changes Aug 28, 2020
- Remove devtool, since this is now set via gulp
- Change module to es2015, which allows webpack to tree shake widget code
- Change module for all ts widgets to esnext
- For native ts widgets target esnext
- Remove @babel/preset-env for native widgets, because RN will handle transpilation
- Native widgets now use native webpack config from PIW tools directly
- Webpack 4 cannot handle esnext output (optional chaining). Webpack 5 will support this.
- Find the actual module rule and append the babel plugin to it
- Optional chaining isn't supported in Webpack 4.
With js code, babel-loader didn't transpile optional chaining.
- All native widgets are now transpiled for RN runtime with metro-react-native-babel-preset
- Prettierignore didn't work properly for project path
@IIsaku IIsaku force-pushed the fix/pluggable-widgets-tools-native-bundling branch from 92af9f7 to 1a8f4ad Compare August 28, 2020 16:03
- metro-react-native-babel-preset in PIW tools webpack config strips the flow types
@IIsaku IIsaku merged commit 70a9658 into master Sep 3, 2020
@IIsaku IIsaku deleted the fix/pluggable-widgets-tools-native-bundling branch September 3, 2020 07:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants