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

Release v2.0.0 #87

Closed
nicksnyder opened this issue Feb 14, 2018 · 18 comments · Fixed by #92
Closed

Release v2.0.0 #87

nicksnyder opened this issue Feb 14, 2018 · 18 comments · Fixed by #92
Assignees
Milestone

Comments

@nicksnyder
Copy link
Owner

nicksnyder commented Feb 14, 2018

I have started to prototype what v2 of this library might look like.

The overall goals of v2 are to

  1. Address all issues that are currently open on the project
  2. Apply some Go best practices to the codebase (e.g. remove global state, explicit error returns)
  3. Revisit API design and make breaking changes which are necessary to accomplish (1) and (2).

My development plan is to work on this in a branch until I am happy with the results. Then, I will merge this into master under a subfolder called v2-beta and tag a 1.x.0 release. Projects can then begin to try out the new API and provide feedback. APIs under v2-beta subfolder will be subject to change pending community feedback. Once I am happy with the results, I will make a final 1.x.0 release that contains the v2 api under the v2 subfolder. Immediately following that, I will delete the v1 package files, move v2-beta to the root of the repository, and tag 2.0.0.

I do not have an estimate for when this work will be complete as I am working on it in spare time here and there.

If you have general feedback about this process it can be shared here.
If there are other things you would want to see in a world where breaking API changes are possible, please create a new issue and I will consider it.

@nicksnyder nicksnyder added this to the v2 milestone Feb 14, 2018
@nicksnyder
Copy link
Owner Author

nicksnyder commented Mar 1, 2018

Given Russ Cox's excellent series of posts on versioning in Go (read all 7 starting with this https://research.swtch.com/vgo-intro), I have slightly modified the original plan.

Instead of making a backwards incompatible change to the existing package, the new version of the api will be published to a v2 subdirectory and v1 of the library will remain indefinitely at its original import path.

@nicksnyder nicksnyder mentioned this issue Apr 10, 2018
Merged
4 tasks
@nicksnyder nicksnyder self-assigned this Apr 10, 2018
@nicksnyder
Copy link
Owner Author

I just tagged 2.0.0.beta.1. Please test and file any issues.

@nicksnyder nicksnyder reopened this Apr 15, 2018
@nicksnyder nicksnyder changed the title Announcement: v2 Release v2.0.0 Apr 15, 2018
@ghost
Copy link

ghost commented Apr 15, 2018

:) thankyou

@bubenkoff
Copy link

@nicksnyder extract doesn't seem to work.
ran it with json format and got empty toml file.

goi18n extract -sourceLanguage en-us -format json -outdir locales objects/ service/

got

active.en-US.toml

which is empty

@nicksnyder
Copy link
Owner Author

nicksnyder commented Apr 17, 2018

thanks for the bug report, will investigate

@mvrhov
Copy link

mvrhov commented Jul 17, 2018

Use fasttemplate instead of text/template. It's a lot faster at replacement.

@taraspos
Copy link
Contributor

taraspos commented Aug 3, 2018

Any timelines for this release?

@nicksnyder
Copy link
Owner Author

No particular timeline, I was giving the beta's time to bake and see if any major issues were reported.

In the meantime, beta tagged releases are available: https://github.com/nicksnyder/go-i18n/releases

The latest is v2.0.0-beta.5

@Seklfreak
Copy link
Contributor

I hope this library will continue to use text/template, not switch to fasttemplate. text/template offers much more than just replacing simple text, such as pipelines and functions. I didn't see that taking a quick look at fasttemplate. If fasttemplate does support that stuff you can ignore my argument.

@nicksnyder
Copy link
Owner Author

text/template will be the default for the foreseeable future. If there is demand for other template engines, support for that can be added genericly without breaking backwards compatibility

@nicola-spb
Copy link

What about performance?

@nicksnyder
Copy link
Owner Author

What about performance?

What about it? Do you have a use case where the current performance is a bottleneck in your program?

There are benchmarks in https://github.com/nicksnyder/go-i18n/blob/master/i18n/translation/template_test.go that you can run.

On my 2015 Macbook Pro I get the following results:

BenchmarkExecuteNilTemplate-8          	1000000000	         2.31 ns/op
BenchmarkExecuteHelloWorldTemplate-8   	1000000000	         2.56 ns/op
BenchmarkExecuteHelloNameTemplate-8    	 2000000	       642 ns/op

~1 microsecond for a single template translation seems not unreasonable to me, but if you do have a use case where performance is very sensitive, then please open a new issue to discuss and we can think about making template engines pluggable.

@nicola-spb
Copy link

I switched to ver. 2. I have about 50-70 messages on page. It`s not bottleneck for me but if performance will be better then ver 1 it will be good.

@nicksnyder
Copy link
Owner Author

nicksnyder commented Nov 24, 2018

I just released v2.0.0-beta.6.

I am pretty happy with the API and anticipate tagging 2.0.0 soon with no further incompatible API changes.

@QuLogic
Copy link

QuLogic commented Jan 15, 2019

Any timeline for that final tag?

@nicksnyder
Copy link
Owner Author

Life got busy so I don’t have a timeline.

I wanted a chance to look into #146 before tagging the final release in case the api needed to change in any way.

@nicksnyder
Copy link
Owner Author

I just tagged v2.0.0-beta.7. There is one small backwards incompatible change from beta.6, which is that you now need to call NewBundle to create a bundle (instead of using a struct literal). See https://github.com/nicksnyder/go-i18n/pull/163/files.

There are no more known issues filed on the repo that would prevent v2.0.0 from being tagged but I am going to let beta.7 bake for a bit before actually tagging v2.0.0.

@nicksnyder
Copy link
Owner Author

v2.0.0 is released!

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 a pull request may close this issue.

7 participants