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
Various modules now use `reqFun` rather than `reqCls` to verify that
inputs are "classes". This may produce false positives for arrow
functions, but those would quickly fail on any `new` attempt anyway,
just with a different message.
This allows better compatibility with "old"-style "classes" defined
via the `function` keyword, which may be outside of user control for
transpilation or polyfill reasons.
`lang.mjs`:
`reset` now returns the same value which was provided as an input.
Added `swap`.
`obj.mjs`:
`assign` and `patch` are now variadic, similar to `Object.assign`.
True if the input is a function with a prototype, likely to be a class. False for arrow functions such as `() => {}`, which don't have a prototype.
1
+
True if the input is a function with a prototype, suitable for `instanceof` checks. False for arrow functions such as `() => {}`, which don't have a prototype.
Copy file name to clipboardExpand all lines: doc/prax_readme.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -154,7 +154,7 @@ For SSR (server-side rendering), Prax needs our lightweight DOM shim:
154
154
import*aspfrom'{{featUrl prax}}'
155
155
import*asdgfrom'{{featUrl dom_global_shim}}'
156
156
157
-
constren=newp.Ren(dg.global)
157
+
constren=newp.Ren({env:dg.global})
158
158
const {E} = ren
159
159
160
160
constelem=E(`div`, {
@@ -170,16 +170,16 @@ console.log(elem.outerHTML)
170
170
*/
171
171
```
172
172
173
-
For SSR/SPA hybrids, configure an [importmap](https://wicg.github.io/import-maps/) or [bundler](https://esbuild.github.io) to choose the right global `document` and pass it to `Ren`. The rest will just work.
173
+
For SSR/SPA hybrids, configure an [importmap](https://wicg.github.io/import-maps/) or [bundler](https://esbuild.github.io) to choose the right global "environment" and pass it to `Ren`. The rest will just work.
174
174
175
175
```js
176
176
import*aspfrom'{{featUrl prax}}'
177
177
178
-
// Your bundler or importmap should choose the right one.
178
+
// Your bundler or importmap needs to choose the right one.
179
179
import*asdgfrom'{{featUrl dom_global_shim}}'
180
180
import*asdgfrom'{{featUrl dom_global_native}}'
181
181
182
-
constren=newp.Ren(dg.global)
182
+
constren=newp.Ren({env:dg.global})
183
183
const {E} = ren
184
184
185
185
// In both environments, this will be a DOM element.
@@ -197,7 +197,7 @@ Rendering a complete document with doctype:
Variant of [#`Bmap`](#class-bmap) with support for key and value checks. Subclasses must override methods `.reqKey` and `.reqVal`. These methods are automatically called by `.set`. Method `.reqKey` must validate and return the given key, and method `.reqVal` must validate and return the given value. Use type assertions provided by [`lang`](lang_readme.md).
// Immediately ready for use. Tag is automatically set to `a-btn`.
33
33
// The mixin `MixReg` enables automatic registration on instantiation.
@@ -66,7 +66,7 @@ Apps which use server-side rendering and client-side upgrading of custom element
66
66
Instead, use `dr.reg`, which is also used internally by `MixReg`. This is simply a shortcut for using the [#default registry](#class-reg) provided by this module.
0 commit comments