feat(cli, router, metro, asset): add basePath support (#23911)# Why - Add the ability to export websites for hosting from a custom path. This is required for GitHub pages. - Resolve ENG-9193
feat(cli, router, metro, asset): add basePath support (#23911)# Why - Add the ability to export websites for hosting from a custom path. This is required for GitHub pages. - Resolve ENG-9193 - Resolve https://github.com/expo/expo/issues/20562 - Resolve https://github.com/expo/router/issues/165 <!-- Please describe the motivation for this PR, and link to relevant GitHub issues, forums posts, or feature requests. --> # How - Add `expo.experiments.basePath` which can be used during `npx expo export` to modify how assets are referenced. - Set the `publicPath` in Metro to output as expected. - Add custom asset writing for web to support stripping the unused prefix. - It's unclear if this should also apply to native, and if we should have platform-specific variations. - Update Expo Router to support automatically adjusting paths to support basePath in production builds. <!-- How did you build this feature or fix this bug and why? --> # Test Plan - [ ] New `expo export` test. <!-- Please describe how you tested this change and how a reviewer could reproduce your test, especially if this PR does not include automated tests! If possible, please also provide terminal output and/or screenshots demonstrating your test/reproduction. --> # Checklist <!-- Please check the appropriate items below if they apply to your diff. This is required for changes to Expo modules. --> - [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). --------- Co-authored-by: Expo Bot <[email protected]> Co-authored-by: Aman Mittal <[email protected]>
show more ...
[font][Android] Migrate to new API (#24015)# Why Migrate to the new API # Test Plan - bare-expo ✅ - expo go ✅
feat(font): add static optimization for fonts in expo router (#24027)# Why Extract fonts loaded with expo-font when using Expo Router on with server rendering on web. This ensures that fonts ar
feat(font): add static optimization for fonts in expo router (#24027)# Why Extract fonts loaded with expo-font when using Expo Router on with server rendering on web. This ensures that fonts are available before the JavaScript loads, leading to much better UI during the initial render. Consider the following snippet: ```js import FontAwesome from "@expo/vector-icons/FontAwesome"; import * as Font from "expo-font"; import { Text } from "react-native"; export default function Layout() { // These fonts will be statically extracted on web and added to the initial HTML. const [loaded, error] = Font.useFonts({ ...FontAwesome.font, Inter_400Regular: require("@/assets/fonts/Inter_400Regular.ttf"), Inter_500Medium: require("@/assets/fonts/Inter_500Medium.ttf"), }); if (loaded) { // This code-path will never be used in static rendering now. return null; } // This font is now styled before the JavaScript loads. return ( <Text style={{ fontFamily: 'Inter_400Regular' }}>Hey</Text> ); } ``` > Native can continue to be written defensively, web will adapt to the API. https://github.com/expo/expo/assets/9664363/e03de783-bcee-49d3-9bca-15bfc87966d5 <!-- Please describe the motivation for this PR, and link to relevant GitHub issues, forums posts, or feature requests. --> # How - When `loadAsync` or `useFonts` is used during static rendering, the font will be added to a shared server context, which is then pulled in `expo-router` and added to the static HTML. This doesn't work if the call is outside the React tree, or if the font is loaded asynchronously, or if the font is loaded in a `useEffect`. - Updated docs to reflect new system. # Test Plan - E2E bundling test. - Ensure that `useFonts` doesn't return `false` on the first render, this prevents returning `null` and rendering nothing actionable. - Ensure fonts are linked and preloaded according to the routes that load them, including nesting. - Node unit test to reduce the chance of breaking the more fragile parts of the API. - Published in a test app: [before](https://64e0e449c07fa060ba0ce443--pillarvalley.netlify.app/settings/) [after](https://64e0fb6251f1396c0b3eb62f--pillarvalley.netlify.app/settings/). Notice that disabling JavaScript doesn't break font loading. <!-- Please describe how you tested this change and how a reviewer could reproduce your test, especially if this PR does not include automated tests! If possible, please also provide terminal output and/or screenshots demonstrating your test/reproduction. --> # Checklist <!-- Please check the appropriate items below if they apply to your diff. This is required for changes to Expo modules. --> - [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). --------- Co-authored-by: Expo Bot <[email protected]> Co-authored-by: Aman Mittal <[email protected]>
chore(expo-font): Change unloaded font error to a warning. (#23788)# Why - In React Native v72, invalid fonts will no longer throw a fatal native error. We can now pass the font to native as-is
chore(expo-font): Change unloaded font error to a warning. (#23788)# Why - In React Native v72, invalid fonts will no longer throw a fatal native error. We can now pass the font to native as-is when running in Expo Go, this will be much closer to the behavior outside of Expo Go. - The font loading hint in Expo Go will now use `console.warn` instead of `console.error`. --------- Co-authored-by: Expo Bot <[email protected]>
Gracefully handle font observer failure and extend timeout (#22954)# Why Fixes https://github.com/expo/expo/issues/12382 # How The font observer can time out and throw an uncaught exceptio
Gracefully handle font observer failure and extend timeout (#22954)# Why Fixes https://github.com/expo/expo/issues/12382 # How The font observer can time out and throw an uncaught exception, as noted by many bug reporters. There are many cases (e.g., unsupported browsers) where the observer is early-returned, so catching an exception on web is a safe no-op. # Test Plan This is tough to write a new test for since this is mostly a product of network conditions; does this need new test coverage? # Checklist - `[N/A]` Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - `[N/A]` Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [x] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin).
[docs] Fix internal links to avoid redirects (#22498)
fix(expo-font): fix require cycle on web. (#21593)Co-authored-by: Expo Bot <[email protected]>
[2/3] upgrade react native 0.71 (#20832)# Why follow up #20799 for react-native 0.71 upgrade. this pr aims for jest upgrade and fix all broken tests. close ENG-7192 # How - upgrade packag
[2/3] upgrade react native 0.71 (#20832)# Why follow up #20799 for react-native 0.71 upgrade. this pr aims for jest upgrade and fix all broken tests. close ENG-7192 # How - upgrade packages - `jest: ^26.0.24 -> ^29.2.1` - `jest-watch-typeahead: 0.6.4 -> 2.2.1` - `@types/jest: ^26.0.24 -> ^29.2.1` - `babel-jest: ^26.6.3 -> ^29.2.1` - `@jest/create-cache-key-function: ^27.0.1 -> ^29.2.1` - `@babel/preset-env: ^7.12.9 -> ^7.14.0` - `eslint: ^8.20.0 -> ^8.29.0` - add `jest-environment-jsdom` because new jest does not include it by default - [core] fix `SyntheticPlatformEmitter` type error. originally it refers to `react-native/Libraries/EventEmitter/RCTDeviceEventEmitter` internal file which has incorrect type setup in 0.71. we could use the `react-native.DeviceEventEmitter` instead. - [expo-linking]: remove the deprecated `Linking.removeEventListener` (which is also removed from upstream) - [firebase-recaptcha] remove broken web test because firebase ESM which is not supported by jest. this pr simply remove the test case because the package is deprecated. - [jest-expo-enzyme] remove this package and move to [the archived repo](https://github.com/expo/jest-expo-enzyme). enzyme cannot upgrade to jest 29. - remove `@types/react-native` and the versioned cli package check. because 0.71 ships the types directly. - [ncl] workaround `@react-native-community/slider`, `@react-native-segmented-control/segmented-control`, and `@react-native-masked-view/masked-view` type errors in the `react-native-71-fix.d.ts`. - for other details, please check the commit histories one by one. # Test Plan - ci passed - for test-suite ios ci error, i've mentioned in #20799
feat(asset): add support for font loading in metro web (#19234)* feat(asset): add support for font loading in metro web * Update CHANGELOG.md * Update CHANGELOG.md * Update packages/@expo/
feat(asset): add support for font loading in metro web (#19234)* feat(asset): add support for font loading in metro web * Update CHANGELOG.md * Update CHANGELOG.md * Update packages/@expo/cli/CHANGELOG.md Co-authored-by: Expo Bot <[email protected]> * Update packages/expo-font/CHANGELOG.md Co-authored-by: Expo Bot <[email protected]> * Update FontLoader-test.web.ts Co-authored-by: Expo Bot <[email protected]>
[font] Fix loading fonts on web and Next.js (#17130)
[font] small tweaks for the code docs (#18449)
Change several expo.io references to expo.dev or exp.host (#16803)Docs: - Replaced docs.expo.io links in READMEs with docs.expo.dev - Updated references to docs.expo.io throughout docblocks in so
Change several expo.io references to expo.dev or exp.host (#16803)Docs: - Replaced docs.expo.io links in READMEs with docs.expo.dev - Updated references to docs.expo.io throughout docblocks in source code - Updated package.json files that linked to docs.expo.io Emails: - Changed some support and test emails to use `@expo.dev` Classic update hosts: - Changed `exp://expo.io` links to `exp://exp.host` links. This change is consistent with the URLs that Expo CLI generates.
[multiple packages] Fix broken typings causing `check-packages` failures (#14912)
[eslint-config] remove `arrowParens` overwrite, reformat files (#14232)
[jest] Update mocks and snapshots
Rename unimodules imports to expo-modules-core
[font] Add doc comments in source (#13650)
Remove usage of `fbjs` from most packages (#11396)* expo-web-browser * expo-device * expo-camera * expo-notifications * legacynotification in expo package * expo-font * expo-const
Remove usage of `fbjs` from most packages (#11396)* expo-web-browser * expo-device * expo-camera * expo-notifications * legacynotification in expo package * expo-font * expo-constants * expo-updates * expo-sensors * expo-error-recovery * expo-gl * expo-linking * changelogs * rebuild expo-device * add missing space to changelog entries Co-authored-by: Evan Bacon <[email protected]> Co-authored-by: Evan Bacon <[email protected]>
[expo-font] Remove Expo.AppLoading reference (#11204)
[TS] Upgrade packages to TypeScript 4.0 (#9960)
[lint] Turn off react-hooks/exhaustive-deps by default (#9130)This lint rule has been relatively noisy since it errs on the side of reporting false positives. Our linter philosophy is that needing
[lint] Turn off react-hooks/exhaustive-deps by default (#9130)This lint rule has been relatively noisy since it errs on the side of reporting false positives. Our linter philosophy is that needing to write `// eslint-ignore` indicates an issue with the linter choices and we err on the side of trusting the programmer. It's easy to turn this back on in an app by adding `'react-hooks/exhaustive-deps': 'warn'` to the app's own config. Removed the `// eslint-ignore` comments for this rule from all the places we had them. Updated the test snapshots and verified the changes looked right. Ran the linter config unit tests and made sure they passed.
[packages] Change legacy RN docs URL to new reactnative.dev (#8806)# Why Closes https://github.com/unimodules/react-native-unimodules/pull/117. # How Searched for `facebook.github.io/react
[packages] Change legacy RN docs URL to new reactnative.dev (#8806)# Why Closes https://github.com/unimodules/react-native-unimodules/pull/117. # How Searched for `facebook.github.io/react-native` in `packages`, replaced URLs with `reactnative.dev` verifying if they lead to proper pages. # Test Plan Done, manually.
[expo-font] Fix font loading timeout on Internet Explorer (#8652)# Why Fixes #6752. # How This PR adds IE exclusion to `isFontLoadingListenerSupported` which fixes font loader on IE11.
[expo-font] Fix font loading timeout on Internet Explorer (#8652)# Why Fixes #6752. # How This PR adds IE exclusion to `isFontLoadingListenerSupported` which fixes font loader on IE11. # Test Plan - Import `MaterialIcons` from `@expo/vector-icons` and try to render one - Open the page in Internet Explorer 11
[lint] Add React hooks support to the linter plugin (#8455)This adds support for analyzing hooks with https://www.npmjs.com/package/eslint-plugin-react-hooks. This way we are more likely to catch e
[lint] Add React hooks support to the linter plugin (#8455)This adds support for analyzing hooks with https://www.npmjs.com/package/eslint-plugin-react-hooks. This way we are more likely to catch errors regarding hooks earlier. I enabled the two rules the plugin supports with their recommended severity levels. Added test cases to the fixtures, generated snapshots, and ensured the snapshots contained the expected errors and warnings.
[expo-font] Fix require cycle in expo-font (#8215)
123