Skip to content

Commit

Permalink
feat: replace @babel/register and manually transpile config modules o…
Browse files Browse the repository at this point in the history
…n-demand (#613)

Co-Authored-By: Michał Pierzchała <thymikee@gmail.com>
  • Loading branch information
zamotany and thymikee authored Jul 29, 2019
1 parent 7545daa commit fd4b3c1
Show file tree
Hide file tree
Showing 69 changed files with 1,015 additions and 4,098 deletions.
10 changes: 0 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ commands:
- run: yarn test -i

executors:
node_8:
working_directory: ~/haul
docker:
- image: circleci/node:8
node_10:
working_directory: ~/haul
docker:
Expand All @@ -36,11 +32,6 @@ executors:
- image: circleci/node:latest

jobs:
test_node_8:
executor: node_8
steps:
- run_node_tests:
cache_prefix: "node_8"
test_node_10:
executor: node_10
steps:
Expand All @@ -56,6 +47,5 @@ workflows:
version: 2
test:
jobs:
- test_node_8
- test_node_10
- test_node_latest
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Haul is a drop-in replacement for `react-native` CLI built on open tools like We

`@haul-bundler/cli` and other packages under `@haul-bundler` scope are a overhaul of `haul` package __and support only React Native 0.59.0 and above__. If you need to support older versions, please check [`master` branch](https://github.com/callstack/haul/tree/master).

`@haul-bundler/cli` and other packages __requires Node 10 to be installed__. If you're running older version, please upgrade to Node 10 LTS or newer.

## Features

- Replaces React Native packager to bundle your app
Expand Down
12 changes: 6 additions & 6 deletions integration_tests/__tests__/multiBundle.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('in multi-bundle mode', () => {
let disposed = false;

beforeAll(done => {
server = runHaul(TEST_PROJECT_DIR, ['start']);
server = runHaul(TEST_PROJECT_DIR, ['start', '--port', '8082']);

server.stderr.on('data', data => {
done.fail(data.toString());
Expand Down Expand Up @@ -121,19 +121,19 @@ describe('in multi-bundle mode', () => {

async function fetchBundles(platform) {
const host = await (await fetch(
`http://localhost:8081/index.${platform}.bundle`
`http://localhost:8082/index.${platform}.bundle`
)).text();
const baseDll = await (await fetch(
`http://localhost:8081/base_dll.${platform}.bundle`
`http://localhost:8082/base_dll.${platform}.bundle`
)).text();
const app0 = await (await fetch(
`http://localhost:8081/app0.${platform}.bundle`
`http://localhost:8082/app0.${platform}.bundle`
)).text();
const app1 = await (await fetch(
`http://localhost:8081/app1.${platform}.bundle`
`http://localhost:8082/app1.${platform}.bundle`
)).text();
const app1Chunk = await (await fetch(
`http://localhost:8081/0.app1.${platform}.bundle`
`http://localhost:8082/0.app1.${platform}.bundle`
)).text();

return {
Expand Down
2 changes: 1 addition & 1 deletion packages/haul-babel-preset-react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"index.js"
],
"engines": {
"node": ">=8.x"
"node": ">=10.x"
},
"author": "Pawel Trysla <pawel.trysla@callstack.com>",
"repository": "github:callstack/haul",
Expand Down
2 changes: 1 addition & 1 deletion packages/haul-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"bin/"
],
"engines": {
"node": ">=8.x"
"node": ">=10.x"
},
"author": "Pawel Trysla <pawel.trysla@callstack.com>",
"repository": "github:callstack/haul",
Expand Down
1 change: 1 addition & 0 deletions packages/haul-cli/src/commands/multiBundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export default function multiBundleCommand(runtime: Runtime) {
const directory = process.cwd();
const configPath = getProjectConfigPath(directory, config);
const normalizedProjectConfigBuilder = getNormalizedProjectConfigBuilder(
runtime,
configPath
);
const projectConfig = normalizedProjectConfigBuilder(runtime, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default function prepareWebpackConfig(
const directory = process.cwd();
const configPath = getProjectConfigPath(directory, options.config);
const normalizedProjectConfigBuilder = getNormalizedProjectConfigBuilder(
runtime,
configPath
);
const projectConfig = normalizedProjectConfigBuilder(runtime, {
Expand Down
24 changes: 12 additions & 12 deletions packages/haul-cli/src/commands/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,19 @@ export default function startCommand(runtime: Runtime) {
}

const configPath = getProjectConfigPath(directory, argv.config);
const projectConfig = getNormalizedProjectConfigBuilder(configPath)(
const projectConfig = getNormalizedProjectConfigBuilder(
runtime,
{
platform: '',
root: directory,
dev: argv.dev,
port: argv.port,
bundleMode: 'multi-bundle',
bundleTarget: 'server',
assetsDest: tempDir,
minify: argv.minify === undefined ? !argv.dev : argv.minify,
}
);
configPath
)(runtime, {
platform: '',
root: directory,
dev: argv.dev,
port: argv.port,
bundleMode: 'multi-bundle',
bundleTarget: 'server',
assetsDest: tempDir,
minify: argv.minify === undefined ? !argv.dev : argv.minify,
});

try {
const isTaken = await isPortTaken(
Expand Down
247 changes: 0 additions & 247 deletions packages/haul-core-legacy/flow-typed/npm/express_v4.x.x.js

This file was deleted.

Loading

0 comments on commit fd4b3c1

Please sign in to comment.