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

CDN version #24

Closed
vanodevium opened this issue Jul 11, 2024 · 9 comments
Closed

CDN version #24

vanodevium opened this issue Jul 11, 2024 · 9 comments

Comments

@vanodevium
Copy link
Collaborator

Are there any plan to make a CDN version of the file so that it can be included with a simple <script> tag?

@dy
Copy link
Owner

dy commented Jul 11, 2024

I used to have it, as sprae.auto.js, but found that not as useful, since almost always UI needs some interaction with state (sooner or later) and it's better to have module version from the beginning. I can reconsider if you have convincing case

@vanodevium
Copy link
Collaborator Author

@dy

If that's enough, I'll just describe my case:

  • it is forbidden to use bundlers and builders
  • all libraries on the page are included only as the CDN version by simple <script>
  • not all of these libraries have a version with export

As a result, porridge is obtained, with which you need to fight somehow.

If you'll made a CDN version without automatic init(), then everything could be done approximately like this:

  1. <script src="CDN/sprae.min.js">
  2. DOMContentLoaded
  3. state initiation (from the server or another way)
  4. window.Sprae.init()

@dy
Copy link
Owner

dy commented Jul 12, 2024

I see what you mean now, an old school window.sprae without bundlers/modules etc, like window.jQuery.
It creates porridge here though, although to lesser extent.
Yeah, I guess that version could make sense, I can add UMD version like
<script src="https://unpkg.com/sprae/dist/sprae.umd.js" init/> - that would cover all non-ESM cases, like global object, require, AMD, etc, also would optionally enable autoinit.

@vanodevium
Copy link
Collaborator Author

@dy

May I ask how long it takes to do this?

I do not want to rush you in any way, just to plan my work.

@dy
Copy link
Owner

dy commented Jul 12, 2024

Do you need it urgently?
I was thinking to release it likely next minor version, possibly today.

@vanodevium
Copy link
Collaborator Author

@dy

It would be very cool!

Because I'm already working on this code right now and I really need sprae.

Thanx!

@dy
Copy link
Owner

dy commented Jul 12, 2024

@vanodevium ok, I'll work on it the next few hours, thanks for the PRs

@dy
Copy link
Owner

dy commented Jul 12, 2024

Ok, added in v10.9.0

@dy dy closed this as completed Jul 12, 2024
@vanodevium
Copy link
Collaborator Author

@dy

it's WOW, it's awesome!

Thanx!

works like a charm

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

No branches or pull requests

2 participants