react-native-windows icon indicating copy to clipboard operation
react-native-windows copied to clipboard

Add DebugBundle/ReleaseBundle configurations to template app

Open kmelmon opened this issue 7 years ago • 5 comments

Summary

Currently, if you create an app using the CLI, and you want this app to use an offline bundle (not using metro), you need to manually build and package the app code into a bundle, and add the bundle as a resource to your appx package. These steps aren't easy to figure out how to do and really need to be automated. The current version solved this by having DebugBundle/ReleaseBundle build configurations in the template app. We should do the same for vnext.

Motivation

Folks will want to share appx packages and publish them to the app store. Doing this needs to be as easy as possible. Having to manually build the bundle is creating unnecessary friction, we should have first class support for this in our tooling.

Basic example

Open Questions

kmelmon avatar Jul 25 '19 23:07 kmelmon

I have one question for this. I added similar configurations to the App I am working on, but I ran into an issue that make using $(Configuration) variable problematic.

It's pretty common for the .targets files from nuget packages to use the $(Configuration) variable, and to assume that it will only ever be Debug or Release, this would cause headaches when using a configuration like 'DebugBundle' when the author of the nuget package assumed that only Release and Debug would be used.

I just wanted to ask if that's the approach you were planning to go with, and if you had any thoughts about this potential issue. (Or if you want to point out some basic misunderstanding I have.. happy to learn! 💯 )

For the app I'm working on we are using environment variables and checking their values in the project files to achieve this functionality. Environment variables can be checked in the project files using the same syntax $(variable), and adding scripts in project.json which set environment variables and then launch VS (or start building) has made it almost as convenient as having the options in the configuration drop-down.

stecrain avatar Aug 02 '19 13:08 stecrain

@stecrain I haven't investigated this yet, but we already have this working in 'current' so a first step would be to see how it's done there.

kmelmon avatar Aug 02 '19 17:08 kmelmon

Does anyone have a workaround? I'm trying to create a quick vNext app to test on a HoloLens, but I couldn't find instructions on how to build a standalone app, and I can't run the dev server on the HoloLens.

orshir avatar Aug 13 '19 22:08 orshir

@orshir - we haven't gotten to this yet. @kmelmon is planning to begin investigations here shortly, we will have some updates soon.

harinikmsft avatar Sep 27 '19 17:09 harinikmsft

V1 now done via https://github.com/microsoft/react-native-windows/pull/3367

kmelmon avatar Oct 11 '19 04:10 kmelmon