0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00
astro/package.json
Matthew Phillips d9084ff4ad
Implement fallback capability (#44)
* Implement fallback capability

This makes it possible for a dynamic component to render fallback content on the server.

The mechanism is a special `static` prop passed to the component. If `static` is true then the component knows it can render static content.

Putting aside the word `static`, is this the right approach? I think giving components the flexibility to make the decision themselves *is* the right approach.

However in this case we have a special property that is passed in non-explicitly. I think we have to do it this way because if the caller passes in a prop it will get serialized and appear on the client. By making this something we *add* during rendering, it only happens on the server (and only when using `:load`).

Assuming this is the right approach, is `static` the right name for this prop? Other candidates:

* `server`

That's all I have!

* Use `import.meta.env.astro` to tell if running in SSR mode.

* Run formatter
2021-03-31 16:10:27 -04:00

90 lines
2.5 KiB
JSON

{
"name": "astro",
"version": "0.0.1",
"main": "index.js",
"private": true,
"author": "Skypack",
"license": "MIT",
"type": "module",
"exports": {
".": "./mastro.mjs",
"./snowpack-plugin": "./snowpack-plugin.cjs",
"./h": "./lib/h.js",
"./render/preact": "./lib/render/preact.js"
},
"bin": {
"astro": "astro.mjs"
},
"scripts": {
"build": "tsc",
"dev": "tsc --watch",
"lint": "eslint 'src/**/*.{js,ts}'",
"format": "prettier -w '{src,test}/**/*.{js,ts}'",
"test": "uvu test -i fixtures -i test-utils.js",
"watch:extension": "cd vscode && npm run watch"
},
"dependencies": {
"@babel/generator": "^7.13.9",
"@babel/traverse": "^7.13.0",
"@snowpack/plugin-sass": "^1.4.0",
"@snowpack/plugin-svelte": "^3.6.0",
"@snowpack/plugin-vue": "^2.3.0",
"@types/babel__generator": "^7.6.2",
"@types/babel__traverse": "^7.11.1",
"@types/estree": "0.0.46",
"@types/node": "^14.14.31",
"@types/react": "^17.0.3",
"@types/react-dom": "^17.0.2",
"@vue/server-renderer": "^3.0.7",
"acorn": "^7.4.0",
"acorn-jsx": "^5.3.1",
"astring": "^1.7.0",
"autoprefixer": "^10.2.5",
"css-tree": "^1.1.2",
"deepmerge": "^4.2.2",
"domhandler": "^4.0.0",
"es-module-lexer": "^0.4.1",
"esbuild": "^0.10.1",
"find-up": "^5.0.0",
"github-slugger": "^1.3.0",
"gray-matter": "^4.0.2",
"htmlparser2": "^6.0.0",
"kleur": "^4.1.4",
"locate-character": "^2.0.5",
"magic-string": "^0.25.3",
"micromark": "^2.11.4",
"micromark-extension-gfm": "^0.3.3",
"node-fetch": "^2.6.1",
"postcss": "^8.2.8",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"rollup": "^2.43.1",
"rollup-plugin-terser": "^7.0.2",
"sass": "^1.32.8",
"snowpack": "^3.1.2",
"svelte": "^3.35.0",
"vue": "^3.0.7",
"yargs-parser": "^20.2.7"
},
"devDependencies": {
"@babel/parser": "^7.13.11",
"@types/github-slugger": "^1.3.0",
"@types/sass": "^1.16.0",
"@types/yargs-parser": "^20.2.0",
"@typescript-eslint/eslint-plugin": "^4.18.0",
"@typescript-eslint/parser": "^4.18.0",
"cheerio": "^1.0.0-rc.5",
"concurrently": "^6.0.0",
"copyfiles": "^2.4.1",
"eslint": "^7.22.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-prettier": "^3.3.1",
"estree-walker": "^3.0.0",
"nodemon": "^2.0.7",
"preact": "^10.5.13",
"preact-render-to-string": "^5.1.18",
"prettier": "^2.2.1",
"typescript": "^4.2.3",
"uvu": "^0.5.1"
}
}