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

WIP: Asset fetch #87

Closed
wants to merge 1 commit into from
Closed

WIP: Asset fetch #87

wants to merge 1 commit into from

Conversation

Quafadas
Copy link
Contributor

@Quafadas Quafadas commented Aug 20, 2024

This would be, I believe the changes that needed to be made to follow the discussion here;

SAP/ui5-webcomponents#9487

The hope is that it would still as before in vite, but allow the option to use a CDN if desired. i.e. to allow loading out of a CDN, bypassing the need for a bundler. As far as I can tell at the moment, this seems to work in a large % of cases.

However, apparently not with internationalisation at the moment, which is critical for DatePicker components for example.

I see errors like this; when loading that page

Unhandled Promise Rejection: Error: CLDR data for locale en_GB is not loaded!

Which is not encouraging. At this stage unclear if;

  • I have missed an import / change in the facade
  • this was an oversight in the UI5 PR
  • vite doesn't do this yet
  • demo project needs different vite config.

Arg...

@Quafadas
Copy link
Contributor Author

vitejs/vite#17949

@Quafadas
Copy link
Contributor Author

Quafadas commented Aug 28, 2024

@sherpal Apologies to bother you, but sadly, I think this PR should be closed without merging and I'll look at bootlegging my own version of this library. Here's the reasoning - would be great to see if you agree or if there might be a better way.

The discussion linked above ended with the maintainer of UI5 introducing a new Assets-fetch module which registers assets through the (apparently) modern new URL('xxx', import.meta.url) syntax. This should have worked with both the CDN and bundler.

It works in the CDN case, and in the "bundler-build-for-production" case, but not the (common) npm run dev, i.e. bundler -for-development case without extra vite configuration. Both the maintainer of UI5 and myself view this as a vite bug, but the issue registered with vite was closed as not planned as a duplicate of an old issue. I can't make out that is going to get fixed anytime soon. For posterity here it is;

vitejs/vite#8427

That means this PR would break the library for the default useage of the majority of it's userbase (except me) without extra configuration. I'm assuming that isn't really an acceptable outcome.

I can't also imagine a good way around it and as things stand I guess there is no-one else interested in investing their time - so I can't see other options.

@Quafadas Quafadas closed this Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant