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

IDEA: V1 FINAL PATCH #198

Open
ghost opened this issue Apr 5, 2018 · 4 comments
Open

IDEA: V1 FINAL PATCH #198

ghost opened this issue Apr 5, 2018 · 4 comments

Comments

@ghost
Copy link

ghost commented Apr 5, 2018

A thought for backwards compatibility to think about....
This is the thought I was having while I was setting up branches for the v2s docs.

I was having thoughts of putting in one final change branch to the v1 repo so that it would scrub xtag and it's dependent methods and present them differently to the window's object so that v2 could read the prior version and inherit it's features.

For instance, when you load xtag into the global scope you could search the header dom for a meta tag with the appropriate name/content information. Like:

var _h = document.querySelector("meta[name='x-tag']"),
     _v = _h.content ;
if(_v==="2") { _DEFINE_METHOD(); }
else{ NO_CHANGES_KEEP_LATEST_V1_ }

I am not sure if this is a direction you ever thought of going, but an advantage to using a method that utilizes meta content is that it would be more flexible to other developers wanting to mix-in their own code or dependencies that require features on versions of other libraries by making that info readily available.

@ghost ghost mentioned this issue Apr 8, 2018
@ghost
Copy link
Author

ghost commented May 29, 2018

I have been thinking about this a lot more lately and have dived into the raw core 1 source.

I have went the route of providing a _prevent parameter for the register method.

xtag.register('my-elem', {
  lifecyle: {
    created: function(){ console.log("Choned"); }
  } 
}, 
class{
  constructor() {}
  onBuild(){}
  onRender(){}
  // templates ect using v2 parser for extensions
} );

The preventClassParam, will allow you to pass an onBuild and an onRender method to it, as well as allow you to implement templates.

@ghost
Copy link
Author

ghost commented May 29, 2018

I call this V2-ish

@ghost
Copy link
Author

ghost commented May 29, 2018

To Do:

  • need to add template examples that use the V2 extension parser

@ghost
Copy link
Author

ghost commented May 29, 2018

Thinking about:

  1. Allowing link preload detection to initiate the correct pollyfill for the requested build.

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

0 participants