repack

A Webpack-based toolkit to build your React Native application with full support of Webpack ecosystem.

MIT License

Downloads
24.2K
Stars
1.5K
Committers
34

Bot releases are hidden (Show)

repack - repack-init 1.0.4

Published by RafikiTiki about 1 year ago

1.0.4

Patch Changes

  • #405 cbbb5b4 Thanks @jbroma ! - Fix bad behaviour of repack-init when run inside of a monorepo & fix for a case when react-native version was declared as SemVer range instead of static version
repack - 3.3.1

Published by RafikiTiki over 1 year ago

This Release comes with:

  • One patch change – an upgrade of an Android library (nimbus-jose-jwt) used to decode JWT. This upgrade was needed because of a security vulnerability affecting this package in the previous version used by Repack.
  • A few typos fixed in the example usage of the Federated module and RepackPlugin – #398. Thank you, @ergenekonyigit , for your contribution! 🎉

Patch Changes

  • #401 6171507 Thanks @jbroma ! - Update nimbus-jose-jwt android dependency to address security vulnerabilities
repack - 3.3.0

Published by RafikiTiki over 1 year ago

3.3.0

This release comes with:

  • three fixes from @jbroma that make living with a project using Repack with webpack instead of Metro bundler easier, and
  • one significant change – the optional ChunksToHermesBytecodePlugin created by @oblador & @mikeduminy at Klarna. This one can be manually added to the webpack config to ensure all chunks (or a subset of them, if the exclude parameter is specified) produced in the production build are indeed complied to the Hermes bytecode. Once again, big thanks for the contribution and I hope it's only the beginning of a great cooperation 🎉

📖 ChunksToHermesBytecodePlugin Docs can be found here: https://re-pack.netlify.app/docs/configuration/plugins/chunks-to-hermes

Minor Changes

  • #378 14afc61 Thanks @mikeduminy! - Add ChunksToHermesBytecodePlugin to transform all emitted chunks with Hermes

Patch Changes

  • #391 0693fda Thanks @jbroma! - Fix: stricter versions for dependencies inside podspec

  • #365 cf6c77a Thanks @jbroma! - Updated getResolveOptions exposed by RePack to prefer 'default' condition over webpack's defaults ['require', 'node']

  • #382 c1a5a2b Thanks @jbroma! - Fixed and issue where URL for remote asset only included basename from publicPath

repack - repack-init v1.0.3

Published by RafikiTiki over 1 year ago

@callstack/repack-init

1.0.3

Patch Changes

  • #363 470f10a Thanks @jbroma! - Fix bad package name when creating/updating react-native.config.js
repack - repack-init v1.0.2

Published by RafikiTiki over 1 year ago

Introducing @callstack/repack-init, which helps you setup RePack in your project in seconds!

After a few initial problems with release it's finally here!

Summary

repack-init is a utility npm package that automates the process of integrating the Repack bundler into React Native projects.

Here's a summary of the functionality repack-init provides:

  • Package Manager Detection: Identifies the package manager (npm or yarn) being used in the project.
  • React Native Verification: Checks whether React Native is installed in the project, and what version is being used.
  • Dependency Addition: Utilizes the established package manager to add necessary dependencies to the React-Native project.
  • Configuration of React Native Config: Checks for the existence of react-native.config.js and adds or modifies the necessary fields (commands).
  • Webpack Configuration: Creates and configures webpack.config.js based on user-provided flags (--mjs or --cjs).
  • iOS Modification: Updates the project.pbxproj file in the iOS directory.
  • Android Modification: Updates the build.gradle file in the Android directory based on specific React Native version requirements.

This tool aims to simplify the setup of Repack in React Native projects, ensuring developers can quickly start using Repack's features.

Limitations:

Minimum required node version: 16

Usage

Usage: @callstack/repack-init [options]

