You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That PR was accompanied by a .htaccess update to ensure the correct Access-Control-Allow-Origin header was set – otherwise the index.js file cannot be import()-ed in JavaScript.
Unfortunately, that update was lost in a force-push. I patched it ad-hoc on the server, but we should ship the correct setup out of the box.
Luckily, GitHub still keeps that code change here:
Adds a .htaccess file to playground.wordpress.net that does the following:
1. Prevents caching of the main index.html file. Otherwise the browser may
try to load outdated JavaScript, CSS, and WASM assets and and up in a
broken state.
2. Adds the Access-Control-Allow-Origin header for the blueprint-schema.json
file and the hosted client.js library to enable `import()`-ing both.
## Testing instructions
None. I tested this in an Apache setup, then manually updated the production
.htaccess file, and it all worked as expected.
Related to #855Closes#873
…le importing the client.js library (#989)
Adds a .htaccess file to playground.wordpress.net that does the
following:
1. Prevents caching of the main index.html file. Otherwise the browser
may try to load outdated JavaScript, CSS, and WASM assets and and up in
a broken state.
2. Adds the Access-Control-Allow-Origin header for the
blueprint-schema.json file and the hosted client.js library to enable
`import()`-ing both.
## Testing instructions
None. I tested this in an Apache setup, then manually updated the
production .htaccess file, and it all worked as expected.
Related to #855Closes#873
Ensures the browsers won't cache client.js once its contents changes. The
`Cache-Control: no-cache` shipped here may perhaps be too restrictive, but
it's a good starting point that can be tweaked later.
Related to #873
Description
#773 exposed the client library on Playground.wordpress.net:
https://playground.wordpress.net/client/index.js
That PR was accompanied by a .htaccess update to ensure the correct
Access-Control-Allow-Origin
header was set – otherwise theindex.js
file cannot beimport()
-ed in JavaScript.Unfortunately, that update was lost in a force-push. I patched it ad-hoc on the server, but we should ship the correct setup out of the box.
Luckily, GitHub still keeps that code change here:
a6f685d
Let's restore it! Here's a copy of the changes just in case that commit gets garbage collected:
packages/playground/website/.htaccess
packages/playground/website/project.json
Also, let's make sure that proper cache busting is in place.
Done is:
.htaccess
file is shipped with the website build.htaccess
file shipped with the website build ensures the browsers won't cache client.js once its contents change.htaccess
file shipped with the website build ensures the correctAccess-Control-Allow-Origin: *
header is sent – but only for the client.js fileThe text was updated successfully, but these errors were encountered: