Also see: Architect changelog
- Fixed handling of
httpbody parsing when multiple content-types provided; thanks @mmrwoods via #562!
- Fixed type definitions for
tables.scanandtables.scanAllmethods; thanks @sjorsrijsdam! - Fixed type definitions for
event.subscribemethod; thanks @filmaj!
- Updated dependencies, resolve low-sev CVE for
cookie - Added Node.js 22.x to CI
- Updated dependencies
- Updated dependencies
- Updated
package.jsonengines.nodeproperty to reflect changes from v8
- Added support for passing
arc.tables({ awsjsonMarshall, awsjsonUnmarshall })options, learn more at:
- Fixed potential issue where parsing SQS errors may fail
- Updated dependencies
- Fixed output of
tables.put()to return the updated item, as in versions <=7; fixes #554
Architect Functions just got a lot faster. Gone are the days of 500-1000ms cold starts due to instantiating the AWS SDK – Functions v8 is now between 2-5x faster, and uses 2-4x less memory, courtesy of aws-lite!
arc.tables()now includes a new DynamoDB client:_client, an instantiation of@aws-lite/dynamodb_clientis largely functionally similar to the AWS SDK's DocumentClient, but a bit less fiddly (we think)arc.tables()methods should be functionally the same, including key error properties
- Breaking change: AWS SDK v2 + v3 DynamoDB client + DocumentClient instantiation is now opt-in
- Code depending on
data._dbordata._docmust now instantiate with theawsSdkClientboolean option, like so:await arc.tables({ awsSdkClient: true }) - If you only rely on the DocumentClient (
_doc), you may want to just try using the new@aws-lite/dynamodb-based_client
- Code depending on
- Breaking change: while we've taken efforts to ensure the maximum degree of compatibility with AWS SDK v2 and v3 errors, the errors returned in Arc Functions 8.0 (using
aws-lite) may still vary slightly- This only really applies if your error handling relies on specific properties or values
- If you just
console.log()your errors, you will be totally fine, and the quality of the errors you get viaaws-litewill most likely improve with this change - Note: if you're an AWS SDK v2 user considering migrating to v3, error incompatibility will apply even more so; v3 errors are incompatible with v2, whereas
aws-liteerrors attempt to be compatible with both SDK v2 + v3
- Added Node.js 20.x to test matrix
- Breaking change: removed support for Node.js 14.x (now EOL, and no longer available to created in AWS Lambda)
- Added support for
arc.httpto accept either async or callback functions- This is not a breaking change, and
arc.http.asyncwill remain as a legacy code path - Moving forward we suggest passing all middleware through
arc.http, which will figure out whether to run in async or callback mode - Note: pass only callback or async middleware, but not both. Don't drink and drive, and don't mix async primitives.
- This is not a breaking change, and
- Added service discovery for DynamoDB-backed sessions
- Now you can set your
ARC_SESSION_TABLE_NAMEenv var with the logical name of your sessions table found in yourapp.arcfile - However, the physical DynamoDB table name will work as well
- Now you can set your
- Added support for JWE session encryption customization
- Configure by adding an env var named
ARC_APP_SECRET_ALGOwith a value ofA256GCM(default if not specified),A192GCM, orA128GCM
- Configure by adding an env var named
- Added
tables.scanAllmethod for retrieving the entire contents of a table
- Improved SNS (
@events), SQS (@queues), and SSM (arc.discovery) performance by caching clients, thereby enabling more efficient usage, especially in large workloads; thanks @w5mix & @CameronSima! - Breaking change: default JWE session encryption algorithm is now
A256GCM- This algorithm offers greater entropy with as good or greater performance in session token encryption / decryption
- Backwards compatible JWE session encryption is available by adding a truthy env var named
ARC_FORCE_LEGACY_JWE_SECRET
- Invalid session secrets now error loudly
- Updated deps
- Fixed http session issue where custom JWE secrets were not properly encoded when encrypting the web token
- This is not a CVE or security issue, just a simple compatibility bug
- However, this bug fix effectively invalidates any outstanding Arc-issued JWE session cookies; if you want to postpone this token fix until a later time, add a truthy env var named
ARC_FORCE_LEGACY_JWE_SECRET
- Updated deps
- Fixed issue where
arc.tableson Node.js 18+ (i.e. AWS SDK v3) would keep Sandbox Dynamo connections open for 5s
- Added anti-caching to
{ location }responses
- AWS has deprecated Lambda
nodejs12.x;@architect/functions6.0 now assumesnodejs14.xor higher - The
locationproperty now sets an HTTP 2 compliant lowcaselocationheader, instead of the previousLocationheader - Updated AWS SDK versions to sync up with the rest of Architect following v10.12
- Added
compressionresponse property for unencoded, non-binary responses; fixes #543- Default is (still)
br, and it can be set togzipor disabled withfalse - Compression is still best-effort; if the client does not support the default or specified compression, no compression is used
- Default is (still)
- Updated dependencies
- Updated dependencies
- Fixed broken predicates for using
useAWSpreference orARC_LOCALenv var to connect to DynamoDB, SNS, and SQS; thanks @w5mix!
- Minor performance improvement to
arc.httpbinary content type checks; thanks @gyx1000!
- Updated
binaryTypesarray, thanks @MichaelDeBoey!
- Fixed issue where users without the AWS-SDK installed locally or globally would error if
@architect/functionsis required or imported
- Added support for Lambda's new
nodejs18.xruntime, and AWS SDK v3 (@aws-sdk/*)- If your Lambdas make use of
@architect/functions(and you otherwise do not directly rely on AWS SDK calls), you are now likely fully forward-compatible withnodejs18.x(see caveats below) - However, if your Lambdas do NOT make use of
@architect/functions, before opting into Lambdanodejs18.x+ SDK v3 we strongly advise you read: https://arc.codes/aws-sdk-versions - To opt in, simply upgrade
@architect/architectto 10.8 and change your@aws runtimesetting tonodejs18.x(learn more at http://arc.codes/docs/en/reference/project-manifest/aws#runtime)
- If your Lambdas make use of
- Added Node.js 18.x to test coverage
- Due to changes in AWS SDK v2 → v3,
arc.tables()._db+arc.tables()._docmethods are now slightly different; unfortunately, this is not something@architect/functionscan paper over; see more here - In order to paper over breaking changes in AWS SDK v2 to v3,
@architect/functionsinspect the running Node.js version to follow different code paths to corresponding SDK versions; if your test / CI environment is not using the same Node.js version as your production environment, this may result in unexpected testing issues- For example: your CI environment runs Node.js 18.x, but your Lambda uses
@architect/functions>= 5.3 and is configured to use 16.x; some methods deep within the SDK may differ, and your tests may break - Unless you are making use of
arc.tables()._db+arc.tables()._doc, we think this scenario is pretty unlikely. That said, this is unfortunately not something Architect can control for or prevent, and ultimately falls to AWS to resolve for developers - We can only strongly advise your CI and production environments use the same version of Node.js
- For example: your CI environment runs Node.js 18.x, but your Lambda uses
- Updated dependencies
- Updated dependencies
- Fixed double-encoding issue for
arc.http[async]responses that are already base64-encoded
- Updated dependencies
ws._apino longer needs to be initialized by running a WebSocket function
- Return type from ArcTable.get is Promise<Item | undefined>
- Bundled typings for public API, thanks @camjackson
- tested with
dtslintin a new GitHub workflow
- tested with
- Added automatic brotli (
br) compression to HTTP API responses; compression will not be applied if any of the following cases are true:- You specify a
content-encodingheader - The requesting client does not request
brencoding via theaccept-encodingheader - You return anything other than a buffer or string as the body of your response
- You are using a legacy REST API
- You specify a
- Fixed body parsing issue that impacts performance of large request body payloads
- Deep require
aws-sdkdeps for a potentially large cold start perf boost- In small-scale testing, we found this can further reduce cold start performance by 2.5-5x, averaging ~150ms on Lambda
- Fixed usage with custom stack names; fixes #1322, thanks @Lugana707, @pgte
- Enable Functions v5 to be used as a bare module in test suites without setting env vars (see
ARC_ENVrequirement below)- Functions now makes a best-effort attempt to find Sandbox ports via internal SSM
- Relax requirement for
ARC_ENVenv var; backfill it totestingif not found
@architect/functionsis faster and leaner than ever, now down to about 425KB (from ~950KB). This means even faster cold starts and overall performance!- Added support for Sandbox dynamic port selection
- Added
rawBodyproperty, handy for use with external libraries that may need access to the raw body contents for things like signing- Moving forward, Arc Functions consumers should consider the
isBase64Encodedproperty to correspond only torawBody, and to be unrelated to thebodyproperty - See also: the change below re. base64 decoding of
text/plain+*/xmlbodies
- Moving forward, Arc Functions consumers should consider the
- Breaking change: Architect no longer automatically populates, relies on, or makes direct use of
NODE_ENVorARC_CLOUDFORMATIONenv vars.@architect/functionsv5+ now requires Architect v10 / Sandbox v5 or later.- Added top-level check for correct minimum version, fixes #1313; thanks @monkbroc!
- Breaking change: removed support for legacy Sandbox
@wsinternals, requiring Sandbox v5 - Breaking change: removed
http.expressmethod, which was badly out of date and broadly unused- Before this change,
@architect/functionshad 19 dependencies and weighed in at ~950KB; after it has 12 dependencies (down 7), and weighs about 475KB, for about a 50% reduction!
- Before this change,
- Breaking change: removed deprecated methods:
arc.http.middleware(deprecated August 2019) is nowarc.http.asyncarc.http.helpers.static(deprecated June 2019) is nowarc.static
- Breaking change: removed
arc.tables.doc+arc.tables.dbmethods- These methods are still available after table instantiation like so:
let { _doc, _db} = await arc.tables() - This change enables Architect Functions to only load
aws-sdkwhen absolutely necessary, making it 20-30x faster to run in Lambda for usage that does not rely on DynamoDB
- These methods are still available after table instantiation like so:
- Stop publishing to the GitHub Package registry
- Added checks to ensure there are no mysterious failures when required env vars are not present
- Preference for
ARC_*namespaced env vars:ARC_SESSION_TABLE_NAME>SESSION_TABLE_NAMEARC_SESSION_TTL>SESSION_TTLARC_SESSION_DOMAIN>SESSION_DOMAIN- All non-namespaced names will continue to be supported until at least Architect 11; we suggest changing them over to the namespaced equivalents as soon as is convenient
- Architect Functions now fails gracefully in Architect 10+ / Sandbox 5+
- Base 64 decodes
text/plain,text/xmlandapplication/xmlpayloads based offContent-Type
- Fix crash on missing
ARC_WSS_URLenv var when@wsis defined in a project
- Added
ws.closeandws.infoto close a WebSocket and get connection info. Requires@architect/sandbox@4.3.0or higher. - Added
ws._apia preconfiguredApiGatewayManagementApiinstance. Requires@architect/sandbox@4.3.0or higher. ws.sendnow leveragesws._apiand falls back to the old version of send in older Sandbox environments
- Enable
tables.scan()to be used without passing any arguments
- Breaking change:
arc.http.proxyis now@architect/asap!- ASAP is now fully independent of
@architect/functionsas of version4.0.0of both packages- With some minor exceptions, ASAP is a drop-in replacement for
arc.http.proxycalls and usage - no fuss, no muss! - ASAP is also a faster, leaner implementation (-70% smaller, with zero dependencies)
- With some minor exceptions, ASAP is a drop-in replacement for
@architect/functionsis now significantly (~25%) lighter:@architect/functions3.x (with deps): ~1.1MB@architect/functions4.x (with deps): ~760KB
- All legacy
@architect/functionsproxycalls are now removed from this package; this includes:arc.http.proxy,arc.http.proxy.public,arc.http.proxy.read,arc.proxy.public- Again, just aim those same calls at
@architect/asapand things should just work - and if they do not, please let us know!
- Again, just aim those same calls at
- ASAP is now fully independent of
- Breaking change: removed support for Node.js 10.x (now EOL, and no longer available to created in AWS Lambda)
- Breaking change: removed support for handling requests from Architect 5 (and lower) APIs
- Responding to requests has not changed, however! Old response semantics from Architect 5 (and lower) will continue to be supported, so you'll always have a clear, clean upgrade path from older Architect projects to newer APIs
- Normalized headers to lowercase for full HTTP 2 compatibility
- Updated dependencies
- Fixed an issue in sandbox where table names containing other table names would get the table definitions confused; thanks @reconbot!
- New
arc.services()API for retrieving the service map object for a given app; this object contains metadata associated with all infrastructure or services leveraged by the app
- Removed unnecessary console logging for
@events+@queuespublishing
- Restored
req.pathconvenience parameter missing from HTTP APIs; thanks @crtr0!
- Session cookie's SameSite value is configurable with ARC_SESSION_SAME_SITE environment variable; thanks @activescott!
- Fixed issue with
arc.tables()not generating a client for tables with the stringproductionin their names in a Sandbox context
- Added new alias for
arc.tables()._nametoarc.tables().name
- Fixed
arc.tables()._nameSandbox mode returning an array instead of a string; thanks @exalted!
- Internal change for JWE token issuance, thanks @lpetre!
- Ensure JWE session helper also uses the ordered last of multiple potential client sessions present in a cookie (if multiple are present)
- Sessions helper now uses the ordered last of multiple potential client sessions present in a cookie (if multiple are present)
- Fixed subtle session bug where attempting to clear a session would retain old session data
- Fixed broken legacy
cookieresponse param behavior, restoring behavior of being an alias for setting aset-cookieheader, and not for writing a session
- Fixed rate-limit crashes in legacy
events.publishcall; fixes #300
- Updated session test to no longer use legacy session table name
- Updated dependencies
- Handle body parsing
HTTPAPIs with v2.0 Lambda req payloads that include raw JSON; fixes @architect#997, thanks @mawdesley!
- Return errors on local
@events+@queuespublishing
- Fixes backward compat for legacy old school tidy Arc response params (e.g.
{ location: '/foo' }) when used inHTTPAPIs
- Fixes backward compat for legacy super old school content-type based responses (e.g.
{ html: 'foo' }) when used inHTTPAPIs
- Fixed bad call in
http.proxyalias config
- Added full forwards compatibility for API Gateway HTTP APIs, including the new v2.0 payload
- HTTP APIs in v2.0 have undocumented support for some funky response formats, so when in v2.0 mode, non-standard responses are passed through with minimal or no mutation
- Added support for passing along
multiValueHeadersin responses
- Enable proxy to use HTTP APIs running in Lambda v1.0 payload format mode
- Adds support for loading compressed files out of proxy
- Fixed proxy lookup to custom 404 page working locally
- Fixed incorrect filename in proxy 404 error message
- Adds automatic fingerprint upgrading from non-fingerprinted requests; example:
- If
@static fingerprint trueis enabled,<img src=this-is-fine.gif>will now automatically load/_static/this-is-fine-abc123.gif
- If
- Adds fingerprinting support for pretty URLs and custom 404s in proxy
- Adds support for
ARC_STATIC_PREFIXenv var to provide symmetry with the new@static prefixsetting- The
ARC_STATIC_FOLDERenv var is now considered deprecated, and will be removed in a future (breaking) release
- The
- Added support for leading slashes in build-free templating (e.g.
${arc.static('/this-is-fine.gif')})
- Ensures the build-free templating engine always runs, not just when fingerprint is enabled
- Improved default caching behavior for static assets; fixes #273
- Any assets that don't have
cache-controlexplicitly set will now default to usingETagin order to improve the reliability of cache invalidation - HTML & JSON responses still default to anti-caching headers
- Any assets that don't have
- Added path peeking (aka pretty URLs); fixes #269
- URLs delivered via
proxyno longer require a trailing slash! - Example: to load
/foo/index.html, you used to have to request/foo/ - Now, if
/foois requested,proxywill automatically try peeking into/footo see if it contains/foo/index.html– if not, it'll 404 as expected
- URLs delivered via
- Added ETag support to Sandbox static asset serving
- Added support for arbitrary static asset config mapping
- Pass proxy
config.assetsastatic.json-like static asset object
- Pass proxy
- Internal refactoring: cleaned up old
proxycode paths
- We now ensure CDNs cannot cache
404responses
arc.http.expressPOST request could fail ifreq.bodywas null
arc.http.expressPOST request could fail ifreq.bodywas null
- Adds S3
ContentEncodingforarc.http.proxy/arc.http.proxy.read- This means you can now publish and read larger files out of S3 in the compressed format of your choosing!
- Updated dependencies
- Fixed
arc.http.helpers.urlto now respectARC_LOCALflag, thanks @filmaj! - Fixed
arc.tables._namecalls, thanks @filmaj!
- Support for Lambda payload version 2 in session (for API Gateway HTTP APIs)
- Mocks API Gateway's current behavior of not sending a body when response is headers / status code only; fixes #254, /ht @alexbepple
- (Back in the day it used to default to sending
\nbecause reasons.)
- (Back in the day it used to default to sending
- Fixed and improved events.subscribe fallback object (handy for local testing)
- Fixed local predicate for
arc.tablesto ensureARC_LOCALcan speak to live AWS infra
- Calling
static()with the root path (e.g.static('/')) now returns/_static/; thanks Paul! arc.http.proxynow supports API Gateway HTTP APIs request/response payload V2
- Functions now ensures
NODE_ENVis one oftesting,staging, orproduction(defaulting totesting) - Updated dependencies
- Fix for
arc.tables()returningundefined - Updates deps
- Improves reliability of using Architect Functions in certain test harnesses that may automatically set
NODE_ENV
- Refactor of internal DynamoDB client instantiation; resolves issues using Functions with some test harnesses (like Jest); fixes #238, thanks @konsumer!
- Fixes issue that caused Sandbox to stall when called via the Architect CLI
- Fixes issue that caused Architect Functions to cause issues in certain test harnesses that may automatically set
NODE_ENV - Note:
3.7.1was an erroneous re-publish of3.7.0, please use3.7.2
- Added support for porting express apps with
arc.http.express
- Added support for running multiple Sandboxes at the same time
- No more conflicting events and ports when running multiple simultaneous local Architect projects!
- Also, you can now manually configure your
@eventsport withARC_EVENTS_PORT, and@tablesport withARC_TABLES_PORT
- Added fallback event object for direct invocation of event functions using
arc.events.subscribe
- Updated tests for Sandbox soon to be setting
ARC_CLOUDFORMATIONenv var - Updated dependencies
arc.queues.publishcan now acceptgroupIDfor fifo queues- erase session with
return {session: {}, location: '/'}syntax
- Allow setting session TTL by passing a SESSION_TTL environment variable with the desired TTL in seconds
- Removes
@architect/parserdep
- Internal change for JWE token issuance
- Local WebSockets (
arc.ws) calls no longer always send port3333, and to now support custom ports
- Uses updated
ARC_WSS_URLenv var format (but retains backwards compatibility)
- Adds
stagePathoption toarc.staticfor anyone using this with a bare API Gateway configuration- Example:
arc.static('foo.png', {stagePath: true})
- Example:
arc.staticnow throws an error if the specified asset is not found- Updated dependencies
- Updated dependencies
- Fixes issue where
events.publishmay sometimes fail with > 10 topics; thanks @dduran1967!
- Internal / testing changes only
arc.http.proxylooks for defaultindex.htmlwhenARC_STATIC_SPA=false
- Fixes
arc.ws.sendfor apps packaged with@architect/package1.0.50 or later. AWS changed theApiGatewayMangementApi.postToConnectioninterface paramterendpointto no longer be suffixed with@connections - Adds
data.reflectto get table names
let arc = require('@architect/functions')
// elsewhere in your async function handler:
let data = await arc.tables()
let names = await data.reflect() // returns {arcfilename: 'generated-tablename'}- Adds anti-caching and body parsing
application/vnd.api+json; resolves #141, thanks @jkarsrud!
- Fixes broken response when bucket is not configured as root proxy
- Improves error states for missing static configs, 404s, etc.
- Updated dependencies
- Added support for
@static fingerprint truein root spa / proxy requests- This enables Architect projects to deliver fully fingerprinted static assets while also ensuring that each file is appropriately cached by clients and network infra
- Also includes support for build-free calls between your fingerprinted static assets
- Example: in
public/index.html, use the following syntax to automatically replace the local / human-friendly filename reference to the deployed fingerprinted filename: ${arc.static('image.png')}will be automatically replaced byimage-a1c3e5.png- Or
${STATIC('image.png')}(which is the same thing, but shoutier) - Note: although those look like JS template literal placeholders, they're intended to live inside non-executed, static files within
public/(or@static folder foo)
- Example: in
- Updated dependencies
- Changed static manifest loader to be more bundler friendly
- Fixed issue that may prevent
replfrom working with more recent versions of Functions - Add anti-caching headers to
sandbox404 response
- Added more consistent and regular entry for proxy:
http.proxy- This is non-breaking:
http.proxy.public,http.proxy.read, and even the olderproxy.publicmethods are still available, although are deprecated. We suggest moving to them. http.proxydoes the same as whathttp.proxy.publicused to do; since the vast majority of use was aroundhttp.proxy.publicand nothttp.proxy.read, it didn't make sense to have such a verbose method signature
- This is non-breaking:
http.proxy's SPA setting can now be disabled with an env var –ARC_STATIC_SPA = 'false'(wherefalseis a string, not a bool)- You can still disable it via configuration as well (
{spa:false})
- You can still disable it via configuration as well (
- Lots and lots of tests around
http.proxy
- Better 404 / file missing handling in
sandboxwhen usinghttp.proxy(or loading static assets without@http get /specified)
- Updated deps
- Restored
http.proxy.publicsettings that were erroneously removed in a previous updatebucket.staging,bucket.production,bucket.folder, andcacheControlare now restored
- Fixes a proxy issue in Architect 5 / LTS projects where SPA requests for pages would not have loaded correctly
- Improved detection of
proxyandwswhen running locally with NODE_ENV not set totesting, andARC_LOCALset
http.proxynow correctly responds to requests if your environment includes anARC_STATIC_FOLDERenv var
- Internal change to normalize response shapes from
http.proxy.public+http.proxy.read
- Fixes issue where binary assets delivered via
sandbox/ root may not be properly encoded - Fixes issue where
http.proxy.public+http.proxy.readmay not have delivered correctly formatted responses in Architect 5 - Fixed minor issue in
ARC_HTTPenv var check
- Adds
ARC_HTTPenv var check to Arc v5 response formatter
- Fixes
arc.http/arc.http.asyncresponses to/{proxy+}requests
- Makes passing config to
arc.http.proxyentirely optional
- Added Architect 6 compatibility to
arc.http.async, the new method name forasync/awaitmiddleware- All
async/awaitfunctions run througharc.http.asyncnow automatically have client sessions attached and decoded, parsed bodes (if applicable) - Learn more about upgrading to Arc 6 +
arc.http.asynchere
- All
- Added ability to set custom headers on any
arc.http.proxyrequest
arc.http.middleware(formerlyarc.middleware) is nowarc.http.async- These methods are functionally the same
- The old aliases will remain for a while to come, but we suggest moving any deprecated calls over to their new equivalents by mid-2020
- Fixed minor issue where status code of
302couldn't be overridden when using bothlocationandstatusCode(orstatus, orcode) response params - Fixed bug preventing emitting binary assets via
arc.http.proxy - Fixed munged headers and content-type in proxy plugins, fixes @architect/architect#432
- Fixed
arc.static()(and deprecatedarc.http.helpers.static()) calls in Arc 6, fixes #59 /ht @mikemaccana - Fixed sometimes-broken paths to API gateway
- Fixed
arc.tables()calls in Arc 6
- Support for Architect 6
- Includes complete compatibility for Architect 4 + 5 users:
- If already using Functions, everything should just work!
- If using Arc 5 dependency-free, you can now drop your existing responses into Architect Functions's
res()and everything should be solid; no signature changes should be required
- Includes complete compatibility for Architect 4 + 5 users:
- Takes over all responsibilities of now-deprecated
@architect/data- Previous data calls can be accessed with
arc.tables()
- Previous data calls can be accessed with
- Responses now include the same content type aware
Cache-Controldefaults as found in Architect 5- As always, they're able to be overriden with
cacheControlparam (orheaders['Cache-Control'])
- As always, they're able to be overriden with
- Hopefully nothing breaking – please send feedback on the RC!
- 3.3 RC: #57
- Slack: https://architecture-as-text.slack.com
- Including a
headersobject in yourarc.httpresponse will now set custom headers SESSION_DOMAINvariable now supported injwesessionscontextis now passed onto each middleware function
- Backwards-compatible refactoring of
eventspublishing in preparation for Architect 6 service discovery
- For additional control of your user sessions, you may now define the cookie Domain attribute
- Because this needs to be set consistently across your app's usage of session, set this via the
SESSION_DOMAINenvironment variable
- Because this needs to be set consistently across your app's usage of session, set this via the
- This release is all about improving static asset access!
- Static asset fingerprinting is now built into the static asset helper!
- Enable file fingerprinting in your project by adding
fingerprint trueto your Arc manifests's@staticpramga - If enabled, requesting
styles.csswill return the proper fingerprinted URL (e.g.https://your-bucket.s3.us-west-1.amazonaws.com/styles-1e25d663f6.css)
- Enable file fingerprinting in your project by adding
- The static asset helper is now a first-class method accessible at:
arc.static('filename.ext')- File path are still relative to your
public/dir - Legacy method
arc.http.helpers.static('filename.ext')will continue to be supported
- File path are still relative to your
- Static helper tests
- Static asset fingerprinting is now built into the static asset helper!
proxy.read()calls withoutconfig.bucketspecified work correctly again, fixes #38
arc.http.helpers.static()now usesARC_STATIC_BUCKETandARC_STATIC_FOLDER(as introduced in 2.0.16 forarc.proxy.read()), fixes #37
- Also improves S3 URL handling in
arc.http.helpers.static(), partially addressing @architect/architect#375 (S3's late-2020 URL format support change)
- Updated dependencies
- Adds support for sending
delaySecondsparameter on queue publish, closes #36 /ht @bardbachmann
arc.events.subscribewill now accept anAsyncFunction
- Removes trailing slash from
arc.http.helpers.static()that breaks URLs when working locally
- Updated dependencies
- Fixes local sandbox publishing events/queues bug introduced in 2.0.8
- Enables both text and binary file transit in newly provisioned Arc apps
- This is NOT a breaking update if you aren't using
proxy.public()- However, if you use
proxy.public(), this is a breaking update! - In order to enable binary assets support, Arc Functions now encodes files being emitted via
proxy.public()for use in Architect 5.6+ apps - If you'd like your existing app that uses
proxy.public()to serve binary assets, you'll need to re-create your API (or hang tight until we release our forthcoming API migration tool)
- However, if you use
get /encoding is now properly set when usingconfig.bucket.folder
- Added checks to ensure bucket exists in
proxy.public() - Requests to unknown files via
proxy.public()now return a proper 404 response, and not 200 /undefined - Fixes proxy path prefix check in testing environment
- Found and removed some junk files in the NPM package
- Adds
ARC_STATIC_BUCKET+ARC_STATIC_FOLDERenv vars for config-reducedproxy.public()reads
- In
proxy.public()config, the bucket folder prefix is now respected when working locally
- Cache-control header support for
proxy.public; if not specified, defaults to:- HTML + JSON:
no-cache, no-store, must-revalidate, max-age=0, s-maxage=0 - Everything else:
max-age=86400
- HTML + JSON:
- Updated dependencies
- Fixed local env check in
queues.publish/ht @tobytailor
- proxy allows for configurable s3 bucket and folder
- proxied files now return
etag arc.proxy.publicconfiguration:spa- boolean, loadindex.htmlat any folder depthssr- path string of module to load or function for overriding/index.htmlalias- alias paths path (eg.{'/css':'/styles/index.scss'})plugins- per filetype transform plugin pipelines
The companion transform plugins aim to help developers make the transition to browser native esmodules:
@architect/proxy-plugin-jsxtranspiles jsx to preact/react@architect/proxy-plugin-tsxstrips types and transpiles jsx to preact/react@architect/proxy-plugin-mjs-urlsadds/stagingor/productionto imports urls@architect/proxy-plugin-bare-importsenable bare imports with browser esm
And for fun:
@architect/proxy-plugin-mdmarkdown to html@architect/proxy-plugin-sasssass/scss
If you think we're missing a plugin please don't hesitate to ask in the issue tracker!
Complete example project code here.
- arc.js
- arc.css
- arc.html
- arc.text
- arc.xml
- arc.json
- New
arc.proxywip proxy get-index to /public when running locally and s3 when running on aws
// exmaple usage in a ws-connected lambda
let arc = require('@architect/functions')
exports.handler = arc.proxy.public()- New
arc.wswip progress for sending web socket messages locally and in the cloud
// exmaple usage in a ws-connected lambda
let WebSocket = require('@architect/functions').ws
exports.handler = async function WebSocketConnected(event) {
let ws = new WebSocket(event)
await ws.send('pong')
return {
statusCode: 200
}
}- New
arc.middlewareawait-based middleware API, see the Architect Documentation