Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

fix: use polyfill for URLSearchParams #556

Closed
wants to merge 1 commit into from

Conversation

akloeckner
Copy link
Contributor

since it is not available on iOS 9.3.5 (i.e. old iPads e.g.)

see #530, @anthony2856

since it is not available on iOS 9.3.5 (i.e. old iPads e.g.)

see resoai#530, @anthony2856
@rchl
Copy link
Collaborator

rchl commented Nov 29, 2020

Can you try this instead: #557 ?

I haven't tried it on a device that doesn't support URLSearchParams but looking at the generated code, it looks like something like a polyfill is added.

Please try first without switching to URLSearchParams to check if the URL.searchParams is pollyfilled.
If that doesn't work, please try switching to explicit URLSearchParams.

@rchl
Copy link
Collaborator

rchl commented Nov 29, 2020

And the motivation for doing it the way I did is that it's better to handle this transparently through babel than explicitly through a third-party package.

@akloeckner
Copy link
Contributor Author

I see the advantage. But I can't test it. I get an undefined error. I get the same from master, actually...

@rchl
Copy link
Collaborator

rchl commented Nov 29, 2020

Not sure where you getting this undefined exactly but maybe try adding this and see if the tablet shows more meaningful error:

--- a/scripts/globals.js
+++ b/scripts/globals.js
@@ -26,6 +26,8 @@ window.onerror = function (error, file, line, char) {
       'Line: ' + line + ':' + char,
    ].join('<br>');
 
+   alert(text);
+
    Noty.addObject({
       type: Noty.ERROR,
       title: 'JS error',

@rchl
Copy link
Collaborator

rchl commented Nov 29, 2020

I've added an extra commit that fixes notifications not working when there is a syntax error in the config. This should ensure that the user will be able to see where the actual error is.

@rchl
Copy link
Collaborator

rchl commented Nov 29, 2020

And BTW, I also have an old iPad with iOS 9 and I was able to verify that this fixes the issue. But I'd like you to confirm that also. :)

@akloeckner
Copy link
Contributor Author

It's not on the tablet, but on my desktop Firefox. I get this:
grafik

From master. 2f9cee8 is still ok.

@rchl
Copy link
Collaborator

rchl commented Nov 29, 2020

With yarn dev or yarn build?

@akloeckner
Copy link
Contributor Author

yarn build

@rchl
Copy link
Collaborator

rchl commented Nov 29, 2020

Did you make sure to run yarn first to install the new dependency?

@akloeckner
Copy link
Contributor Author

tried now to run yarn. it says already up-to-date. Ill runn build again. I'll be back in 3 mins...

@akloeckner
Copy link
Contributor Author

still the same. but since you oviously don't have that... I'll check if there's something offending in my config...

@rchl
Copy link
Collaborator

rchl commented Nov 29, 2020

Yeah, I don't see that with my config. Neither on Firefox nor Chrome.
You could check with the example config to see if it just loads.
Also, is yarn dev working? It should provide a better error message if it also reproduces.

@akloeckner
Copy link
Contributor Author

It's ok with the example configuration.

With my actual configuration, yarn dev also fails. too much recursion is what the error seems to be:
grafik

I'm stuck for now... I might find out more in the next days... :-/

@akloeckner
Copy link
Contributor Author

Got it. I have that in my TILE_DEFAULTS:

   [TYPES.CAMERA]: {
      // Have fullscreen
      fullscreen: {
         type: TYPES.CAMERA,
         //bgSize: 'contain',
      }
   }

I'll probably open an issue on it, when I still consider that to be allowable tomorrow morning. :-)

@rchl
Copy link
Collaborator

rchl commented Nov 30, 2020

Interesting case.

It feels a bit wrong to specify the defaults for two "different" tiles at once.

But it might make sense for cases when we want to provide different defaults for a given tile, depending on where it's used.

We still have to recursively merge in some cases, like when the user provides a popup object for the POPUP tile, for example.

@rchl
Copy link
Collaborator

rchl commented Nov 30, 2020

I've merged my change after confirming that it's working on iOS 9.

@rchl rchl closed this Nov 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants