Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import jstz.min.js from jstimezonedetect 1.0.7 #571

Merged
merged 1 commit into from Apr 11, 2022

Conversation

danxuliu
Copy link
Member

Fixes #543

In Nextcloud 22 jstimezonedetect was removed from the server bundle, so now each app that uses it needs to ship its own copy. For simplicity, as the app does not currently use webpack or NPM, the minified file was just added to js/vendor.

@blizzz
Copy link
Member

blizzz commented Jan 6, 2022

@danxuliu here, master serves Nextcloud 21to 24. Would the change be a problem on 21?

@danxuliu
Copy link
Member Author

danxuliu commented Jan 7, 2022

@danxuliu here, master serves Nextcloud 21 to 24. Would the change be a problem on 21?

In Nextcloud 21 jstimezonedetect was shipped in the server bundle, but it was already deprecated. Deprecated global properties are added to window as a read-only function that prints a warning and then returns the wrapped property. As it is read-only trying to set window.jstz later when vendor/jstz.min.js is loaded by user_saml has no effect (not even a console error, as vendor/jstz.min.js is not in strict mode).

In short, no, the change should not be a problem in Nextcloud 21 :-)

@HolgerHees
Copy link

Hi, any progress here? pull request is still blocked because of an "fatal: refusing to merge unrelated histories" error. Maybe a rebase would help?

@solracsf
Copy link
Member

solracsf commented Mar 4, 2022

/rebase

@HolgerHees
Copy link

looks like the integration tests itself are broken.

This version of Nextcloud requires at least PHP 7.4
You are currently running 7.3.20. Please update your PHP version.This version of Nextcloud requires at least PHP 7.4
You are currently running 7.3.20. Please update your PHP version.

Seams to be not related to your pull request.

anyone has an idea who is able to fix and where we should report this?

@danxuliu
Copy link
Member Author

danxuliu commented Mar 4, 2022

anyone has an idea who is able to fix and where we should report this?

See #583 :-)

@blizzz
Copy link
Member

blizzz commented Apr 11, 2022

/rebase

In Nextcloud 22 jstimezonedetect was removed from the server bundle
(nextcloud/server#25850), so now each app that
uses it needs to ship its own copy. For simplicity, as the app does not
currently use webpack or NPM, the minified file was just added to
"js/vendor".

"jstz.min.js" was copied from
https://github.com/pellepim/jstimezonedetect/blob/ddc9e040342d68c06129ae28011517e5b2dde664/dist/jstz.min.js
(which is the same as the one included in
https://registry.npmjs.org/jstimezonedetect/-/jstimezonedetect-1.0.7.tgz).

jstimezonedetect is licenced under the MIT licence.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@blizzz blizzz mentioned this pull request Apr 11, 2022
3 tasks
@blizzz blizzz merged commit 3f1c676 into master Apr 11, 2022
@blizzz blizzz deleted the import-jstimezonedetect branch April 11, 2022 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Uncaught ReferenceError: jstz is not defined" error in browser console
4 participants