| #
1f98cdd7 |
| 22-Aug-2023 |
Evan Bacon <[email protected]> |
fix imports lint (#24051)
# Why
<!--
Please describe the motivation for this PR, and link to relevant GitHub
issues, forums posts, or feature requests.
-->
# How
<!--
How did you build
fix imports lint (#24051)
# Why
<!--
Please describe the motivation for this PR, and link to relevant GitHub
issues, forums posts, or feature requests.
-->
# How
<!--
How did you build this feature or fix this bug and why?
-->
# Test Plan
<!--
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]>
show more ...
|
| #
453a056b |
| 13-Jun-2023 |
Evan Bacon <[email protected]> |
fix(cli, metro-config): fix tests and types (#22867)
|
| #
da5824c9 |
| 12-Jun-2023 |
Kudo Chien <[email protected]> |
[cli] fix typecheck from react-native 0.72 upgrade (#22766)
# Why
follow up #22588 which disabled the cli typecheck
# How
using types from metro and fix typing issues
# Test Plan
cli
[cli] fix typecheck from react-native 0.72 upgrade (#22766)
# Why
follow up #22588 which disabled the cli typecheck
# How
using types from metro and fix typing issues
# Test Plan
cli ci passed
show more ...
|
| #
6a750d06 |
| 08-Apr-2023 |
Evan Bacon <[email protected]> |
feat(cli, metro-config): environment variable support (#21983)
# Why
- It's nice to be able to use uncommitted values in your app, based on
the environment. This feels very familiar to web devel
feat(cli, metro-config): environment variable support (#21983)
# Why
- It's nice to be able to use uncommitted values in your app, based on
the environment. This feels very familiar to web developers.
- Values that are prefixed with `EXPO_PUBLIC_` will be inlined in the
bundle when bundling normally (e.g. not for Node.js).
- `.env` files are loaded into memory and applied to the process during
a run. This also means that they're available in `app.config.js`.
- During development-only, environment variables are exposed on the
`process.env` object (non-enumerable) to ensure they're available
between fast refresh updates.
<!--
Please describe the motivation for this PR, and link to relevant GitHub
issues, forums posts, or feature requests.
-->
# How
- Create new package `@expo/env` which is used to hydrate env variables
in a unified way. I plan to open another PR in `eas-cli` which uses this
package to fill in environment variables before uploading. NOTE:
environment variables that are defined in eas.json are not available in
Expo CLI when building locally, but are available in the cloud since
they'll be on the process, this means they effectively emulate
`.env.production`.
- Update templates to gitignore local env files.
- Add basic documentation to the versioned metro guide (more to come).
<!--
How did you build this feature or fix this bug and why?
-->
# Test Plan
- [ ] E2E rendering test
- [ ] E2E Node.js rendering test
- [x] Unit tests for serializer
- [x] Tests for env package
<!--
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 `expo prebuild` & EAS Build (eg:
updated a module plugin).
show more ...
|
| #
9b2597ba |
| 06-Apr-2023 |
Evan Bacon <[email protected]> |
feat(metro-config, cli): CSS support for Metro web (#21941)
# Why
This PR moves the CSS support from Expo Router over to
`expo/metro-config` behind a beta flag. This is because we need deeper
i
feat(metro-config, cli): CSS support for Metro web (#21941)
# Why
This PR moves the CSS support from Expo Router over to
`expo/metro-config` behind a beta flag. This is because we need deeper
integration with Expo CLI and Metro in order to emit static CSS files in
production bundles. CSS is required for media queries -> rehydration.
- Related: https://github.com/expo/router/pull/397
https://github.com/expo/router/pull/223
<!--
Please describe the motivation for this PR, and link to relevant GitHub
issues, forums posts, or feature requests.
-->
# How
Instead of a babel transformer, we now use a custom "transformer" which
gives us the ability to add extra metadata to a Metro module on export.
This means we can pass the raw and processed CSS for writing to disk.
The development version of CSS still uses script injection via
JavaScript, meaning static rendering cannot currently be tested in
development.
CSS Modules are implemented (web-only currently) using lightningcss. The
export is generated to work with React Native for web. Consider the
following block:
```js
export default { ...StyleSheet.create({ container: { $$css: true, _: 'hashed-container-id' } }) }
```
CSS Variables are not currently hashed, enabling the user to define
variables in a global CSS file and access them in CSS Modules (subject
to change in order to support native). CSS variables are accessible from
the default export as strings: `styles['--color'] === '--color'`.
## Docs
I've chosen to document in the versioned metro doc instead of the
unversioned guide, this seems like a reasonable spot given the highly
experimental nature of this feature.
<!--
How did you build this feature or fix this bug and why?
-->
# Test Plan
- Unit tests for conversion.
- [x] Test in/out for transformer.
- [ ] Test static export.
- TBD for E2E
<!--
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 `expo prebuild` & EAS Build (eg:
updated a module plugin).
show more ...
|
| #
33643b60 |
| 04-Mar-2023 |
Evan Bacon <[email protected]> |
feat(cli): auto setup typescript during start (#21475)
# Why
- Some users are confused about how to use the fully automated
TypeScript setup. It currently runs when you run `npx expo start` in a
feat(cli): auto setup typescript during start (#21475)
# Why
- Some users are confused about how to use the fully automated
TypeScript setup. It currently runs when you run `npx expo start` in a
project with `tsconfig.json` or any TypeScript file in the project.
- This change will run the TypeScript check continuously until
TypeScript is setup. This only applies to projects using Metro, and
currently is only run in `npx expo start`, and the run commands (when
the server is started in the current window, e.g. not headless mode).
<!--
Please describe the motivation for this PR, and link to relevant GitHub
issues, forums posts, or feature requests.
-->
# How
- Fork the `runServer` function from Metro into the CLI so we can access
the Metro bundler instance directly.
- Use Metro's native file watching to observe new TypeScript files being
added to the project (within the observable files). This is fast and
ensures we don't accidentally block a thread that otherwise could've
been used for bundling.
- The TypeScript continuous check only runs once, if you remove
TypeScript and add it back in the same process, then nothing happens.
This is a performance optimization.
- If TypeScript is enabled while the process is running, the user will
not be prompted to install, the packages will just install in the
project. Failures will be displayed in the running process, and no more
attempts will be made.
- If TypeScript is detected on start then the existing system will be
used and the continuous check will be skipped, this means projects
already using TypeScript won't have any technical performance hit.
<!--
How did you build this feature or fix this bug and why?
-->
# Test Plan
- In a project without TypeScript:
- `npx expo`
- `touch tsconfig.json` or `mv index.js index.tsx` or `touch foo.tsx`
- TypeScript is automatically installed for the project.
- `EXPO_NO_TYPESCRIPT_SETUP` voids this behavior
- Added unit tests.
<!--
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 `expo prebuild` & EAS Build (eg:
updated a module plugin).
---------
Co-authored-by: Expo Bot <[email protected]>
Co-authored-by: Cedric van Putten <[email protected]>
show more ...
|
| #
be9ba12c |
| 26-Sep-2022 |
Evan Bacon <[email protected]> |
feat(metro-config): enable unstable_allowRequireContext (#19257)
* unstable_allowRequireContext
* fix build files
* Update CHANGELOG.md
* Update packages/@expo/cli/CHANGELOG.md
Co-author
feat(metro-config): enable unstable_allowRequireContext (#19257)
* unstable_allowRequireContext
* fix build files
* Update CHANGELOG.md
* Update packages/@expo/cli/CHANGELOG.md
Co-authored-by: Expo Bot <[email protected]>
Co-authored-by: Expo Bot <[email protected]>
show more ...
|
| #
aef260d6 |
| 15-Jul-2022 |
Evan Bacon <[email protected]> |
chore: migrate metro-config, dev-server (#18221)
* chore: migrate metro CLI packages
* fix deps
* fix types
* Update withMetroMultiPlatform.ts
* Update yarn.lock
|