Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Import path to meta #418

Merged
merged 6 commits into from
May 5, 2018
Merged

Import path to meta #418

merged 6 commits into from
May 5, 2018

Conversation

e111077
Copy link
Contributor

@e111077 e111077 commented May 5, 2018

Removed --add-import-path and changed it to --remove-import-meta. It might be useful to look at the individual commits to filter out all the tests

before:
The flag, --add-import-meta, that defaulted to false, would add

class extends PolymerElement {
  static get importPath() { return import.meta.url; }
}

Polymer({
  importPath: import.meta.url
});

This was no longer supported in Polymer/polymer#5180

after:
The flag is now --remove-import-meta (false by default). So, by default we insert:

class extends PolymerElement {
  static get importMeta() { return import.meta; }
}

Polymer({
  importMeta: import.meta
});

By adding the --remove-import-meta flag, the user can opt out of this insertion (which is now on by default).

README.md Outdated
@@ -107,9 +107,9 @@ This will create a `modulizer_workspace` directory and checkout the repos and th

Setting the import style allows you to set whether JavaScript imports are specified by npm package name, or relative file path. Importing specifiers that use package names are easier for third-party packages to work with, but unlike paths they currently can not run natively on the web. Defaults to "path".

#### `--add-import-path`
#### `--remove-import-meta
Copy link
Member

Choose a reason for hiding this comment

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

I would lean towards keeping --add-import-path and just changing the default to true.

@e111077
Copy link
Contributor Author

e111077 commented May 5, 2018

implemented changes!

README.md Outdated

If included, the static `importPath` property will be added to converted Polymer elements. See [the `importPath` documentation](https://www.polymer-project.org/2.0/docs/devguide/dom-template) for more information.
True by default, but if set to false, the static `importMeta` property will not be added to converted Polymer elements. See [the `importPath` documentation](https://www.polymer-project.org/2.0/docs/devguide/dom-template) for more information.
Copy link
Member

Choose a reason for hiding this comment

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

I would just say "True by default. Add a static importMeta property to converted Polymer elements." or something (less negatives)

@e111077 e111077 merged commit e03a822 into master May 5, 2018
@e111077 e111077 deleted the import-path-to-meta branch May 5, 2018 03:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants