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

Is this still being maintained? Does it need maintenance? #390

Open
balupton opened this issue Apr 10, 2014 · 35 comments
Open

Is this still being maintained? Does it need maintenance? #390

balupton opened this issue Apr 10, 2014 · 35 comments

Comments

@balupton
Copy link
Member

Hey @andreasbernhard are you still carrying the torch on this? Or shall we find a new maintainer?

@mreinstein
Copy link

+1

@pipecameron
Copy link

I believe the clear answer is no, it isn't being maintained

@balupton
Copy link
Member Author

balupton commented May 1, 2014

Hrmm. Anyone keen to take over maintenance, I'm happy to make this commonjs compliant and do other improvements providing we can get some funding behind it.

For some background on how History.js has been maintained over the years, see: http://stackoverflow.com/a/17394242/130638

@istrasoft
Copy link

If this is not being maintained, is there any viable production alternative still being maintained at the moment or is it the only lib that allows the use of history without all the browser quirks ?

@mreinstein
Copy link

@istrasoft Backbone's router and history objects are very modular, lightweight, have decent browser support, and fully support amd, commonjs, and window globals for module options

https://github.com/jashkenas/backbone/blob/master/backbone.js#L1280-L1379

https://github.com/jashkenas/backbone/blob/master/backbone.js#L1381-L1640

@mreinstein
Copy link

I should add that backbone and most alternatives provide their own APIs. History.js is different in that it's a polyfill, where it fixes/shims the html history and push state standards.

Personally I like polyfills more but I find History.js has too many issues at the moment due to lacking maintenance.

@balupton regarding the part you mentioned in your post: "pushState call instantly triggering the statechange event" does this deviate from the w3c spec, or is the spec vague in this area? What do you consider the philosophy of history.js to be? Is it intended to shim the history/push state support to be as close to the standard as possible?

@istrasoft
Copy link

@mreinstein indeed Backbone is interesting, but including it plus underscore just to implement a cross browser ajax navigation with history is a bit overkill isn't it ...

@balupton Is the company which took over the copyright to history.js planning to maintain it, or just list it on their projects page ?

@mreinstein
Copy link

@istrasoft :

Backbone is interesting,but including it plus underscore just to implement a
cross browser ajax navigation with history is a bit overkill isn't it ...

Here is the main source file for history.js:
https://github.com/browserstate/history.js/blob/master/scripts/uncompressed/history.js
2046 lines.

Here is all the source code for underscore:
https://github.com/jashkenas/underscore/blob/master/underscore.js
1353 lines.

Even with Backbone.Router + Backbone.History + underscore, it's still smaller than just the main source code file for history.js alone.

that being said, Backbone.History is only using about 6 functions from underscore. It could be significantly slimmed down. Backbone also supports lodash, which has more modular builds than underscore.

@istrasoft
Copy link

Ok thanks @mreinstein. Now since you pointed this out the next question is : why is history.js so huge (even if json2 and html4 are excluded)... and does it need to be ?

@mreinstein
Copy link

I did a very quick glance at the source in history.js, and there are certainly parts that could be removed. I found a few hundred lines of debug related code for example. Another source of increased length is the commenting and whitespace uses a format that is more verbose. That definitely pads it out a lot.

I'm definitely willing to attempt a cleanup, if @balupton is amenable to it. One thing that would be super helpful would be to catalog all of the bugs that history.js works around. IMO that's the library's biggest value at the moment. I would take all those bug workarounds that history.js has, compare them to what backbone.history and backbone.router do, build up a test suite to cover all those cases.. and then attempt a refactor. I'd probably do something like history2.js

@mreinstein
Copy link

another thing I'd do is add UMD support and rip out all the dojo/ext/jquery/mootools adapter stuff. I don't think they are needed, and if they are they should be separate modules. I'd prefer history.js to do one thing; provide a native shim of history/push state. Tiny modules that do one thing well.

@istrasoft
Copy link

Wonderful. If I'm not mistaken though, history is more of a higher level api to HTML5 history than a routing system with a finite preconfigured number of routes, which is the answer to a different need, right ? Me for example I would need a dynamic routing system where the URL of the page fragment retrieved via ajax would be constructed dynamically from the requested full page url, so not just simple fragments /home, /page1, and so on ...

@mreinstein
Copy link

If I'm not mistaken though, history is more of a higher level api

I think that's correct, but I don't think that's what history.js should be. I'd prefer it to stick to it's original intent of shimming the history/push state APIs.

Me for example I would need a dynamic routing system

I think that would be a good module to write based on the history api. In fact I think that's what Backbone.Router and Backbone.History basically do.

@istrasoft
Copy link

Yes it does, for nice beautiful urls... I'm maintaining an app with legacy urls with lots of arguments and values, so it would not work..

@mreinstein
Copy link

it would not work

I'm not sure what "it" refers to in the previous comment. If you have an app with legacy urls and lots of arguments and values, then you write a small module that handles all of them. That's application specific business logic.

@istrasoft
Copy link

"it" meaning the dynamic routes in Backbone.router.
That's what I was looking into when sumbled on history.js ;)

@mreinstein
Copy link

Ah ok, understood. If I had my way, the dynamic routing you are talking about would be out of scope for history.js. Though it could be built as a module that relies on history.js.

@istrasoft
Copy link

Exactly. What I and other just wish for, is that a complete abstraction to pushstate/popstate that I can include in the page, and that would just work cross browser. No other fancy shmancy stuff, no zillions of kilobytes of code. I for example would be willing to sacrifice the ability to save any data with states if it would cut the size and complexity of the shim significantly. Also, maybe make the decison not to support IE<9 (like jQuery 2 or Foundation 5) and Safari < 6...

@istrasoft
Copy link

Reading the code of Backbone.History compared to History.js it appears that in case you don't care about older browsers that don't at least support hashchange event, Backbone.History actually has everything one needs to use statechange or hashchange, as most of the bugs fixed in History.js do belong to older browsers...

@balupton
Copy link
Member Author

@balupton Is the company which took over the copyright to history.js planning to maintain it, or just list it on their projects page?

Bevry is my company. We created it. It goes on our project page. We don't have any projects that actively use it, so we don't maintain it actively. When we have projects that use it, and find a bug, we fix it. From our sporadic use, History.js works well.

There seems to be a few definitions of maintenance being thrown around here. Maintenance is solving your own issues. Support is solving the issues of others.

A project as diverse as History.js can only work well if the people actively using it maintain it, whomever that may be. As supporting History.js, due to it's popularity, is a sure way to burn out.

If we could raise a boatload of money, maybe we can support it. I've actually considered crowdfunding a fair few times, however living in Australia makes it very hard for us to receive crowd funding money.

Reading the code of Backbone.History compared to History.js it appears that in case you don't care about older browsers that don't at least support hashchange event, Backbone.History actually has everything one needs to use statechange or hashchange, as most of the bugs fixed in History.js do belong to older browsers...

It's not just about older browsers, but different browser implementations:
https://github.com/browserstate/history.js/wiki/The-State-of-the-HTML5-History-API

If you don't care about different browsers doing their own thing, then use the native API. If you care about consistency, use History.js

@istrasoft
Copy link

Thanks for the clarification @balupton.
Is the table describing the different behaviour of browsers up to date ? It seems to me most of the referenced issues have been since fixed, a few years ago...

@balupton
Copy link
Member Author

Not sure. My last content edits were 3 years ago. Someone could certainly check.

What we really need is a acid test for the html5 history API so a table like that can be generated automatically. I attempted writing one when I did that table, but not one browser worked correctly. Perhaps it's worth another shot.

Getting our test suite completely automated would also make merging things way easier, as so far, humans must run our automated test suite manually in different browsers and environments and do a few tests manually too.

@istrasoft
Copy link

As a side comment, it's something that annoys me very much as a developer is to have APIs (XMLHttpRequest, History, loads of others) that are made in a way that it's practically unusable by itself and need a huge lib to sit on top of it all to make it practical and consistent. What is quite worrisome is that it does not change with time. I mean, the spec/api makers know it was how it worked before, but the new APIs are released with the same old issue...

@mreinstein
Copy link

We don't have any projects that actively use it, so we don't maintain it actively.

@balupton that is disappointing. This is the most widely publicized polyfill for the history api. The state of history.js has ramifications beyond whatever Bevry, inc. uses it for.

If we could raise a boatload of money, maybe we can support it.

There are other open source projects that don't raise a boatload of money and still are very actively maintained. Look at webshims for example, or any of substack's projects. Not exactly cash cows for their maintainers but they are alive and well.

What we really need is a acid test for the html5 history API..
Getting our test suite completely automated would also make merging things way easier

