Add js web stuff to landing page + documentation
This commit is contained in:
21
go/jsruntime/runtime/solid-refresh/LICENSE
Normal file
21
go/jsruntime/runtime/solid-refresh/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020-2021 Ryan Carniato
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
228
go/jsruntime/runtime/solid-refresh/README.md
Normal file
228
go/jsruntime/runtime/solid-refresh/README.md
Normal file
@@ -0,0 +1,228 @@
|
||||
<p>
|
||||
<img width="100%" src="https://assets.solidjs.com/banner?project=Refresh&type=core" alt="Solid Refresh">
|
||||
</p>
|
||||
|
||||
# Solid Refresh
|
||||
|
||||
```bash
|
||||
npm i -D solid-refresh
|
||||
```
|
||||
|
||||
```bash
|
||||
yarn add -D solid-refresh
|
||||
```
|
||||
|
||||
```bash
|
||||
pnpm add -D solid-refresh
|
||||
```
|
||||
|
||||
This project aims to provide HMR for Solid for various bundlers. It comes with a babel plugin and a runtime. Over time I hope to add different bundlers. Today it supports:
|
||||
|
||||
* Vite (with option `bundler: "vite"`)
|
||||
* Snowpack (with option `bundler: "esm"`)
|
||||
* Webpack (for strict ESM, use option `bundler: "webpack5"`)
|
||||
* Nollup
|
||||
|
||||
## Setup
|
||||
|
||||
### Vite
|
||||
|
||||
`solid-refresh` is already built into [`vite-plugin-solid`](https://github.com/solidjs/vite-plugin-solid).
|
||||
|
||||
### Webpack & Rspack
|
||||
|
||||
You can read the following guides first, respectively:
|
||||
|
||||
* [Webpack](https://webpack.js.org/guides/hot-module-replacement#enabling-hmr)
|
||||
* [Rspack](https://www.rspack.dev/guide/dev-server.html#hmr)
|
||||
* [Rspack SolidJS guide](https://www.rspack.dev/guide/solid.html)
|
||||
|
||||
> [!NOTE]
|
||||
> Rspack has HMR already enabled by default. The guide only tells you how to disable it or run the dev server on a proxy server.
|
||||
|
||||
Requires the use of [`babel-loader`](https://www.npmjs.com/package/babel-loader). Add the following to `.babelrc`:
|
||||
|
||||
```json
|
||||
{
|
||||
"env": {
|
||||
"development": {
|
||||
"plugins": ["solid-refresh/babel"]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If you're using strict ESM a.k.a. `import.meta.webpackHot`:
|
||||
|
||||
```json
|
||||
{
|
||||
"env": {
|
||||
"development": {
|
||||
"plugins": [["solid-refresh/babel", {
|
||||
"bundler": "webpack5" // or "rspack-esm"
|
||||
}]]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
In your webpack config, be sure to have the following options:
|
||||
|
||||
```js
|
||||
devServer: {
|
||||
liveReload: false,
|
||||
hot: true,
|
||||
}
|
||||
```
|
||||
|
||||
### Parcel
|
||||
|
||||
Add the following to `.babelrc`:
|
||||
|
||||
```json
|
||||
{
|
||||
"env": {
|
||||
"development": {
|
||||
"presets": [
|
||||
["babel-preset-solid"]
|
||||
],
|
||||
"plugins": [
|
||||
["module:solid-refresh/babel"]
|
||||
]
|
||||
},
|
||||
"production": {
|
||||
"presets": [
|
||||
["babel-preset-solid"]
|
||||
],
|
||||
"plugins": [
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Parcel doesn't enable package exports by default, which allows loading the dev version of SolidJS. To enable it, the following must be added in `package.json` (in accordance with [this document](https://parceljs.org/features/dependency-resolution/#enabling-package-exports)):
|
||||
|
||||
```json
|
||||
{
|
||||
"@parcel/resolver-default": {
|
||||
"packageExports": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Nollup
|
||||
|
||||
Requires the use of [`@rollup/plugin-babel`](https://www.npmjs.com/package/@rollup/plugin-babel). Add the following to `.babelrc`:
|
||||
|
||||
```json
|
||||
{
|
||||
"env": {
|
||||
"development": {
|
||||
"plugins": ["solid-refresh/babel"]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Snowpack
|
||||
|
||||
Requires the use of [`@snowpack/plugin-babel`](https://www.npmjs.com/package/@snowpack/plugin-babel). Add the following to `.babelrc`:
|
||||
|
||||
```json
|
||||
{
|
||||
"env": {
|
||||
"development": {
|
||||
"plugins": ["solid-refresh/babel", { "bundler": "esm" }]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Other dev servers
|
||||
|
||||
* [`wmr`](https://wmr.dev/)
|
||||
* SolidJS is yet to be supported or isn't clear yet. It will use the same config as Snowpack.
|
||||
* [`rollup-plugin-hot`](https://github.com/rixo/rollup-plugin-hot)
|
||||
* The library uses almost an ESM HMR-like API however it behaves the same way as Parcel. Supporting this library is still unclear.
|
||||
* [`@web/dev-server`](https://modern-web.dev/docs/dev-server)
|
||||
* The library supports HMR through their [HMR Plugin](https://modern-web.dev/docs/dev-server/plugins/hmr). The HMR interface is basically the same as Snowpack's.
|
||||
|
||||
### Development Environment
|
||||
|
||||
In any case, your build system needs to support conditional exports and have the `development` condition set.
|
||||
|
||||
> [!WARNING]
|
||||
> In some standard HMR implementations, this may cause your app to reload the full page if the development environment isn't properly set!
|
||||
|
||||
## How it works
|
||||
|
||||
The babel plugin will transform components with matching Pascal-cased names (indicating that they are components). This detection is supported in variable declarations, function declarations and named exports:
|
||||
|
||||
```jsx
|
||||
// This works
|
||||
function Foo() {
|
||||
return <h1>Hello Foo</h1>;
|
||||
}
|
||||
|
||||
// This also works
|
||||
const Bar = () => <h1>Hello Bar</h1>;
|
||||
```
|
||||
|
||||
The components are wrapped and memoized. When the module receives an update, it replaces the old components from the old module with the new components.
|
||||
|
||||
## Automatic Render Cleanup
|
||||
|
||||
The plugin automatically handles cleanups for unhandled `render` and `hydrate` calls from `solid-js/web`.
|
||||
|
||||
You can disable this feature entirely through the option `"fixRender": false`.
|
||||
|
||||
## Pragma
|
||||
|
||||
On a per file basis, use comments at top of file to opt out(change moves up to parent):
|
||||
|
||||
```js
|
||||
/* @refresh skip */
|
||||
```
|
||||
|
||||
Or force reload:
|
||||
|
||||
```js
|
||||
/* @refresh reload */
|
||||
```
|
||||
|
||||
## Limitations
|
||||
|
||||
* Preserving state is applied partially.
|
||||
* No HOC support.
|
||||
|
||||
## Custom `render`/`createContext`
|
||||
|
||||
You can define custom `render`/`createContext` calls by using the `imports` option
|
||||
|
||||
```js
|
||||
{
|
||||
"imports": [
|
||||
{
|
||||
// Only either "render" or "createContext"
|
||||
"type": "render",
|
||||
// Import identifier
|
||||
"name": "render",
|
||||
// Kind of import (named or default)
|
||||
"kind": "named",
|
||||
// Module source
|
||||
"source": "my-solid-library"
|
||||
}
|
||||
],
|
||||
}
|
||||
```
|
||||
|
||||
## Other Configs
|
||||
|
||||
### Granular Mode
|
||||
|
||||
Granular mode for HMR (which allows independent HMR for components and templates) is enabled by default. You can disable this by adding `granular: false`.
|
||||
|
||||
### JSX HMR
|
||||
|
||||
JSX, by default, is moved to a separate component to perform granular HMR. To disable this, add `jsx: false`.
|
||||
1082
go/jsruntime/runtime/solid-refresh/dist/babel.cjs
vendored
Normal file
1082
go/jsruntime/runtime/solid-refresh/dist/babel.cjs
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
go/jsruntime/runtime/solid-refresh/dist/babel.cjs.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/babel.cjs.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1061
go/jsruntime/runtime/solid-refresh/dist/babel.mjs
vendored
Normal file
1061
go/jsruntime/runtime/solid-refresh/dist/babel.mjs
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
go/jsruntime/runtime/solid-refresh/dist/babel.mjs.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/babel.mjs.map
vendored
Normal file
File diff suppressed because one or more lines are too long
329
go/jsruntime/runtime/solid-refresh/dist/solid-refresh.cjs
vendored
Normal file
329
go/jsruntime/runtime/solid-refresh/dist/solid-refresh.cjs
vendored
Normal file
@@ -0,0 +1,329 @@
|
||||
'use strict';
|
||||
|
||||
var solidJs = require('solid-js');
|
||||
|
||||
function setComponentProperty(component, key, value) {
|
||||
const descriptor = Object.getOwnPropertyDescriptor(component, key);
|
||||
if (descriptor) {
|
||||
Object.defineProperty(component, key, Object.assign(Object.assign({}, descriptor), { value }));
|
||||
}
|
||||
else {
|
||||
Object.defineProperty(component, key, {
|
||||
value,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
function createProxy(source, name, location) {
|
||||
const refreshName = `[solid-refresh]${name}`;
|
||||
function HMRComp(props) {
|
||||
const s = source();
|
||||
if (!s || solidJs.$DEVCOMP in s) {
|
||||
return solidJs.createMemo(() => {
|
||||
const c = source();
|
||||
if (c) {
|
||||
return solidJs.untrack(() => c(props));
|
||||
}
|
||||
return undefined;
|
||||
}, {
|
||||
name: refreshName,
|
||||
});
|
||||
}
|
||||
// no $DEVCOMP means it did not go through devComponent so source() is a regular function, not a component
|
||||
return s(props);
|
||||
}
|
||||
setComponentProperty(HMRComp, 'name', refreshName);
|
||||
if (location) {
|
||||
setComponentProperty(HMRComp, 'location', location);
|
||||
}
|
||||
return new Proxy(HMRComp, {
|
||||
get(_, property) {
|
||||
if (property === 'location' || property === 'name') {
|
||||
return HMRComp[property];
|
||||
}
|
||||
return source()[property];
|
||||
},
|
||||
set(_, property, value) {
|
||||
source()[property] = value;
|
||||
return true;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function isListUpdatedInternal(a, b) {
|
||||
const aKeys = Object.keys(a);
|
||||
const bKeys = Object.keys(b);
|
||||
// Check if both objects has the same amount of keys
|
||||
if (aKeys.length !== bKeys.length) {
|
||||
return true;
|
||||
}
|
||||
// Merge keys
|
||||
const keys = new Set([...aKeys, ...bKeys]);
|
||||
// Now check if merged keys has the same amount of keys as the other two
|
||||
// for example: { a, b } and { a, c } produces { a, b, c }
|
||||
if (keys.size !== aKeys.length) {
|
||||
return true;
|
||||
}
|
||||
// Now compare each items
|
||||
for (const key of keys) {
|
||||
// This covers NaN. No need for Object.is since it's extreme for -0
|
||||
if (a[key] !== b[key] || (a[key] !== a[key] && b[key] !== b[key])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function isListUpdated(a, b) {
|
||||
if (a && b) {
|
||||
return isListUpdatedInternal(a, b);
|
||||
}
|
||||
if (a == null && b != null) {
|
||||
return true;
|
||||
}
|
||||
if (a != null && b == null) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function $$registry() {
|
||||
return {
|
||||
components: new Map(),
|
||||
contexts: new Map(),
|
||||
};
|
||||
}
|
||||
function $$component(registry, id, component, options = {}) {
|
||||
const [comp, setComp] = solidJs.createSignal(component, { internal: true });
|
||||
const proxy = createProxy(comp, id, options.location);
|
||||
registry.components.set(id, Object.assign({ id,
|
||||
component,
|
||||
proxy, update: setComp }, options));
|
||||
return proxy;
|
||||
}
|
||||
function $$context(registry, id, context) {
|
||||
registry.contexts.set(id, {
|
||||
id,
|
||||
context,
|
||||
});
|
||||
return context;
|
||||
}
|
||||
function patchComponent(oldData, newData) {
|
||||
var _a, _b;
|
||||
// Check if incoming module has signature
|
||||
if (newData.signature) {
|
||||
// Compare signatures
|
||||
const oldDeps = (_a = oldData.dependencies) === null || _a === void 0 ? void 0 : _a.call(oldData);
|
||||
const newDeps = (_b = newData.dependencies) === null || _b === void 0 ? void 0 : _b.call(newData);
|
||||
if (newData.signature !== oldData.signature ||
|
||||
isListUpdated(newDeps, oldDeps)) {
|
||||
// Replace signatures and dependencies
|
||||
oldData.dependencies = newDeps ? () => newDeps : undefined;
|
||||
oldData.signature = newData.signature;
|
||||
// Remount
|
||||
oldData.update(() => newData.component);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// No granular update, remount
|
||||
oldData.update(() => newData.component);
|
||||
}
|
||||
// Always rely on the first proxy
|
||||
// This is to allow modules newly importing
|
||||
// the updated version to still be able
|
||||
// to render the latest version despite
|
||||
// not receiving the first proxy
|
||||
newData.update(() => oldData.proxy);
|
||||
}
|
||||
function patchComponents(oldData, newData) {
|
||||
const components = new Set([
|
||||
...oldData.components.keys(),
|
||||
...newData.components.keys(),
|
||||
]);
|
||||
for (const key of components) {
|
||||
const oldComponent = oldData.components.get(key);
|
||||
const newComponent = newData.components.get(key);
|
||||
if (oldComponent) {
|
||||
if (newComponent) {
|
||||
patchComponent(oldComponent, newComponent);
|
||||
}
|
||||
else {
|
||||
// We need to invalidate
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (newComponent) {
|
||||
oldData.components.set(key, newComponent);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function patchContext(oldData, newData) {
|
||||
oldData.context.defaultValue = newData.context.defaultValue;
|
||||
newData.context.id = oldData.context.id;
|
||||
newData.context.Provider = oldData.context.Provider;
|
||||
}
|
||||
function patchContexts(oldData, newData) {
|
||||
const contexts = new Set([
|
||||
...oldData.contexts.keys(),
|
||||
...newData.contexts.keys(),
|
||||
]);
|
||||
for (const key of contexts) {
|
||||
const oldContext = oldData.contexts.get(key);
|
||||
const newContext = newData.contexts.get(key);
|
||||
if (oldContext) {
|
||||
if (newContext) {
|
||||
patchContext(oldContext, newContext);
|
||||
}
|
||||
else {
|
||||
// We need to invalidate
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (newContext) {
|
||||
oldData.contexts.set(key, newContext);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function patchRegistry(oldRegistry, newRegistry) {
|
||||
const shouldInvalidateByContext = patchContexts(oldRegistry, newRegistry);
|
||||
const shouldInvalidateByComponents = patchComponents(oldRegistry, newRegistry);
|
||||
// In the future we may add other HMR features here
|
||||
return shouldInvalidateByComponents || shouldInvalidateByContext;
|
||||
}
|
||||
const SOLID_REFRESH = 'solid-refresh';
|
||||
const SOLID_REFRESH_PREV = 'solid-refresh-prev';
|
||||
function $$decline(...[type, hot, inline]) {
|
||||
switch (type) {
|
||||
case 'esm': {
|
||||
// Snowpack's ESM assumes invalidate as a normal page reload
|
||||
// decline should be better
|
||||
if (inline) {
|
||||
hot.invalidate();
|
||||
}
|
||||
else {
|
||||
hot.decline();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'vite': {
|
||||
// Vite is no-op on decline, just call invalidate
|
||||
if (inline) {
|
||||
hot.invalidate();
|
||||
}
|
||||
else {
|
||||
hot.accept(() => {
|
||||
hot.invalidate();
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'rspack-esm':
|
||||
case 'webpack5': {
|
||||
if (inline) {
|
||||
hot.invalidate();
|
||||
}
|
||||
else {
|
||||
hot.decline();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'standard': {
|
||||
// Some implementations do not have decline/invalidate
|
||||
if (inline) {
|
||||
if (hot.invalidate) {
|
||||
hot.invalidate();
|
||||
}
|
||||
else {
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
else if (hot.decline) {
|
||||
hot.decline();
|
||||
}
|
||||
else {
|
||||
hot.accept(() => {
|
||||
if (hot.invalidate) {
|
||||
hot.invalidate();
|
||||
}
|
||||
else {
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
let warned = false;
|
||||
function shouldWarnAndDecline() {
|
||||
const result = solidJs.DEV && Object.keys(solidJs.DEV).length;
|
||||
if (result) {
|
||||
return false;
|
||||
}
|
||||
if (!warned) {
|
||||
console.warn("To use solid-refresh, you need to use the dev build of SolidJS. Make sure your build system supports package.json conditional exports and has the 'development' condition turned on.");
|
||||
warned = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function $$refreshESM(type, hot, registry) {
|
||||
if (shouldWarnAndDecline()) {
|
||||
$$decline(type, hot);
|
||||
}
|
||||
else if (hot.data) {
|
||||
hot.data[SOLID_REFRESH] = hot.data[SOLID_REFRESH] || registry;
|
||||
hot.data[SOLID_REFRESH_PREV] = registry;
|
||||
hot.accept(mod => {
|
||||
if (mod == null ||
|
||||
patchRegistry(hot.data[SOLID_REFRESH], hot.data[SOLID_REFRESH_PREV])) {
|
||||
hot.invalidate();
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
// I guess just decline if hot.data doesn't exist
|
||||
$$decline(type, hot);
|
||||
}
|
||||
}
|
||||
function $$refreshStandard(type, hot, registry) {
|
||||
if (shouldWarnAndDecline()) {
|
||||
$$decline(type, hot);
|
||||
}
|
||||
else {
|
||||
const current = hot.data;
|
||||
if (current && current[SOLID_REFRESH]) {
|
||||
if (patchRegistry(current[SOLID_REFRESH], registry)) {
|
||||
$$decline(type, hot, true);
|
||||
}
|
||||
}
|
||||
hot.dispose((data) => {
|
||||
data[SOLID_REFRESH] = current ? current[SOLID_REFRESH] : registry;
|
||||
});
|
||||
hot.accept();
|
||||
}
|
||||
}
|
||||
function $$refresh(...[type, hot, registry]) {
|
||||
switch (type) {
|
||||
case 'esm':
|
||||
case 'vite': {
|
||||
$$refreshESM(type, hot, registry);
|
||||
break;
|
||||
}
|
||||
case 'standard':
|
||||
case 'webpack5':
|
||||
case 'rspack-esm': {
|
||||
$$refreshStandard(type, hot, registry);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exports.$$component = $$component;
|
||||
exports.$$context = $$context;
|
||||
exports.$$decline = $$decline;
|
||||
exports.$$refresh = $$refresh;
|
||||
exports.$$registry = $$registry;
|
||||
//# sourceMappingURL=solid-refresh.cjs.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/solid-refresh.cjs.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/solid-refresh.cjs.map
vendored
Normal file
File diff suppressed because one or more lines are too long
323
go/jsruntime/runtime/solid-refresh/dist/solid-refresh.mjs
vendored
Normal file
323
go/jsruntime/runtime/solid-refresh/dist/solid-refresh.mjs
vendored
Normal file
@@ -0,0 +1,323 @@
|
||||
import { $DEVCOMP, createMemo, untrack, createSignal, DEV } from 'solid-js';
|
||||
|
||||
function setComponentProperty(component, key, value) {
|
||||
const descriptor = Object.getOwnPropertyDescriptor(component, key);
|
||||
if (descriptor) {
|
||||
Object.defineProperty(component, key, Object.assign(Object.assign({}, descriptor), { value }));
|
||||
}
|
||||
else {
|
||||
Object.defineProperty(component, key, {
|
||||
value,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
function createProxy(source, name, location) {
|
||||
const refreshName = `[solid-refresh]${name}`;
|
||||
function HMRComp(props) {
|
||||
const s = source();
|
||||
if (!s || $DEVCOMP in s) {
|
||||
return createMemo(() => {
|
||||
const c = source();
|
||||
if (c) {
|
||||
return untrack(() => c(props));
|
||||
}
|
||||
return undefined;
|
||||
}, {
|
||||
name: refreshName,
|
||||
});
|
||||
}
|
||||
// no $DEVCOMP means it did not go through devComponent so source() is a regular function, not a component
|
||||
return s(props);
|
||||
}
|
||||
setComponentProperty(HMRComp, 'name', refreshName);
|
||||
if (location) {
|
||||
setComponentProperty(HMRComp, 'location', location);
|
||||
}
|
||||
return new Proxy(HMRComp, {
|
||||
get(_, property) {
|
||||
if (property === 'location' || property === 'name') {
|
||||
return HMRComp[property];
|
||||
}
|
||||
return source()[property];
|
||||
},
|
||||
set(_, property, value) {
|
||||
source()[property] = value;
|
||||
return true;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function isListUpdatedInternal(a, b) {
|
||||
const aKeys = Object.keys(a);
|
||||
const bKeys = Object.keys(b);
|
||||
// Check if both objects has the same amount of keys
|
||||
if (aKeys.length !== bKeys.length) {
|
||||
return true;
|
||||
}
|
||||
// Merge keys
|
||||
const keys = new Set([...aKeys, ...bKeys]);
|
||||
// Now check if merged keys has the same amount of keys as the other two
|
||||
// for example: { a, b } and { a, c } produces { a, b, c }
|
||||
if (keys.size !== aKeys.length) {
|
||||
return true;
|
||||
}
|
||||
// Now compare each items
|
||||
for (const key of keys) {
|
||||
// This covers NaN. No need for Object.is since it's extreme for -0
|
||||
if (a[key] !== b[key] || (a[key] !== a[key] && b[key] !== b[key])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function isListUpdated(a, b) {
|
||||
if (a && b) {
|
||||
return isListUpdatedInternal(a, b);
|
||||
}
|
||||
if (a == null && b != null) {
|
||||
return true;
|
||||
}
|
||||
if (a != null && b == null) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function $$registry() {
|
||||
return {
|
||||
components: new Map(),
|
||||
contexts: new Map(),
|
||||
};
|
||||
}
|
||||
function $$component(registry, id, component, options = {}) {
|
||||
const [comp, setComp] = createSignal(component, { internal: true });
|
||||
const proxy = createProxy(comp, id, options.location);
|
||||
registry.components.set(id, Object.assign({ id,
|
||||
component,
|
||||
proxy, update: setComp }, options));
|
||||
return proxy;
|
||||
}
|
||||
function $$context(registry, id, context) {
|
||||
registry.contexts.set(id, {
|
||||
id,
|
||||
context,
|
||||
});
|
||||
return context;
|
||||
}
|
||||
function patchComponent(oldData, newData) {
|
||||
var _a, _b;
|
||||
// Check if incoming module has signature
|
||||
if (newData.signature) {
|
||||
// Compare signatures
|
||||
const oldDeps = (_a = oldData.dependencies) === null || _a === void 0 ? void 0 : _a.call(oldData);
|
||||
const newDeps = (_b = newData.dependencies) === null || _b === void 0 ? void 0 : _b.call(newData);
|
||||
if (newData.signature !== oldData.signature ||
|
||||
isListUpdated(newDeps, oldDeps)) {
|
||||
// Replace signatures and dependencies
|
||||
oldData.dependencies = newDeps ? () => newDeps : undefined;
|
||||
oldData.signature = newData.signature;
|
||||
// Remount
|
||||
oldData.update(() => newData.component);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// No granular update, remount
|
||||
oldData.update(() => newData.component);
|
||||
}
|
||||
// Always rely on the first proxy
|
||||
// This is to allow modules newly importing
|
||||
// the updated version to still be able
|
||||
// to render the latest version despite
|
||||
// not receiving the first proxy
|
||||
newData.update(() => oldData.proxy);
|
||||
}
|
||||
function patchComponents(oldData, newData) {
|
||||
const components = new Set([
|
||||
...oldData.components.keys(),
|
||||
...newData.components.keys(),
|
||||
]);
|
||||
for (const key of components) {
|
||||
const oldComponent = oldData.components.get(key);
|
||||
const newComponent = newData.components.get(key);
|
||||
if (oldComponent) {
|
||||
if (newComponent) {
|
||||
patchComponent(oldComponent, newComponent);
|
||||
}
|
||||
else {
|
||||
// We need to invalidate
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (newComponent) {
|
||||
oldData.components.set(key, newComponent);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function patchContext(oldData, newData) {
|
||||
oldData.context.defaultValue = newData.context.defaultValue;
|
||||
newData.context.id = oldData.context.id;
|
||||
newData.context.Provider = oldData.context.Provider;
|
||||
}
|
||||
function patchContexts(oldData, newData) {
|
||||
const contexts = new Set([
|
||||
...oldData.contexts.keys(),
|
||||
...newData.contexts.keys(),
|
||||
]);
|
||||
for (const key of contexts) {
|
||||
const oldContext = oldData.contexts.get(key);
|
||||
const newContext = newData.contexts.get(key);
|
||||
if (oldContext) {
|
||||
if (newContext) {
|
||||
patchContext(oldContext, newContext);
|
||||
}
|
||||
else {
|
||||
// We need to invalidate
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (newContext) {
|
||||
oldData.contexts.set(key, newContext);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function patchRegistry(oldRegistry, newRegistry) {
|
||||
const shouldInvalidateByContext = patchContexts(oldRegistry, newRegistry);
|
||||
const shouldInvalidateByComponents = patchComponents(oldRegistry, newRegistry);
|
||||
// In the future we may add other HMR features here
|
||||
return shouldInvalidateByComponents || shouldInvalidateByContext;
|
||||
}
|
||||
const SOLID_REFRESH = 'solid-refresh';
|
||||
const SOLID_REFRESH_PREV = 'solid-refresh-prev';
|
||||
function $$decline(...[type, hot, inline]) {
|
||||
switch (type) {
|
||||
case 'esm': {
|
||||
// Snowpack's ESM assumes invalidate as a normal page reload
|
||||
// decline should be better
|
||||
if (inline) {
|
||||
hot.invalidate();
|
||||
}
|
||||
else {
|
||||
hot.decline();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'vite': {
|
||||
// Vite is no-op on decline, just call invalidate
|
||||
if (inline) {
|
||||
hot.invalidate();
|
||||
}
|
||||
else {
|
||||
hot.accept(() => {
|
||||
hot.invalidate();
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'rspack-esm':
|
||||
case 'webpack5': {
|
||||
if (inline) {
|
||||
hot.invalidate();
|
||||
}
|
||||
else {
|
||||
hot.decline();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'standard': {
|
||||
// Some implementations do not have decline/invalidate
|
||||
if (inline) {
|
||||
if (hot.invalidate) {
|
||||
hot.invalidate();
|
||||
}
|
||||
else {
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
else if (hot.decline) {
|
||||
hot.decline();
|
||||
}
|
||||
else {
|
||||
hot.accept(() => {
|
||||
if (hot.invalidate) {
|
||||
hot.invalidate();
|
||||
}
|
||||
else {
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
let warned = false;
|
||||
function shouldWarnAndDecline() {
|
||||
const result = DEV && Object.keys(DEV).length;
|
||||
if (result) {
|
||||
return false;
|
||||
}
|
||||
if (!warned) {
|
||||
console.warn("To use solid-refresh, you need to use the dev build of SolidJS. Make sure your build system supports package.json conditional exports and has the 'development' condition turned on.");
|
||||
warned = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function $$refreshESM(type, hot, registry) {
|
||||
if (shouldWarnAndDecline()) {
|
||||
$$decline(type, hot);
|
||||
}
|
||||
else if (hot.data) {
|
||||
hot.data[SOLID_REFRESH] = hot.data[SOLID_REFRESH] || registry;
|
||||
hot.data[SOLID_REFRESH_PREV] = registry;
|
||||
hot.accept(mod => {
|
||||
if (mod == null ||
|
||||
patchRegistry(hot.data[SOLID_REFRESH], hot.data[SOLID_REFRESH_PREV])) {
|
||||
hot.invalidate();
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
// I guess just decline if hot.data doesn't exist
|
||||
$$decline(type, hot);
|
||||
}
|
||||
}
|
||||
function $$refreshStandard(type, hot, registry) {
|
||||
if (shouldWarnAndDecline()) {
|
||||
$$decline(type, hot);
|
||||
}
|
||||
else {
|
||||
const current = hot.data;
|
||||
if (current && current[SOLID_REFRESH]) {
|
||||
if (patchRegistry(current[SOLID_REFRESH], registry)) {
|
||||
$$decline(type, hot, true);
|
||||
}
|
||||
}
|
||||
hot.dispose((data) => {
|
||||
data[SOLID_REFRESH] = current ? current[SOLID_REFRESH] : registry;
|
||||
});
|
||||
hot.accept();
|
||||
}
|
||||
}
|
||||
function $$refresh(...[type, hot, registry]) {
|
||||
switch (type) {
|
||||
case 'esm':
|
||||
case 'vite': {
|
||||
$$refreshESM(type, hot, registry);
|
||||
break;
|
||||
}
|
||||
case 'standard':
|
||||
case 'webpack5':
|
||||
case 'rspack-esm': {
|
||||
$$refreshStandard(type, hot, registry);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export { $$component, $$context, $$decline, $$refresh, $$registry };
|
||||
//# sourceMappingURL=solid-refresh.mjs.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/solid-refresh.mjs.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/solid-refresh.mjs.map
vendored
Normal file
File diff suppressed because one or more lines are too long
4
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/checks.d.ts
vendored
Normal file
4
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/checks.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import * as t from '@babel/types';
|
||||
export declare function isComponentishName(name: string): boolean;
|
||||
export declare function getImportSpecifierName(specifier: t.ImportSpecifier): string;
|
||||
//# sourceMappingURL=checks.d.ts.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/checks.d.ts.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/checks.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../../../../src/babel/core/checks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAKlC,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,WAE9C;AAED,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,CAAC,CAAC,eAAe,GAAG,MAAM,CAK3E"}
|
||||
8
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/constants.d.ts
vendored
Normal file
8
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/constants.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import type { ImportDefinition, ImportIdentifierSpecifier } from './types';
|
||||
export declare const IMPORT_REGISTRY: ImportDefinition;
|
||||
export declare const IMPORT_REFRESH: ImportDefinition;
|
||||
export declare const IMPORT_COMPONENT: ImportDefinition;
|
||||
export declare const IMPORT_CONTEXT: ImportDefinition;
|
||||
export declare const IMPORT_DECLINE: ImportDefinition;
|
||||
export declare const IMPORT_SPECIFIERS: ImportIdentifierSpecifier[];
|
||||
//# sourceMappingURL=constants.d.ts.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/constants.d.ts.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/constants.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/babel/core/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAM3E,eAAO,MAAM,eAAe,EAAE,gBAI7B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,gBAI5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,gBAI9B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,gBAI5B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,gBAI5B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,yBAAyB,EAyBxD,CAAC"}
|
||||
5
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/create-registry.d.ts
vendored
Normal file
5
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/create-registry.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import type * as babel from '@babel/core';
|
||||
import * as t from '@babel/types';
|
||||
import type { StateContext } from './types';
|
||||
export declare function createRegistry(state: StateContext, path: babel.NodePath): t.Identifier;
|
||||
//# sourceMappingURL=create-registry.d.ts.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/create-registry.d.ts.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/create-registry.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"create-registry.d.ts","sourceRoot":"","sources":["../../../../src/babel/core/create-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAKlC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,wBAAgB,cAAc,CAC5B,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE,KAAK,CAAC,QAAQ,GACnB,CAAC,CAAC,UAAU,CAmDd"}
|
||||
4
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/generate-unique-name.d.ts
vendored
Normal file
4
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/generate-unique-name.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import type * as babel from '@babel/core';
|
||||
import * as t from '@babel/types';
|
||||
export declare function generateUniqueName(path: babel.NodePath, name: string): t.Identifier;
|
||||
//# sourceMappingURL=generate-unique-name.d.ts.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/generate-unique-name.d.ts.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/generate-unique-name.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"generate-unique-name.d.ts","sourceRoot":"","sources":["../../../../src/babel/core/generate-unique-name.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAElC,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,KAAK,CAAC,QAAQ,EACpB,IAAI,EAAE,MAAM,GACX,CAAC,CAAC,UAAU,CAkBd"}
|
||||
3
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/generator.d.ts
vendored
Normal file
3
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/generator.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type * as t from '@babel/types';
|
||||
export declare function generateCode(node: t.Node): string;
|
||||
//# sourceMappingURL=generator.d.ts.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/generator.d.ts.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/generator.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../src/babel/core/generator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,CAAC,MAAM,cAAc,CAAC;AAUvC,wBAAgB,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,GAAG,MAAM,CAEjD"}
|
||||
3
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-descriptive-name.d.ts
vendored
Normal file
3
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-descriptive-name.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type * as babel from '@babel/core';
|
||||
export declare function getDescriptiveName(path: babel.NodePath, defaultName: string): string;
|
||||
//# sourceMappingURL=get-descriptive-name.d.ts.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-descriptive-name.d.ts.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-descriptive-name.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"get-descriptive-name.d.ts","sourceRoot":"","sources":["../../../../src/babel/core/get-descriptive-name.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAE1C,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,KAAK,CAAC,QAAQ,EACpB,WAAW,EAAE,MAAM,GAClB,MAAM,CAoCR"}
|
||||
4
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-foreign-bindings.d.ts
vendored
Normal file
4
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-foreign-bindings.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import type * as babel from '@babel/core';
|
||||
import * as t from '@babel/types';
|
||||
export declare function getForeignBindings(path: babel.NodePath): t.Identifier[];
|
||||
//# sourceMappingURL=get-foreign-bindings.d.ts.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-foreign-bindings.d.ts.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-foreign-bindings.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"get-foreign-bindings.d.ts","sourceRoot":"","sources":["../../../../src/babel/core/get-foreign-bindings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AA+BlC,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,UAAU,EAAE,CAoBvE"}
|
||||
4
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-hmr-decline-call.d.ts
vendored
Normal file
4
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-hmr-decline-call.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import type * as babel from '@babel/core';
|
||||
import type { StateContext } from './types';
|
||||
export declare function getHMRDeclineCall(state: StateContext, path: babel.NodePath): babel.types.IfStatement;
|
||||
//# sourceMappingURL=get-hmr-decline-call.d.ts.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-hmr-decline-call.d.ts.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-hmr-decline-call.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"get-hmr-decline-call.d.ts","sourceRoot":"","sources":["../../../../src/babel/core/get-hmr-decline-call.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAK1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,CAAC,QAAQ,2BAmC1E"}
|
||||
4
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-hot-identifier.d.ts
vendored
Normal file
4
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-hot-identifier.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import * as t from '@babel/types';
|
||||
import type { StateContext } from './types';
|
||||
export declare function getHotIdentifier(state: StateContext): t.MemberExpression;
|
||||
//# sourceMappingURL=get-hot-identifier.d.ts.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-hot-identifier.d.ts.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-hot-identifier.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"get-hot-identifier.d.ts","sourceRoot":"","sources":["../../../../src/babel/core/get-hot-identifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,GAAG,CAAC,CAAC,gBAAgB,CAqBxE"}
|
||||
5
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-import-identifier.d.ts
vendored
Normal file
5
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-import-identifier.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import type * as babel from '@babel/core';
|
||||
import * as t from '@babel/types';
|
||||
import type { ImportDefinition, StateContext } from './types';
|
||||
export declare function getImportIdentifier(state: StateContext, path: babel.NodePath, registration: ImportDefinition): t.Identifier;
|
||||
//# sourceMappingURL=get-import-identifier.d.ts.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-import-identifier.d.ts.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-import-identifier.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"get-import-identifier.d.ts","sourceRoot":"","sources":["../../../../src/babel/core/get-import-identifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE9D,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE,KAAK,CAAC,QAAQ,EACpB,YAAY,EAAE,gBAAgB,GAC7B,CAAC,CAAC,UAAU,CAwBd"}
|
||||
3
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-root-statement-path.d.ts
vendored
Normal file
3
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-root-statement-path.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type * as babel from '@babel/core';
|
||||
export declare function getRootStatementPath(path: babel.NodePath): babel.NodePath;
|
||||
//# sourceMappingURL=get-root-statement-path.d.ts.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-root-statement-path.d.ts.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-root-statement-path.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"get-root-statement-path.d.ts","sourceRoot":"","sources":["../../../../src/babel/core/get-root-statement-path.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAG1C,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAUzE"}
|
||||
3
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-statement-path.d.ts
vendored
Normal file
3
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-statement-path.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type * as babel from '@babel/core';
|
||||
export declare function getStatementPath(path: babel.NodePath): babel.NodePath | null;
|
||||
//# sourceMappingURL=get-statement-path.d.ts.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-statement-path.d.ts.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/get-statement-path.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"get-statement-path.d.ts","sourceRoot":"","sources":["../../../../src/babel/core/get-statement-path.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAG1C,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,GAAG,IAAI,CAQ5E"}
|
||||
4
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/is-statement-top-level.d.ts
vendored
Normal file
4
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/is-statement-top-level.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import type * as babel from '@babel/core';
|
||||
import type * as t from '@babel/types';
|
||||
export declare function isStatementTopLevel(path: babel.NodePath<t.Statement>): boolean;
|
||||
//# sourceMappingURL=is-statement-top-level.d.ts.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/is-statement-top-level.d.ts.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/is-statement-top-level.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"is-statement-top-level.d.ts","sourceRoot":"","sources":["../../../../src/babel/core/is-statement-top-level.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,KAAK,CAAC,MAAM,cAAc,CAAC;AAEvC,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,GAChC,OAAO,CAST"}
|
||||
5
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/is-valid-callee.d.ts
vendored
Normal file
5
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/is-valid-callee.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import type * as babel from '@babel/core';
|
||||
import * as t from '@babel/types';
|
||||
import type { ImportIdentifierType, StateContext } from './types';
|
||||
export declare function isValidCallee(state: StateContext, path: babel.NodePath, { callee }: t.CallExpression, target: ImportIdentifierType): boolean;
|
||||
//# sourceMappingURL=is-valid-callee.d.ts.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/is-valid-callee.d.ts.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/is-valid-callee.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"is-valid-callee.d.ts","sourceRoot":"","sources":["../../../../src/babel/core/is-valid-callee.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,KAAK,EAEV,oBAAoB,EACpB,YAAY,EACb,MAAM,SAAS,CAAC;AA+DjB,wBAAgB,aAAa,CAC3B,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE,KAAK,CAAC,QAAQ,EACpB,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,cAAc,EAC5B,MAAM,EAAE,oBAAoB,WAe7B"}
|
||||
5
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/register-import-specifiers.d.ts
vendored
Normal file
5
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/register-import-specifiers.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import type * as babel from '@babel/core';
|
||||
import * as t from '@babel/types';
|
||||
import type { ImportIdentifierSpecifier, StateContext } from './types';
|
||||
export declare function registerImportSpecifiers(state: StateContext, path: babel.NodePath<t.ImportDeclaration>, definitions: ImportIdentifierSpecifier[]): void;
|
||||
//# sourceMappingURL=register-import-specifiers.d.ts.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/register-import-specifiers.d.ts.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/register-import-specifiers.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"register-import-specifiers.d.ts","sourceRoot":"","sources":["../../../../src/babel/core/register-import-specifiers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAElC,OAAO,KAAK,EAAE,yBAAyB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAqCvE,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,EACzC,WAAW,EAAE,yBAAyB,EAAE,QAUzC"}
|
||||
4
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/transform-jsx.d.ts
vendored
Normal file
4
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/transform-jsx.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import type * as babel from '@babel/core';
|
||||
import * as t from '@babel/types';
|
||||
export declare function transformJSX(path: babel.NodePath<t.JSXElement | t.JSXFragment>): void;
|
||||
//# sourceMappingURL=transform-jsx.d.ts.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/transform-jsx.d.ts.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/transform-jsx.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"transform-jsx.d.ts","sourceRoot":"","sources":["../../../../src/babel/core/transform-jsx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AA+QlC,wBAAgB,YAAY,CAC1B,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,WAAW,CAAC,GACjD,IAAI,CA4DN"}
|
||||
42
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/types.d.ts
vendored
Normal file
42
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/types.d.ts
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
import type * as t from '@babel/types';
|
||||
import type { RuntimeType } from '../../shared/types';
|
||||
export interface NamedImportDefinition {
|
||||
kind: 'named';
|
||||
name: string;
|
||||
source: string;
|
||||
}
|
||||
export interface DefaultImportDefinition {
|
||||
kind: 'default';
|
||||
source: string;
|
||||
}
|
||||
export type ImportDefinition = DefaultImportDefinition | NamedImportDefinition;
|
||||
export interface Options {
|
||||
granular?: boolean;
|
||||
jsx?: boolean;
|
||||
bundler?: RuntimeType;
|
||||
fixRender?: boolean;
|
||||
imports?: {
|
||||
createContext: ImportDefinition[];
|
||||
render: ImportDefinition[];
|
||||
};
|
||||
}
|
||||
export type ImportIdentifierType = 'render' | 'createContext';
|
||||
export interface ImportIdentifierSpecifier {
|
||||
type: ImportIdentifierType;
|
||||
definition: ImportDefinition;
|
||||
}
|
||||
export interface StateContext {
|
||||
jsx: boolean;
|
||||
granular: boolean;
|
||||
opts: Options;
|
||||
specifiers: ImportIdentifierSpecifier[];
|
||||
imports: Map<string, t.Identifier>;
|
||||
registrations: {
|
||||
identifiers: Map<t.Identifier, ImportIdentifierSpecifier>;
|
||||
namespaces: Map<t.Identifier, ImportIdentifierSpecifier[]>;
|
||||
};
|
||||
filename: string | undefined;
|
||||
bundler: RuntimeType;
|
||||
fixRender: boolean;
|
||||
}
|
||||
//# sourceMappingURL=types.d.ts.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/types.d.ts.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/types.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/babel/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,CAAC,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,gBAAgB,GAAG,uBAAuB,GAAG,qBAAqB,CAAC;AAE/E,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE;QACR,aAAa,EAAE,gBAAgB,EAAE,CAAC;QAClC,MAAM,EAAE,gBAAgB,EAAE,CAAC;KAC5B,CAAC;CACH;AAED,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,eAAe,CAAC;AAE9D,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,oBAAoB,CAAC;IAC3B,UAAU,EAAE,gBAAgB,CAAC;CAC9B;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,OAAO,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,yBAAyB,EAAE,CAAC;IACxC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC;IACnC,aAAa,EAAE;QACb,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC,UAAU,EAAE,yBAAyB,CAAC,CAAC;QAC1D,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC,UAAU,EAAE,yBAAyB,EAAE,CAAC,CAAC;KAC5D,CAAC;IACF,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAE,WAAW,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;CACpB"}
|
||||
11
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/unwrap.d.ts
vendored
Normal file
11
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/unwrap.d.ts
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import type * as babel from '@babel/core';
|
||||
import type * as t from '@babel/types';
|
||||
type TypeFilter<V extends t.Node> = (node: t.Node) => node is V;
|
||||
export declare function isPathValid<V extends t.Node>(path: unknown, key: TypeFilter<V>): path is babel.NodePath<V>;
|
||||
export type NestedExpression = t.ParenthesizedExpression | t.TypeCastExpression | t.TSAsExpression | t.TSSatisfiesExpression | t.TSNonNullExpression | t.TSInstantiationExpression | t.TSTypeAssertion;
|
||||
export declare function isNestedExpression(node: t.Node): node is NestedExpression;
|
||||
type TypeCheck<K> = K extends TypeFilter<infer U> ? U : never;
|
||||
export declare function unwrapNode<K extends (value: t.Node) => boolean>(node: t.Node, key: K): TypeCheck<K> | undefined;
|
||||
export declare function unwrapPath<V extends t.Node>(path: unknown, key: TypeFilter<V>): babel.NodePath<V> | undefined;
|
||||
export {};
|
||||
//# sourceMappingURL=unwrap.d.ts.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/unwrap.d.ts.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/unwrap.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"unwrap.d.ts","sourceRoot":"","sources":["../../../../src/babel/core/unwrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,KAAK,CAAC,MAAM,cAAc,CAAC;AAEvC,KAAK,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,CAAC;AAEhE,wBAAgB,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,EAC1C,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,GACjB,IAAI,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAE3B;AAED,MAAM,MAAM,gBAAgB,GACxB,CAAC,CAAC,uBAAuB,GACzB,CAAC,CAAC,kBAAkB,GACpB,CAAC,CAAC,cAAc,GAChB,CAAC,CAAC,qBAAqB,GACvB,CAAC,CAAC,mBAAmB,GACrB,CAAC,CAAC,yBAAyB,GAC3B,CAAC,CAAC,eAAe,CAAC;AAEtB,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,GAAG,IAAI,IAAI,gBAAgB,CAazE;AAED,KAAK,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAE9D,wBAAgB,UAAU,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,KAAK,OAAO,EAC7D,IAAI,EAAE,CAAC,CAAC,IAAI,EACZ,GAAG,EAAE,CAAC,GACL,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,CAQ1B;AAED,wBAAgB,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,EACzC,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,GACjB,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,CAQ/B"}
|
||||
7
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/xxhash32.d.ts
vendored
Normal file
7
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/xxhash32.d.ts
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
*
|
||||
* @param buffer - byte array or string
|
||||
* @param seed - optional seed (32-bit unsigned);
|
||||
*/
|
||||
export declare function xxHash32(buffer: Uint8Array | string, seed?: number): number;
|
||||
//# sourceMappingURL=xxhash32.d.ts.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/xxhash32.d.ts.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/core/xxhash32.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"xxhash32.d.ts","sourceRoot":"","sources":["../../../../src/babel/core/xxhash32.ts"],"names":[],"mappings":"AAkCA;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,EAAE,IAAI,SAAI,GAAG,MAAM,CAqKtE"}
|
||||
8
go/jsruntime/runtime/solid-refresh/dist/src/babel/index.d.ts
vendored
Normal file
8
go/jsruntime/runtime/solid-refresh/dist/src/babel/index.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import type * as babel from '@babel/core';
|
||||
import type { Options } from './core/types';
|
||||
interface State extends babel.PluginPass {
|
||||
opts: Options;
|
||||
}
|
||||
export type { Options };
|
||||
export default function solidRefreshPlugin(): babel.PluginObj<State>;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/index.d.ts.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/src/babel/index.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/babel/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAoB1C,OAAO,KAAK,EAAE,OAAO,EAAgB,MAAM,cAAc,CAAC;AAqT1D,UAAU,KAAM,SAAQ,KAAK,CAAC,UAAU;IACtC,IAAI,EAAE,OAAO,CAAC;CACf;AAED,YAAY,EAAE,OAAO,EAAE,CAAC;AAExB,MAAM,CAAC,OAAO,UAAU,kBAAkB,IAAI,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAqDnE"}
|
||||
6
go/jsruntime/runtime/solid-refresh/dist/src/runtime/create-proxy.d.ts
vendored
Normal file
6
go/jsruntime/runtime/solid-refresh/dist/src/runtime/create-proxy.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import type { JSX, Accessor } from 'solid-js';
|
||||
export interface BaseComponent<P> {
|
||||
(props: P): JSX.Element;
|
||||
}
|
||||
export default function createProxy<C extends BaseComponent<P>, P>(source: Accessor<C>, name: string, location?: string): (props: P) => JSX.Element;
|
||||
//# sourceMappingURL=create-proxy.d.ts.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/src/runtime/create-proxy.d.ts.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/src/runtime/create-proxy.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"create-proxy.d.ts","sourceRoot":"","sources":["../../../src/runtime/create-proxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAG9C,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,CAAC,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC;CACzB;AAuBD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,EAC/D,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EACnB,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,MAAM,GAChB,CAAC,KAAK,EAAE,CAAC,KAAK,GAAG,CAAC,OAAO,CAuC3B"}
|
||||
60
go/jsruntime/runtime/solid-refresh/dist/src/runtime/index.d.ts
vendored
Normal file
60
go/jsruntime/runtime/solid-refresh/dist/src/runtime/index.d.ts
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
import type { Context, JSX } from 'solid-js';
|
||||
import type { ESMRuntimeType, StandardRuntimeType } from '../shared/types';
|
||||
interface ComponentOptions {
|
||||
location?: string;
|
||||
signature?: string;
|
||||
dependencies?: () => Record<string, any>;
|
||||
}
|
||||
export interface ComponentRegistrationData<P> extends ComponentOptions {
|
||||
id: string;
|
||||
component: (props: P) => JSX.Element;
|
||||
proxy: (props: P) => JSX.Element;
|
||||
update: (action: () => (props: P) => JSX.Element) => void;
|
||||
}
|
||||
export interface ContextRegistrationData<T> {
|
||||
id: string;
|
||||
context: Context<T>;
|
||||
}
|
||||
export interface Registry {
|
||||
components: Map<string, ComponentRegistrationData<any>>;
|
||||
contexts: Map<string, ContextRegistrationData<any>>;
|
||||
}
|
||||
export declare function $$registry(): Registry;
|
||||
export declare function $$component<P>(registry: Registry, id: string, component: (props: P) => JSX.Element, options?: ComponentOptions): (props: P) => JSX.Element;
|
||||
export declare function $$context<T>(registry: Registry, id: string, context: Context<T>): Context<T>;
|
||||
declare const SOLID_REFRESH = "solid-refresh";
|
||||
declare const SOLID_REFRESH_PREV = "solid-refresh-prev";
|
||||
type HotData = {
|
||||
[key in typeof SOLID_REFRESH | typeof SOLID_REFRESH_PREV]: Registry;
|
||||
};
|
||||
interface ESMHot {
|
||||
data: HotData;
|
||||
accept: (cb: (module?: unknown) => void) => void;
|
||||
invalidate: () => void;
|
||||
decline: () => void;
|
||||
}
|
||||
interface StandardHot {
|
||||
data: HotData;
|
||||
accept: (cb?: () => void) => void;
|
||||
dispose: (cb: (data: HotData) => void) => void;
|
||||
invalidate?: () => void;
|
||||
decline?: () => void;
|
||||
}
|
||||
type ESMDecline = [type: ESMRuntimeType, hot: ESMHot, inline?: boolean];
|
||||
type StandardDecline = [
|
||||
type: StandardRuntimeType,
|
||||
hot: StandardHot,
|
||||
inline?: boolean
|
||||
];
|
||||
type Decline = ESMDecline | StandardDecline;
|
||||
export declare function $$decline(...[type, hot, inline]: Decline): void;
|
||||
type ESMRefresh = [type: ESMRuntimeType, hot: ESMHot, registry: Registry];
|
||||
type StandardRefresh = [
|
||||
type: StandardRuntimeType,
|
||||
hot: StandardHot,
|
||||
registry: Registry
|
||||
];
|
||||
type Refresh = ESMRefresh | StandardRefresh;
|
||||
export declare function $$refresh(...[type, hot, registry]: Refresh): void;
|
||||
export {};
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/src/runtime/index.d.ts.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/src/runtime/index.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAI3E,UAAU,gBAAgB;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,YAAY,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC1C;AAGD,MAAM,WAAW,yBAAyB,CAAC,CAAC,CAAE,SAAQ,gBAAgB;IAGpE,EAAE,EAAE,MAAM,CAAC;IAEX,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,GAAG,CAAC,OAAO,CAAC;IACrC,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,GAAG,CAAC,OAAO,CAAC;IAGjC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,KAAK,GAAG,CAAC,OAAO,KAAK,IAAI,CAAC;CAC3D;AAGD,MAAM,WAAW,uBAAuB,CAAC,CAAC;IAGxC,EAAE,EAAE,MAAM,CAAC;IAEX,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;CACrB;AAED,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,yBAAyB,CAAC,GAAG,CAAC,CAAC,CAAC;IACxD,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,uBAAuB,CAAC,GAAG,CAAC,CAAC,CAAC;CACrD;AAED,wBAAgB,UAAU,IAAI,QAAQ,CAKrC;AAED,wBAAgB,WAAW,CAAC,CAAC,EAC3B,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,GAAG,CAAC,OAAO,EACpC,OAAO,GAAE,gBAAqB,GAC7B,CAAC,KAAK,EAAE,CAAC,KAAK,GAAG,CAAC,OAAO,CAe3B;AAED,wBAAgB,SAAS,CAAC,CAAC,EACzB,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAClB,OAAO,CAAC,CAAC,CAAC,CAMZ;AAmGD,QAAA,MAAM,aAAa,kBAAkB,CAAC;AACtC,QAAA,MAAM,kBAAkB,uBAAuB,CAAC;AAEhD,KAAK,OAAO,GAAG;KACZ,GAAG,IAAI,OAAO,aAAa,GAAG,OAAO,kBAAkB,GAAG,QAAQ;CACpE,CAAC;AAEF,UAAU,MAAM;IACd,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,KAAK,IAAI,CAAC;IACjD,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,WAAW;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IAClC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,KAAK,IAAI,CAAC;IAC/C,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,KAAK,UAAU,GAAG,CAAC,IAAI,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;AACxE,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,mBAAmB;IACzB,GAAG,EAAE,WAAW;IAChB,MAAM,CAAC,EAAE,OAAO;CACjB,CAAC;AACF,KAAK,OAAO,GAAG,UAAU,GAAG,eAAe,CAAC;AAE5C,wBAAgB,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,OAAO,QAsDxD;AA8DD,KAAK,UAAU,GAAG,CAAC,IAAI,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAC1E,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,mBAAmB;IACzB,GAAG,EAAE,WAAW;IAChB,QAAQ,EAAE,QAAQ;CACnB,CAAC;AAEF,KAAK,OAAO,GAAG,UAAU,GAAG,eAAe,CAAC;AAE5C,wBAAgB,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,OAAO,QAc1D"}
|
||||
2
go/jsruntime/runtime/solid-refresh/dist/src/runtime/is-list-updated.d.ts
vendored
Normal file
2
go/jsruntime/runtime/solid-refresh/dist/src/runtime/is-list-updated.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export default function isListUpdated(a: Record<string, any> | undefined, b: Record<string, any> | undefined): boolean;
|
||||
//# sourceMappingURL=is-list-updated.d.ts.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/src/runtime/is-list-updated.d.ts.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/src/runtime/is-list-updated.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"is-list-updated.d.ts","sourceRoot":"","sources":["../../../src/runtime/is-list-updated.ts"],"names":[],"mappings":"AA2BA,MAAM,CAAC,OAAO,UAAU,aAAa,CACnC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,EAClC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,GACjC,OAAO,CAWT"}
|
||||
4
go/jsruntime/runtime/solid-refresh/dist/src/shared/types.d.ts
vendored
Normal file
4
go/jsruntime/runtime/solid-refresh/dist/src/shared/types.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
export type ESMRuntimeType = 'esm' | 'vite';
|
||||
export type StandardRuntimeType = 'standard' | 'webpack5' | 'rspack-esm';
|
||||
export type RuntimeType = ESMRuntimeType | StandardRuntimeType;
|
||||
//# sourceMappingURL=types.d.ts.map
|
||||
1
go/jsruntime/runtime/solid-refresh/dist/src/shared/types.d.ts.map
vendored
Normal file
1
go/jsruntime/runtime/solid-refresh/dist/src/shared/types.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/shared/types.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,CAAC;AAG5C,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,UAAU,GAAG,YAAY,CAAC;AAEzE,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,mBAAmB,CAAC"}
|
||||
74
go/jsruntime/runtime/solid-refresh/package.json
Normal file
74
go/jsruntime/runtime/solid-refresh/package.json
Normal file
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"name": "solid-refresh",
|
||||
"type": "module",
|
||||
"description": "Universal HMR for SolidJS",
|
||||
"author": "Ryan Carniato",
|
||||
"license": "MIT",
|
||||
"version": "0.7.8",
|
||||
"homepage": "https://github.com/solidjs/solid-refresh#readme",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/solidjs/solid-refresh"
|
||||
},
|
||||
"main": "dist/solid-refresh.cjs",
|
||||
"module": "dist/solid-refresh.mjs",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./dist/solid-refresh.mjs",
|
||||
"require": "./dist/solid-refresh.cjs",
|
||||
"default": "./dist/solid-refresh.cjs",
|
||||
"types": "./dist/src/runtime/index.d.ts"
|
||||
},
|
||||
"./babel": {
|
||||
"import": "./dist/babel.mjs",
|
||||
"require": "./dist/babel.cjs",
|
||||
"default": "./dist/babel.cjs",
|
||||
"types": "./dist/src/babel/index.d.ts"
|
||||
},
|
||||
"./dist/*": "./dist/*"
|
||||
},
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"babel": [
|
||||
"./dist/src/babel/index.d.ts"
|
||||
]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"contributors": [
|
||||
"Alexis Munsayac"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.29.0",
|
||||
"@biomejs/biome": "^2.4.4",
|
||||
"@rollup/plugin-node-resolve": "^16.0.3",
|
||||
"@rollup/plugin-typescript": "^12.3.0",
|
||||
"@types/babel__core": "^7.20.5",
|
||||
"@types/babel__generator": "^7.27.0",
|
||||
"@types/node": "^25.3.0",
|
||||
"babel-preset-solid": "^1.9.10",
|
||||
"rollup": "^4.59.0",
|
||||
"solid-js": "^1.9.11",
|
||||
"tslib": "^2.6.2",
|
||||
"typescript": "^5.9.3",
|
||||
"vitest": "^4.0.18"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"solid-js": "^1.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/generator": "^7.29.1",
|
||||
"@babel/types": "^7.29.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"test": "vitest",
|
||||
"test:CI": "vitest"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user