Options:
  -e, --entry    Path to main entry point for the React-Native project
                                                  [string] [default: "index.js"]
  -f, --format   Format of the webpack.config file
                               [string] [choices: "mjs", "cjs"] [default: "mjs"]
  -v, --verbose  Enables verbose logging              [boolean] [default: false]
      --version  Show version number                                   [boolean]
      --help     Show help                                             [boolean]

Example outputs

✔  Dependencies installed
✔  Created webpack.config.mjs from template
✔  Created react-native.config.js
✔  Added "webpack-bundle" as bundleCommand to android/app/build.gradle
✔  Added "webpack-bundle" as BUNDLE_COMMAND to build phase shellScript in ios/test1.xcodeproj/project.pbxproj

🎉 Setup complete. Thanks for using Re.Pack!

1.0.2

Patch Changes

  • Build the package properly before publishing to npm 🤦

1.0.1

Patch Changes

1.0.0

Major Changes

  • #356 17faa69 Thanks @jbroma! - Introducing @callstack/repack-init, which helps you setup RePack in your project in seconds!

    Usage:

    npx @callstack/repack-init
    
repack - 3.2.0

Published by RafikiTiki over 1 year ago

This release has two main features/improvements: Code Signing and Remote Assets.

Remote Assets

This has been an issue (#147, #223) for a long time, Repack users had to either manually implement a way to expose static assets (like images, videos etc) from the Remote Chunks/Federated Modules and then consume them in the Host Apps/Super Apps or, there was a more straightforward way – configure assets loader to base64 encode the images and inline them into the JS bundles. This was not the ideal solution because then the JS bundles quickly exploded in size, especially if the remote code was assets heavy.

Thanks to fantastic work from @jbroma, a built-in solution in Repack makes it easier to generate Remote Assets during build time and automatically adjust the JS bundles to use these assets. More thorough guides on handling assets are being worked on and will soon be added to the documentation website. For now, please refer to the usage section in the PR description: #331

Code Signing

This is a big one 🚀 ! Security is critical, especially in applications that allow remote code execution. That's why we bring an easy-to-configure way to cryptographically sign bundles which will be available for remote consumption in the Module Federation architecture. This will make it easy to ensure that the code the final users of your app are downloading is the code you intend them to download and is not tampered with. For more context and info on how to set it up, please refer to this PR: #348. We create a documentation page dedicated to this topic soon.

Repack

Minor Changes

Code Signing:

  • #318 6e12c14 Thanks @jbroma! - Added CodeSigning abilities to RePack:

  • #348 76e98e9 Thanks @jbroma! - Embed code-signing signatures into the bundles:

    • This potentially is a breaking change: min iOS version was bumped from 10 to 12 due to the usage of JWTDecode dependency
    • Introduced CodeSigningPlugin for generating code-signed bundles
    • Implemented CodeSigningUtils extension for native part of the ScriptManager to verify signed bundles on Android and iOS

Remote Assets

Patch Changes

  • #330 f142e06 Thanks @jbroma! - Code-Signing - move execution of the plugin to the later stage of compilation
  • #347 2180c09 Thanks @jbroma! - Fix OutputPlugin issue where chunks have no associated files with them

TesterApp

Minor Changes

Patch Changes

repack - 3.2.0-rc.1

Published by RafikiTiki over 1 year ago

This release candidate improves Code Signing implementation and brings a few additional improvements related to the Assets handling.

Minor Changes

Patch Changes

  • #330 f142e06 Thanks @jbroma! - Code-Signing - move execution of the plugin to the later stage of compilation
repack - 3.2.0-rc.0

Published by RafikiTiki over 1 year ago

This Release candidate introduces a new feature – Code Signing. It allows you to sign your bundles during build time and verify them on the client side. This feature is currently in experimental mode and the implementation is subject to change. Once we are confident that the API is stable, we will release a stable version of this feature along with the documentation and examples.

Minor Changes

  • #318 6e12c14 Thanks @jbroma! - Added CodeSigning abilities to RePack:

    • Introduced CodeSigningPlugin for generating code-signing mapping files
    • Implemented CodeSigningUtils extension for ScriptManager to verify signed bundles on Android and iOS
repack - 3.1.1

Published by RafikiTiki over 1 year ago

All packages

Patch Changes

Repack

Patch Changes

Dashboard

Patch Changes

TesterApp

Patch Changes

repack - 3.1.0

Published by RafikiTiki over 1 year ago

Minor Changes

  • #287 47bdd09 Thanks @andrewworld!

    A new optional callback shouldUpdateScript was added. It could be passed into so-called locator config in addResolver callback function return statement. Its main usage would be to ask a user whether they want to download the latest update of Federated Scripts or not (for example – if they are not connected to wifi and they would rather save their cellular data).

    shouldUpdateScript?: (
        scriptId?: string,
        caller?: string,
        isScriptCacheOutdated?: boolean
    ) => Promise<boolean> | boolean;
    

    More info and a set of examples describing what are the intended usages of this API will be published soon in a form of a guide in Repack docs. For now, if you're interested in playing with this API please refer to the linked PR or to the API docs

Patch Changes

  • #288 7e0092e Thanks @RafikiTiki! - Fix #258 – previously entryName config value was not passed from RepackPlugin to the OutputPlugin.
repack - 3.0.1

Published by RafikiTiki almost 2 years ago

Summary

This release resolves two issues related to Windows platform and adds two QoL improvements.

Windows related issues:

  • Fix for path formatting on Windows platform breaking assetsCache in development Compiler

  • #255 d974069 Thanks @meypod! - Fix v3 debugger-app not working on Windows platform

Quality of life improvements:

repack - Release 3.0.0

Published by jbinda about 2 years ago

Highlights

  • support Module Federation out of the box inside @callstack/repack package - see detailed CHANGELOG
  • introduce ScriptManager which handles loading local and remote scripts
  • custom ModuleFederationPlugin which support for remote@location syntax
  • support for CJS and ESM versions of Webpack config
  • introduce @callstack/repack-dev-server package - see detailed CHANGELOG
  • introduce @callstack/repack-debugger-app package - see detailed CHANGELOG

Breaking changes

  • Webpack configuration in webpack.config
  • refactored ChunkManager into ScriptManager

To see how to migrate from V2 check migration guide

Changelog

@callstack/repack

  • 1c29413 [email protected] (detailed CHANGELOG)

    • Expose --reverse-port argument in start command to fix dev server on Android 9960a7b
    • Pass SHARE_ENV to Worker to keep process envs from parent process 4bfeab1
    • TesterApp was refactored to ephasize relavant logic as clear as possible 3b5eb32
  • eadd108 [email protected] (detailed CHANGELOG)

    • Custom Module Federation plugin - Repack.plugins.ModuleFederationPlugin b588690:
      • Add custom ModuleFederationPlugin plugin with defaults for React Native
      • automatic remotes conversion to promise new Promise (via Federated.createRemote)
      • support for remote@location syntax
    • Priority for resolvers in ScriptManager b588690
  • 884e614 [email protected] (detailed CHANGELOG)

    • Prevent importModule from crashing with cannot read property __isInitialized of undefined ecf7829
    • Fix bi-directional imports in Module Federation 4e15c38
  • 1d70683 [email protected] (detailed CHANGELOG)

    • ScriptManager adjustments fa097f7:
      • Added ability to provide multiple resolvers to ScriptManager using ScriptManager.shared.addResolver
      • Removed ScriptManager.configure and split the functionality into ScriptManager.shared.setStore and ScriptManager.shared.addResolver
      • Added methods to remove a single resolver and to remove all resolvers
      • Returning undefined from a resolver will cause next resolver in line to be used (as long as other resolvers were added), if no resolver processed the request the error is thrown.
  • 6f560fd [email protected] (detailed CHANGELOG)

    • Module Federation 96a6b27:
      • Keep track of initialized remote containers to prevent performance degradation and crashes.
  • f544464 [email protected] (detailed CHANGELOG)

    • Assets loader b088203:
      • Add inline: boolean option to @callstack/repack/assets-loader.
      • Add support for calculating width, height and scale for inlined assets.
      • Add support for inlining multiple scales.
  • a067171 [email protected] (detailed CHANGELOG)

    • Added implementation for API functionalities in @callstack/repack-dev-server:
      • GET /api/platforms - List all platforms with active compilations
      • GET /api/:platform/assets - List all assets (name and size) for a given compilation
      • GET /api/:platform/stats - Get Webpack compilation stats
      • Websocket server under /api URI for logs and compilations events
  • 04fe409 [email protected] (detailed CHANGELOG)

    • HMR:
      • Upgraded @pmmmwh/react-refresh-webpack-plugin to 0.5.7 and added react-refresh@^0.14.0 as a @callstack/repack dependency.
      • RepackTargetPlugin now requires to pass hmr?: boolean property to a constructor - only relevant, if you're not using RepackPlugin
  • 05d126e [email protected] (detailed CHANGELOG)

    • ScriptManager:
    • Webpack improvements:
      • All Repack plugins are consolidated under single RepackPlugin, all sub-plugins are available under plugins
      • Added support for CJS and ESM versions of Webpack config
      • Added CJS and ESM templates for Webpack config
    • CLI:
      • Added --silent option to webpack-start command to silent all logs
      • Added --log-file <path> option to webpack-start command to log all messages to a file
      • Added --json webpack-start command to log all messages as JSON

@callstack/dev-server-repack

repack - Release 2.5.2

Published by zamotany almost 3 years ago

2.5.2 (2022-01-14)

Bug Fixes

  • replace process.env.PUBLIC_PORT with PUBLIC_PORT (#145) (02f2614)
repack - Release 2.5.1

Published by zamotany almost 3 years ago

2.5.1 (2021-11-15)

Bug Fixes

  • absolute flag and promise resolving inside the file system chunk loader (#134) (f62a307)
  • pointer to bool conversion in chunk config on iOS (#132) (e78640f)
  • scalable asset resolution (#133) (2000578)
repack - Release 2.5.0

Published by zamotany almost 3 years ago

2.5.0 (2021-10-29)

Bug Fixes

  • add default value for the local chunk check (#124) (170ee96)
  • add missing remoteChunksOutput option to the template (#123) (083754f)

Features

  • add chunk request timeout and absolute flag for URL (#126) (21bfdd5)
  • advanced fetching options for remote chunks (#108) (b11bc23)
repack - Release 2.4.2

Published by zamotany almost 3 years ago

2.4.2 (2021-10-21)

Bug Fixes

  • source map for main bundle (#120) (d5549cb)
  • updated links in readme to rebranded repack/ repo (#118) (8213303)
repack - Release 2.4.1

Published by zamotany about 3 years ago

2.4.1 (2021-10-12)

Bug Fixes

  • add missing events dependency (6c48f06)
  • update require_relative path to node_modules in TesterApp (#117) (b14d5ce)
repack - Release 2.4.0

Published by zamotany about 3 years ago

2.4.0 (2021-10-08)

Bug Fixes

  • prevent crash when using custom Webpack path (#109) (472f830)
  • source map output for remote chunks (#113) (7f55283)

Features

  • add repack bootstrap code to await chunk loading (#101) (5785972)
  • adjust source mapping info in bundles, source maps and manifest files (#112) (ffdd941)
  • allow to trigger compilation from dashboard (#103) (ebc787b)
  • show actual server logs count (#102) (94fb5d1)
repack - Release 2.3.1

Published by zamotany about 3 years ago

2.3.1 (2021-09-30)

Bug Fixes

  • asset resolver failure due to missing scales (#98) (4ec39f4)
  • stop caching chunks in dev environment (#96) (18c73d2)
repack - Release 2.3.0

Published by zamotany about 3 years ago

2.3.0 (2021-09-29)

Features

  • web dashboard (compilation statistics, server logs, artifacts) (#94) (5010f0e)