Comments (9)
Thank you for providing an initial aws-cdk
setup! I think the idea with CloudFront for static assets is great.
Since over time some things have changed (added remix AWS Architect deployment option, aws-cdk v2 release, ...), I have built an example deployment based on the current project versions:
remix-aws-cdk-example
It is based on the AWS Architect remix template (and still uses it for the local development). The deployment can be done via aws-cdk v2.
from remix.
@ryan-mars You're right, I get the same warnings.
I think we need to give it some more time until those warnings might be resolved by itself through dependency updates.
Here are some infos I could gather regarding the status of those warnings:
FYI: We use the @remix-run/architect
package. Yes it is called architect
, but it is actually a generic adapter for AWS Lambda behind API Gateway (#1038).
If we have a quick look at our dependency tree we can see the following: @remix-run/architect
> @remix-run/node
> @web-std/file
.
I was able to find a merge request regarding those warnings in their repo. The fix is already merged, although I was not able to find a release on npm yet. If that is shipped we could update the lockfile and might be good to go without the warnings.
Note to myself: Gosh I really have to add a dependabot to the example repo that there is some sort of automation on keeping it up-to-date.
from remix.
@shortjared had the idea to use multiple CloudFront origins. With this we can serve all public/*
files from an S3 bucket and then fallback to serving all other requests from API Gateway.
This has been implemented in m14t/starter-aws-cdk@1e32ff2 and can be seen working at https://d3cmgcnia7ll9p.cloudfront.net. 🎉
The favicon.ico
is still being served from the lambda (via the CDN), so we can either choose to add another "Behavior" to also serve that from the S3 bucket or leave things as is. It would be nice to be able to remove the serveStaticFileIfExists
function, but this would mean needing to keep this Behavior part of deployment config in sync any time we added a new static asset which I'm not a fan of.
With that all being said, there are certainly improvements that could be made, but I think this is a workable solution.
Happy to hear any feedback, questions, or suggestions!
from remix.
@florianwiech , apologies for the newbie-type questions:
- Could the 'makefile' and 'deploy.sh' calls be integrated directly into the package.json file, in theory (what are the benefits of having those files?)?
BTW, thank you VERY much for this offering 🙏🏾
Sure, it is totally fine to use other utilities for running scripts (eg. providing scripts inside the package.json as you mentioned).
I also started with package.json
scripts but eventually these scripts increased in size and parameter length. It basically bloated the package.json scripts section. That was the reason I moved to the makefile
and deploy.sh
layout.
In my case I chose the makefile
to group cli commands so that I do not have to retype then while developing.
The deploy.sh
basically wraps the cdk deploy
command with all the needed parameters and directory structure it needs.
If there are other questions regarding some remix-aws-cdk-example
specifics I would suggest opening a ticket in the remix-aws-cdk-example
repo. This way we can keep this thread targeted to the remix aws-cdk integration.
from remix.
@ryan-mars Thank you for pointing out that the latest release of remix introduced some breaking changes.
I updated the example and it should work with the latest remix version now. (florianwiech/remix-aws-cdk-example@f6d5cd1)
Moreover, I introduced yarn workspaces for better project separation and extended the readme.
from remix.
@florianwiech , apologies for the newbie-type questions:
- Could the 'makefile' and 'deploy.sh' calls be integrated directly into the package.json file, in theory (what are the benefits of having those files?)?
BTW, thank you VERY much for this offering 🙏🏾
from remix.
Does anyone have a working version of Remix deployed via CDK? None of the projects mentioned in this thread seem to be maintained and work with latest Remix.
from remix.
@florianwiech Thanks! I got it to mostly work by disabling minifcation but even with your changes I still get bundler warnings... do you see this too?
Bundling asset remix/RequestHandler/Code/Stage...
▲ [WARNING] Non-relative path "packages/file/src/lib.js" is not allowed when "baseUrl" is not set (did you forget a leading "./"?)
node_modules/@web-std/file/tsconfig.json:6:24:
6 │ "@web-std/file": ["packages/file/src/lib.js"]
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~
▲ [WARNING] Non-relative path "packages/blob/src/lib.js" is not allowed when "baseUrl" is not set (did you forget a leading "./"?)
node_modules/@web-std/blob/tsconfig.json:6:24:
6 │ "@web-std/blob": ["packages/blob/src/lib.js"]
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings
from remix.
@florianwiech Thank you so much!
from remix.
Related Issues (20)
- Random preloads added for images HOT 1
- `assetsDir` not properly resolved when using `basename` when using Wrangler HOT 1
- Splat Routes that would have been prioritized can be overridden by Dynamic Segments. HOT 7
- remix hydration error when using gtag
- [Vite] [Cloudflare] dev server start failed with http_proxy environment variable
- Onclick handler not working in remix and problem installing tailwindcss HOT 5
- MetaFunction data type not inferred from clientLoader HOT 3
- Application Error: failed to execute insertBefore on Node HOT 18
- Vitest looks for package.json in every workspace when using vitePlugin HOT 2
- [BUG]: cloudflareDevProxyVitePlugin: Issue in DEV with Remix/Vite/Drizzle/Cloudflare Pages/Supabase/Postgres HOT 2
- Can't import node_module SVG HOT 2
- Streaming does work not on Vite/MacOS HOT 2
- Hydration issues in prod builds of Cloudflare starter template HOT 3
- remix spa mode cannot with `[email protected]` , when run `npm run preivew`, it's a empty page HOT 4
- Express Vite template loads white screen in production mode HOT 10
- Basic Routing Works on Server but not Client HOT 4
- Firestore Lite Does Not Work in Loader HOT 3
- Stdio pipe impacts plugin shutdown
- TypeScript: useLoaderData is not working properly in 2.9 HOT 10
- Unexpected Server Error TypeError: Cannot read properties of null (reading 'useEffect') HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from remix.