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

feature: allow to import extension dynamically and statically #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jankapunkt
Copy link
Member

This PR enables to either fully dynamically or fully statically import this package. This allows full code splitting and reduce initial bundle size.

Excerpt from README:

There are two ways to import the package: dynamic and static.
The default way is dynamic, where you import a function, containing a dynamic import.
This prevents this package from being added to the initial client bundle and allows
you to import it only at that point when it's really required.

import loadAfNoUiSlider from 'meteor/muqube:autoform-nouislider'
// This is only an example of how to reactively track
// if the extension has been loaded.
// You can, of course, track it anyway you want!
Template.myTemplate.onCreated(async function () {
  const instance = this
  instance.state = new ReactiveDict()
  await loadAfNoUiSlider.default()
  instance.state.set('afNoUiSliderLoaded', true)
})

If you really need this package being added to the initial bundle, thus being present at
startup time, then you should use the static import:

import 'meteor/muqube:autoform-nouislider/static'

@raiyankamal
Copy link
Collaborator

helo @jankapunkt thanks for contributing once again.
I'm not using this package anymore and also not working on Meteor anymore. If you like, I can completely transfer the ownership of this package to you. Since you have been the only contributor for last few years, I think it's fitting that you own this. Let me know.

@jankapunkt
Copy link
Member Author

Hey @raiyankamal thanks for the fast response. Would be great if you would do that. If you have your Meteor account still active you can add my username to the group of publishers for when you login to https://cloud.meteor.com/ then I can publish new versions as well.

@raiyankamal
Copy link
Collaborator

Hi @jankapunkt , unfortunately it's been very long since I last used the meteor account. How about I transfer this repo to you (on github), then you can have the liberty to publish it in any way you like?

@jankapunkt
Copy link
Member Author

Hey @raiyankamal yes that would work, too. Thanks a lot for the trust and the willingness to keep it alive by doing so.

@raiyankamal
Copy link
Collaborator

Hi @jankapunkt
I tried to transfer ownership today, but got this message:
"jankapunkt/meteor-autoform-nouislider already exists and You can only transfer a repository from an organization to yourself at this time "
So looks like the fork of this repo under your account is already sufficient. If you wish, you can go about publishing this in meteor. In the mean time I'll put a note in the README file to indicate that this repository is not maintained anymore and yours is the most updated one.

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.

2 participants