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

Added UMD #3377

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

Added UMD #3377

wants to merge 1 commit into from

Conversation

redexp
Copy link

@redexp redexp commented May 16, 2024

No braking changes, but now this file can be treat as module for commonjs or require.js or have regular global Janus var

I used this UMD template https://github.com/umdjs/umd/blob/master/templates/returnExports.js

No braking changes, but now this file can be treat as module for commonjs or require.js or have regular global Janus var
@januscla
Copy link

Thanks for your contribution, @redexp! Please make sure you sign our CLA, as it's a required step before we can merge this.

@redexp
Copy link
Author

redexp commented May 16, 2024

Another pros - you can define as many private var as you need. Like that var defaultExtension that I assumed should be private, but right now it's in global scope and could be overwritten in some other file.

@lminiero
Copy link
Member

I'm not knowledgeable about JavaScript enough to have an opinion: I only care that this doesn't break existing demos. I'll leave @atoppi to evaluate if this could cause us problems. I do notice that this apparently didn't pass our linter check on Github Actions, though.

@redexp
Copy link
Author

redexp commented May 17, 2024

linter errors on typeof define I think if I change it to typeof root.define then it should pass linter

Copy link
Member

@atoppi atoppi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address the linting issues.

I see nothing wrong about the PR.
If @lminiero is fine with moving the Janus definition from the top level to an immediately invoked function then we're good to go.

@redexp
Copy link
Author

redexp commented May 23, 2024

@atoppi

    28:38  error    'define' is not defined                       no-undef
    29:3   error    'define' is not defined                       no-undef
    30:43  error    'module' is not defined                       no-undef
    31:3   error    'module' is not defined                       no-undef

@atoppi
Copy link
Member

atoppi commented May 23, 2024

@redexp yeah, please fix those and also the issues about indentation.
If you wanna test locally before triggering our github workflow, just use eslint janus.js with our eslint configuration file (.eslintrc.js).

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.

None yet

4 participants