thunderous 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -282,7 +282,7 @@ var clearHTML = (element) => {
282
282
  var parseFragment = (htmlStr) => {
283
283
  const template = document.createElement("template");
284
284
  template.innerHTML = htmlStr;
285
- const fragment = renderState.currentShadowRoot === null ? template.content : renderState.currentShadowRoot.importNode(template.content, true);
285
+ const fragment = renderState.currentShadowRoot === null ? template.content : renderState.currentShadowRoot.importNode?.(template.content, true) ?? template.content;
286
286
  return fragment;
287
287
  };
288
288
  var logValueError = (value) => {
@@ -853,7 +853,15 @@ var createRegistry = (args) => {
853
853
  const customElementTags = /* @__PURE__ */ new Set();
854
854
  const nativeRegistry = (() => {
855
855
  if (isServer) return;
856
- if (scoped) return new CustomElementRegistry();
856
+ if (scoped) {
857
+ try {
858
+ return new CustomElementRegistry();
859
+ } catch {
860
+ console.error(
861
+ "The scoped custom elements polyfill was not found. Falling back to global registry.\n\nCheck `RegistryResult.scoped` at https://thunderous.dev/docs/registries for more information."
862
+ );
863
+ }
864
+ }
857
865
  return customElements;
858
866
  })();
859
867
  return {
package/dist/index.js CHANGED
@@ -247,7 +247,7 @@ var clearHTML = (element) => {
247
247
  var parseFragment = (htmlStr) => {
248
248
  const template = document.createElement("template");
249
249
  template.innerHTML = htmlStr;
250
- const fragment = renderState.currentShadowRoot === null ? template.content : renderState.currentShadowRoot.importNode(template.content, true);
250
+ const fragment = renderState.currentShadowRoot === null ? template.content : renderState.currentShadowRoot.importNode?.(template.content, true) ?? template.content;
251
251
  return fragment;
252
252
  };
253
253
  var logValueError = (value) => {
@@ -818,7 +818,15 @@ var createRegistry = (args) => {
818
818
  const customElementTags = /* @__PURE__ */ new Set();
819
819
  const nativeRegistry = (() => {
820
820
  if (isServer) return;
821
- if (scoped) return new CustomElementRegistry();
821
+ if (scoped) {
822
+ try {
823
+ return new CustomElementRegistry();
824
+ } catch {
825
+ console.error(
826
+ "The scoped custom elements polyfill was not found. Falling back to global registry.\n\nCheck `RegistryResult.scoped` at https://thunderous.dev/docs/registries for more information."
827
+ );
828
+ }
829
+ }
822
830
  return customElements;
823
831
  })();
824
832
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thunderous",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",