Commit Graph

23 Commits

Author SHA1 Message Date
Yujie Liu 489b98bf10 remove embeddedBundleURL
Reviewed By: fromcelticpark

Differential Revision: D6502049

fbshipit-source-id: 31a611cea4c017877c3ce2f7e9a3503723af4c2d
2017-12-21 12:02:32 -08:00
Yujie Liu d1fc8ef3a3 Fix embeddedBundleURL update situation
Reviewed By: zahanm

Differential Revision: D6432397

fbshipit-source-id: 163319c3c02976bcb49be3f0a54ce2928d0395f3
2017-11-28 19:46:20 -08:00
Kevin Gozali 28d5d6baf1 Fix asset resolver url handling
Summary:
1. file:// may get prepended to an http:// source URL during dev mode, making an invalid URL
2. the logic to detect `isLoadedFromFileSystem()` should've checked for file:// protocol to not get confused by http:// URL

Reviewed By: zahanm

Differential Revision: D6307187

fbshipit-source-id: e7e7a41bf721dd0601b0c1877e278e1e435ef5e2
2017-11-12 23:01:40 -08:00
Yujie Liu a329e968fc resolve iOS assets from embedded bundle path for iOS platform
Reviewed By: zahanm

Differential Revision: D6193907

fbshipit-source-id: 09c76a5c3d6a7777a9a823c21bfcc0fe344bc83e
2017-11-09 19:02:55 -08:00
Yujie Liu b0193b098c Rename bundleUrl to jsbundleURL
Reviewed By: fkgozali

Differential Revision: D6236921

fbshipit-source-id: f1018836465ba6cf21679fe9d21c18eec762199d
2017-11-07 17:46:17 -08:00
Mandeep Baines b89d6c8e04 consistent use of URL for resolving asset source
Reviewed By: frantic

Differential Revision: D5759789

fbshipit-source-id: daf33b6b66c4bff7f43213ee49286eafb6775f00
2017-09-08 10:47:22 -07:00
Aaron Chiu 1fa95ed390 inline a bunch of NativeModule requires
Reviewed By: shergin

Differential Revision: D4578180

fbshipit-source-id: 3764ffd32eb7e4698e928740bc72bbad02876894
2017-02-17 16:49:38 -08:00
Zahan Malkani 2209131933 Introduce custom asset resolver to resolveAssetSource(..)
Reviewed By: frantic

Differential Revision: D2989112

fb-gh-sync-id: a678d091aeb6904448c890653f57dd7944ce95c3
shipit-source-id: a678d091aeb6904448c890653f57dd7944ce95c3
2016-03-15 20:20:27 -07:00
Zahan Malkani 87245b2d40 Support the scriptURLs observed on Android for asset source resolver
Reviewed By: frantic

Differential Revision: D3005791

fb-gh-sync-id: 99acb350c8c80ebe22687294a0069891686885fc
shipit-source-id: 99acb350c8c80ebe22687294a0069891686885fc
2016-03-05 22:43:25 -08:00
Geoffrey Goh e730a9fdd0 Load assets from same folder as JSbundle (Android)
Summary:
https://github.com/facebook/react-native/issues/3679 was only partially fixed as the behaviour only works on iOS. This implements the same behaviour for Android. If the JSBundle was loaded from the assets folder, this will load images from the built-in resources. Else, load the image from the same folder as the JS bundle.

EDIT: For added clarity:

On iOS,
Bundle Location: 'file:///Path/To/Sample.app/main.bundle'
httpServerLocation: '/assets/module/a/'
Name: 'logo'
type: 'png'
**Resolved Asset location: '/Path/To/Sample.app/assets/module/a/logo.png'**

On Android,
Bundle Location: 'file:///sdcard/Path/To/main.bundle'
httpServerLocation: '/assets/module/a/',
name: 'logo'
type: 'png'
**Resolved Asset location: 'file:///sdcard/Path/To/drawable_mdpi/module_a_logo.png'**
Closes https://github.com/facebook/react-native/pull/4527

Reviewed By: svcscm

Differential Revision: D2788005

Pulled By: mkonicek

fb-gh-sync-id: 3f6462a7ee6370a92dd6727ac422c5de346c3ff1
2016-01-06 08:46:35 -08:00
Alex Kotliarskyi 10b599c343 Load assets from same folder as JS bundle
Summary: Fixes #3679, see https://github.com/facebook/react-native/issues/3679

The idea is to always load images from the same folder that we loaded JS bundle.

This doesn't change the current behavior, since `imageNamed:` inferred the
absolute path to the image from app's bundle, but now we make it explicit.

The benefit for OTA updates implementations is that they can simply ask RN
to load js from some `~/Documents/<build-id>/main.jsbundle` folder and RN will
look for images in `~/Documents/<build-id>/assets/`.

Note that for Android we will have to come out with a different plan, since
in prod we load images from built-in resources.

public

Reviewed By: vjeux

Differential Revision: D2616995

fb-gh-sync-id: 2906c62380280ecb987525edf9a0e3e727a1008b
2015-11-05 12:53:26 -08:00
Nick Lockwood 5b425278bb Removed references to isStatic from the codebase
Summary: @​public

The legacy 'isStatic' property for image sources is no longer used anywhere in our codebase, but was still being generated by the packager and referenced in the JS in various places.

This diff removes all the remaining references.

Reviewed By: @frantic

Differential Revision: D2531263

fb-gh-sync-id: 0bba0bb8473b1baa908ef7507cbf6d83efb0d9ee
2015-10-13 06:44:30 -07:00
Alex Kotliarskyi 393ead59dc Always return `scale` from resolveAssetSource
Reviewed By: @nicklockwood

Differential Revision: D2532565

fb-gh-sync-id: 113b8318a8f1a9b0dac4fab389a98ddd51d00e17
2015-10-13 06:44:16 -07:00
Alex Kotliarskyi 62d0586e59 Rely only on scriptURL when loading images
Reviewed By: @foghina

Differential Revision: D2527119

fb-gh-sync-id: e2a9618f729a2ec03b1959fa13fae46620cc379e
2015-10-12 11:36:26 -07:00
Alex Kotliarskyi f07dd70051 Managed assets support for RCTConvert
Reviewed By: @nicklockwood

Differential Revision: D2443130
2015-09-29 09:21:39 -07:00
Alex Kotliarskyi ce47e56b7b Attach platform to asset url
Summary: Depends on D2420548

Reviewed By: @martinbigio

Differential Revision: D2421696
2015-09-09 11:25:26 -07:00
Alex Kotliarskyi d723e17629 [ReactNative] Copy assets to corresponding folders on Android 2015-06-01 12:21:53 -08:00
Martin Konicek 92fc92835f [ReactNative] Resolve assets on Android 2015-05-13 13:24:36 -07:00
Alex Kotliarskyi c76fb40ec4 [ReactNative] Register assets with AssetRegistry 2015-05-07 17:27:42 -08:00
Alex Kotliarskyi 970bff6132 [ReactNative] Enable resolveAssetSource for Image.android 2015-04-24 10:56:04 -08:00
Alex Kotliarskyi ffb3026419 [ReactNative] Pick correct assets depending on device scale 2015-04-22 16:39:54 -08:00
Alex Kotliarskyi c5ea25f7fb [ReactNative] Adopt client asset managing code to server changes 2015-04-22 13:41:28 -08:00
Alex Kotliarskyi c6ad7b85d1 [ReactNative] Use network image for new image assets 2015-04-21 12:45:36 -08:00