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

Allow extra js modules to be included in frontend #24675

Merged
merged 2 commits into from
Jun 21, 2019
Merged

Allow extra js modules to be included in frontend #24675

merged 2 commits into from
Jun 21, 2019

Conversation

thomasloven
Copy link
Contributor

@thomasloven thomasloven commented Jun 21, 2019

Description:

HTML imports are being deprecated, and the recommended way forward is to use js module imports instead. This allows specifying modules that will be imported in the frontend.

A use case may be adding aditional icon sets. This could be done using lovelace modules, but then the new icons would work only after loading the lovelace panel. I.e. in a browser opened directly to e.g./states or /config/entity_registry the new icons wouldn't show up.

Corresponding frontend PR: home-assistant/frontend#3288

(Quick and dirty WIP/POC)

Related issue (if applicable): N/A

Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#9674

Example entry for configuration.yaml (if applicable):

frontend:
  extra_module_url:
    - /local/mything.js
  extra_module_url_es5:
    - /local/mything_for_older_browsers.js

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@ghost
Copy link

ghost commented Jun 21, 2019

Hey there @home-assistant/frontend, mind taking a look at this pull request as its been labeled with a integration (frontend) you are listed as a codeowner for? Thanks!

This is a automatic comment generated by codeowners-mention to help ensure issues and pull requests are seen by the right people.

@balloob balloob added this to the 0.95.0 milestone Jun 21, 2019
@balloob balloob merged commit 9b52b9b into home-assistant:dev Jun 21, 2019
@balloob
Copy link
Member

balloob commented Jun 21, 2019

Please add a PR for the docs 👍

@thomasloven
Copy link
Contributor Author

Will do!

thomasloven added a commit to home-assistant/home-assistant.io that referenced this pull request Jun 21, 2019
@thomasloven
Copy link
Contributor Author

thomasloven commented Jun 21, 2019

home-assistant/home-assistant.io#9674
Please help me check the nomenclature. It's midsummer eve in Sweden, so I'm not exactly sober...

balloob pushed a commit to home-assistant/home-assistant.io that referenced this pull request Jun 22, 2019
balloob pushed a commit that referenced this pull request Jun 24, 2019
* Add extra_module_url and extra_module_url_es5 to frontend options

* Address review comments
balloob pushed a commit to home-assistant/home-assistant.io that referenced this pull request Jun 26, 2019
@balloob balloob mentioned this pull request Jun 26, 2019
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.

3 participants