Skip to content

Conversation

tsapeta
Copy link
Contributor

@tsapeta tsapeta commented May 29, 2019

Moving expo-template-blank and expo-template-tabs from the universe repo, so all project templates will be at the same place.
Unfortunately there are some duplicated commits because I wanted to keep the history and was unable to move these two folders at once.

Also added publish-project-templates script to expotools. Demo:
Screen Shot 2019-05-30 at 09 54 05

fson and others added 28 commits November 27, 2018 14:34
* [templates] Update expo-template-tabs to SDK32 (tests failing)

* [expo-template-tabs] Upgrade dependencies

* [expo-template-tabs] Upgrade jest-expo

* [expo-template-tabs] Upgrade jest-expo

* [expo-template-blank] Update dependencies to published SDK32

* [expo-template-tabs] Update dependencies to published SDK32

* [templates] Publish templates for SDK32
* [templates] Update expo-template-tabs to SDK32 (tests failing)

* [expo-template-tabs] Upgrade dependencies

* [expo-template-tabs] Upgrade jest-expo

* [expo-template-tabs] Upgrade jest-expo

* [expo-template-blank] Update dependencies to published SDK32

* [expo-template-tabs] Update dependencies to published SDK32

* [templates] Publish templates for SDK32
The blank template is intended to be minimal -- removing the class extension slims this down further.
Optimized the PNG images further for performance and to use less bandwidth.
This updates the tabs template to work with SDK 33 (dependency versions are not yet final) and uses modular imports. It uses React hooks as well. I also made the unit tests render a shallow tree so that the unit under test is smaller.

Test Plan:

- Run Jest tests with `yarn jest`
- Open project on iOS after setting sdkVersion to 33.0.0 and verify that all screens and links work
Use the precise version, since sometime patch versions of React have broken the interface between React and RN.
@tsapeta tsapeta marked this pull request as ready for review May 29, 2019 17:51
@tsapeta tsapeta requested a review from ide May 29, 2019 17:52
@ide
Copy link
Member

ide commented May 29, 2019

This TS template also needs to be moved over sometime: https://github.com/expo/universe/commit/32f60c7d145e05bae903d35d2c4844a897dd95ba

ccheever and others added 2 commits May 30, 2019 09:59
Basically just copied the directory for the blank template
then followed the instructions for adding TypeScript to an Expo
project and then made a few tweaks based on discussions with @ide
@tsapeta tsapeta force-pushed the @tsapeta/move-templates-from-universe branch from 4ad89e1 to 89c379a Compare May 30, 2019 08:02
@tsapeta tsapeta requested a review from sjchmiela May 30, 2019 08:08
Copy link
Contributor

@sjchmiela sjchmiela left a comment

Choose a reason for hiding this comment

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

One comment and please squash commits ❤️

"expo-asset": "^5.0.0-rc.0",
"expo-constants": "^5.0.0-rc.0",
"expo-font": "^5.0.0-rc.0",
"expo-web-browser": "^5.0.0-rc.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

^5.0.0?

@tsapeta tsapeta changed the base branch from master to sdk-33 May 30, 2019 08:55
@tsapeta tsapeta changed the base branch from sdk-33 to master May 30, 2019 08:55
@tsapeta tsapeta merged commit e7954ff into master May 30, 2019
tsapeta added a commit that referenced this pull request May 30, 2019
Moving `expo-template-blank` and `expo-template-tabs` from the universe repo, so all project templates will be at the same place.
Unfortunately there are some duplicated commits because I wanted to keep the history and was unable to move these two folders at once.

Also added `publish-project-templates` script to `expotools`. Demo: 
![Screen Shot 2019-05-30 at 09 54 05](https://user-images.githubusercontent.com/1714764/58618307-8e0d1880-82c2-11e9-871a-efef88d4222a.png)
sjchmiela added a commit that referenced this pull request Nov 22, 2019
- despite the upgrade to Babel 7 being mentioned in the blog post, it
  wasn't mentioned in the upgrade walkthrough or the CHANGELOG
- if one were using the default, auto-generated .babelrc before SDK31,
  it would cause errors after upgrading to SDK31+, and there are no
  details about how to fix this when upgrading
- the default babel config changed with SDK31 to a babel.config.js
  and no transform-react-jsx-source

I'm not sure if the PR I referenced in the added changelog entry is the correct one to use. While c75b43b of #2373 does change to `babel.config.js`, it seems to be internal changes only. The changes to the default, auto-generated `.babelrc` to `babel.config.js` in the template seemed to have changed in the old `universe` repo, which no longer exists. #4335 moved the templates over and is the only record I could find of these templates.

Closes #6155

I recently upgraded [a project](https://github.com/agilgur5/react-native-manga-reader-app) from SDK29 to SDK33, and while there were [a handful of issues](agilgur5/react-native-manga-reader-app#12 (comment)), the one that was most confusing was why I was getting Babel errors. The `.babelrc` config I was using before was the default, auto-generated one by Expo, not anything custom, but apparently it broke during the SDK31 upgrade. It broke, but nothing about changing the Babel config was mentioned in the upgrade walkthrough docs or in the CHANGELOG (there is a mention of upgrading to Babel 7 in the blog post, but it seemed mostly internal and SDK29 already used Babel 7 RC1). The default Babel config was changed though (no more `transform-react-jsx-source`) and was changed to a `babel.config.js`.

I only found out about this issue and its fix by searching online, and there seemed to have been a great many people similarly confused by this:
- #2574 (comment)
- #2576 (comment)
- https://stackoverflow.com/a/54258361/3431180 (SO Q&A on this topic)
- https://medium.com/@wcandillon/congratulations-expo-and-react-native-and-incredible-tools-c83dfb143599 (comment on SDK 31 blog post on this topic)
- https://forums.expo.io/t/upgrade-to-expo-31-babel-7/17044

This is definitely a breaking change, and on top of that, based on the issues and upvotes, it affected a lot of people (and may still affect more who are lagging on upgrades too), so I think it should definitely be mentioned in the upgrade guides and changelog for SDK31

Added an entry to the changelog and upgrade docs so that it is clearly addressed for those seeking to upgrade

N/A, just docs

Co-authored-by: Joel Califa <4970083+agilgur5@users.noreply.github.com>
@tsapeta tsapeta deleted the @tsapeta/move-templates-from-universe branch February 25, 2020 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants