Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(templates/arc): update README + dependencies #2213

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@
- rtabulov
- Runner-dev
- rvlewerissa
- ryanblock
- ryanflorence
- ryankshaw
- sandulat
Expand Down
41 changes: 22 additions & 19 deletions packages/create-remix/templates/arc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,40 @@

- [Remix Docs](https://remix.run/docs)

## Architect Setup

When deploying to AWS Lambda with Architect, you'll need:
## Development

- Architect (`arc`) CLI
- AWS SDK
Both Remix and Architect have their own local servers, each of which is responsible for unique tasks related to local development.

Architect recommends installing these globally:
To start both alongside one another, run:

```sh
$ npm i -g @architect/architect aws-sdk
$ npm run dev
```

## Development
Open up [http://localhost:3333](http://localhost:3333) and you should be ready to go!


You will be running two processes during development when using Architect as your server.
### TypeScript
Copy link
Author

Choose a reason for hiding this comment

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

Does all this make sense in the context of Remix? I know a lot of Remix + Arc folks have been trying to use TS, but have been a bit confused as to where to start, so I was thinking this might help shortcut them. Up to y'all!

Copy link
Collaborator

@mcansh mcansh Mar 7, 2022

Choose a reason for hiding this comment

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

unfortunately using @architect/plugin-typescript for all lambdas causes a "lambda not found error" for the remix app, perhaps we can mention the config.arc approach instead? we might be able to tweak some remix config to make it work, I'll give it a shot soon

Copy link
Collaborator

@mcansh mcansh Mar 8, 2022

Choose a reason for hiding this comment

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

lol wut, today it works - reason being i tried upgrading an existing app yesterday that wasnt using the new serverBuildTarget to bundle the app into the server directory so arc was then trying to compile it too

Copy link
Collaborator

@mcansh mcansh Mar 8, 2022

Choose a reason for hiding this comment

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

i think instead of mentioning the installation of the typescript plugin directly, we can add a arc-ts directory and add the dependency and full app.arc there


- Your Architect server sandbox in one
- The Remix development server in another
To develop in TypeScript, install Architect's official TS plugin:

```sh
# in one tab
$ arc sandbox
$ npm i @architect/plugin-typescript
```

# in another
$ npm run dev
Then add the following to the `app.arc` file:

```arc
@plugins
architect/plugin-typescript

@aws
runtime typescript
```

Open up [http://localhost:3333](http://localhost:3333) and you should be ready to go!
Head here to learn more about [developing in TypeScript with Architect](https://arc.codes/docs/en/guides/developer-experience/using-typescript).

If you'd rather run everything in a single tab, you can look at [concurrently](https://npm.im/concurrently) or similar tools to run both processes in one tab.

## Deploying

Expand All @@ -41,9 +44,9 @@ Before you can deploy, you'll need to do some setup with AWS:
- First [install the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html)
- Then [follow the Architect setup instructions](https://arc.codes/docs/en/guides/get-started/detailed-aws-setup).

If you make it through all of that, you're ready to deploy!
Once you make it through all of that, you're ready to deploy!

1. build the app for production:
1. Build the app for production:

```sh
$ npm run build
Expand All @@ -52,7 +55,7 @@ If you make it through all of that, you're ready to deploy!
2. Deploy with `arc`

```sh
$ arc deploy production
$ npx arc deploy production
```

You're in business!
1 change: 1 addition & 0 deletions packages/create-remix/templates/arc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"start": "cross-env NODE_ENV=production arc sandbox"
Copy link
Author

Choose a reason for hiding this comment

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

@mcansh: NODE_ENV=development is not required for any Architect processes, so in theory we can remove that from start + dev:arc if that doesn't cause any trouble for y'all!

Copy link
Collaborator

Choose a reason for hiding this comment

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

not 100% sure when we added that to the templates, but i'm 95% sure we set NODE_ENV during remix dev and remix build (and remix-serve)

Copy link
Author

Choose a reason for hiding this comment

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

Ok, so do you want to leave it? Remove it? Arc is good either way, but imo always good to have less stuff if possible.

Copy link
Collaborator

Choose a reason for hiding this comment

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

let's remove it

},
"dependencies": {
"@architect/architect": "^10.0.5",
Copy link
Author

Choose a reason for hiding this comment

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

How can we help ensure this is relatively up to date?

Copy link
Collaborator

Choose a reason for hiding this comment

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

couldn't we use ^10.x to signify any version of v10? we don't include lock files in the templates so once they're installed they should use the latest version available, no?

Copy link
Collaborator

@mcansh mcansh Mar 7, 2022

Choose a reason for hiding this comment

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

otherwise, we can keep it ^10.0.5 and wait for PRs to bump the version when anything significant happens

Copy link
Author

Choose a reason for hiding this comment

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

Yeah we can def safely set to 10.x

Copy link
Member

Choose a reason for hiding this comment

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

^10.0.0 should indeed just work

"@remix-run/architect": "*",
"cross-env": "^7.0.3"
},
Expand Down