Sounds good, I'd like to help with this to start. Do we have tests now for these? I've seen the browser bugs that history.js handles listed in human readable form in several places:

Is there some overlap of the above lists with the existing test suite here? https://github.com/browserstate/history.js/blob/master/tests/tests.js

@mreinstein
Copy link

maybe we could use https://ci.testling.com for our cross browser automated test suite. I'd be willing to set this up, but I'd need some help with constructing the tests.

@istrasoft
Copy link

Also, a re-check of the current status of browsers would be nice. A lot of frameworks and libs drop older browsers, so it would probably simplify history.js to do so too (ie who uses IE6 or safari 4 any more) ...
This could allow to keep more lightweight

@istrasoft
Copy link

@balupton Regarding API standards, why does History fire the statechange event handler as soon as History.pushState is called programmatically, while the API states that popstate event should not be fired upon call to pushState ? Any plans to do something about it maybe, given the extra long and old thread of comments ? #96

@balupton
Copy link
Member Author

@istrasoft I believe that in a beta build I was working on before I handed it over to @andreasbernhard I had caused the separation. It was initially done as best practice that I had used in all my applications, however considering the noise it generated, any potential benefit of it is drowned by the noise — which may or may not be without its great reasons too.

@mreinstein substack's projects are maintained by people actively using them, rather than people supporting them who aren't actively using them. There are plenty of projects that substack and tj no longer maintain, but the community of people using them, maintain them. For what it's worth, this desire of maintenance over support, certainly may be disappointing to the consumer, however open-source consumerism is a force that steals away the souls of good hearted maintainers and eventually drives them to insanity. Originally, I did support History.js by myself, but it is too much for any single person to maintain individually, they can try, but at the end of the day, if they accept more than they can, and more then they are able to, and more than they are interested in, they will burn out. Just because a person made an open-source project, and it has value to many people, doesn't mean that person is now enslaved into eternal support of it, having the project own them, and control their lives. There is a good discussion about this going on here isaacs/github#167 about how project creators are struggling with the pressures and their coping techniques.

@mreinstein
Copy link

There are plenty of projects that substack and tj no longer maintain,
but the community of people using them, maintain them

I am not suggesting that every project those people have created are 100% maintained and kept up-to-date. However the fact that many people are actively maintaining more than zero is evidence to the contrary that large, healthy open source projects can exist without a "boatload of cash" being injected into them.

open-source consumerism is a force that steals away the souls of good
hearted maintainers and eventually drives them to insanity

I hope you're not accusing anyone here of being an "open source consumerist". I don't think it's fair to treat a simple question about whether a project is still being maintained as being some kind leeching activity. No one is asking you to do all the work, or really any of it. All we're saying is that in it's present form, this isn't working. Somebody or some people need to keep maintaining this project because a lot of folks depend on it. I have offered some help in getting started with this. I think there has been some concern raised over the ownership of the project by a company as well.

Just because a person made an open-source project, and it has value to many people,
doesn't mean that person is now enslaved into eternal support of it, having the project
own them, and control their lives.

Again, no one is "enslaving" you. Just trying to find a way as a community to keep this popular library afloat. If this isn't possible maybe the community should fork.

@istrasoft
Copy link

Or just use https://github.com/devote/HTML5-History-API which I ended up doing.

@mreinstein
Copy link

I've started a repo for the history-acid tests that @balupton mentioned earlier https://github.com/mreinstein/history-acid

I think a great first step would be to code tests that trigger all the bugs that are documented in history.js to evaluate any polyfill's effectiveness.

@rbelouin
Copy link

I'm new to History.js and feel concerned by this thread.

I need to use this library in production, and look forward seeing some pull requests merged. Should I find an alternative ? or will these PR be merged one day?

If this isn't possible maybe the community should fork.

I have to admit this sounds interesting.

@mreinstein
Copy link

@rbelouin the project is dead. given http://beta.caniuse.com/#search=history I don't think this library is that important if you're able to target reasonably modern browsers.

@rbelouin
Copy link

@mreinstein ok, thank you for the reply!

@balupton
Copy link
Member Author

See #417

@mreinstein

@rbelouin the project is dead. given http://beta.caniuse.com/#search=history I don't think this library is that important if you're able to target reasonably modern browsers.

They still and will always behave differently, history.js's intent isn't just compat for old browsers, but compat for new browsers: https://github.com/browserstate/history.js/wiki/The-State-of-the-HTML5-History-API

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

5 participants