Cookies op Tweakers

Tweakers maakt gebruik van cookies, onder andere om de website te analyseren, het gebruiksgemak te vergroten en advertenties te tonen. Door gebruik te maken van deze website, of door op 'Ga verder' te klikken, geef je toestemming voor het gebruik van cookies. Wil je meer informatie over cookies en hoe ze worden gebruikt, bekijk dan ons cookiebeleid.

Meer informatie

Software-update: Meteor 1.5.1

Door , 0 reacties, bron: Meteor

03-08-2017 • 15:00

0 Linkedin Google+

Bron: Meteor

Meteor is een opensource framework voor JavaScript op het web. Het gebruikt Node.js en biedt bijvoorbeeld ondersteuning voor MongoDB voor het ophalen en opslaan van data. Voor meer informatie verwijzen we jullie door naar deze pagina. Het ontwikkelteam heeft versie 1.5.1 van Meteor uitgebracht voorzien van de volgende aankondiging:

Announcing Meteor 1.5.1
Easier bundle visualization, server-side rendering and Node.js security updates


We’re pleased to announce the release of Meteor 1.5.1 and some exciting features that came with it!

Though Meteor 1.5 was a relatively large release, and was received with much fanfare throughout the community, from a development standpoint it contained relatively few breaking changes and caused remarkably few new bug reports. This stability and ease of updating was due to the excellent and thorough feedback we received from a legion of developers during the 1.5 beta process. If your development team hasn’t become involved in testing pre-release versions of Meteor, please consider lending a hand by following Meteor release pull requests. Meteor 1.5.2 is coming soon and Meteor 1.6 (with Node.js 8) is in the works too!

The most pressing reason to release Meteor 1.5.1 was due to vulnerabilities in Node.js announced in July by the Node.js Foundation; however, there are many exciting improvements that we don’t want to gloss over! But first…

How to upgrade
To update an existing app to Meteor 1.5.1, simply run meteor update in any Meteor application directory.

Server-side rendering
Meteor 1.5.1 comes with Meteor’s first implementation of a server-side rendering package called server-render.

The first content delivered to the browser after an HTTP request is included within the response to that request. In Meteor we generally call it the “boilerplate” but this is the content which is visible when doing a “View Source” in the browser.

In a Meteor app, the boilerplate includes everything necessary to bootstrap an application and load the rest of the assets including script tags for the Meteor JavaScript app bundle and remote libraries, CSS stylesheets, an HTML <head> tag with various metadata (page <title>, etc.) and an HTML <body> tag which acts as a target for the rest of the content to be rendered into programmatically.

For some applications, rendering additional content into the initial server response HTML can be important. For example, some apps may see performance gains by having particular HTML structure already present in the initial server response and others may need more control over what’s rendered for SEO reasons.

Previously, the only way to control the contents of the boilerplate was by setting request.dynamicHead or request.dynamicBody from the connect handlers on WebAppInternals, and these techniques provided no hooks for interacting with existing static HTML rendered by packages like static-html (a common alternative to blaze-html-templates for non-Blaze apps).

The new server-render package exposes an onPageLoad method which accepts a callback which is called at the appropriate time during the request. The lone argument to callback is a “sink” equipped with various facilities for modifying the initial HTTP response including appendToHead, appendToBody, appendToElementById and renderIntoElementById. Additionally, the callback can return a Promise if it needs to do additional work asynchronously, and the response will be rendered when the Promise is eventually resolved.

For more information on this exciting new feature check out the docs for server-render.

Easier bundle visualization
One of the most popular new features in Meteor 1.5 was the bundle-visualizer package, which allowed developers to see exactly what was in their initial JavaScript bundles. This feature was so exciting and useful that most Meteor developers didn’t mind (much) that using the initial version was pretty awkward: in addition to passing the --production option to simulate a production build (for realistic bundle analysis), it was necessary to run meteor add bundle-visualizer and then remember to meteor remove bundle-visualizer before deploying to production.

This process has been significantly improved in Meteor 1.5.1, thanks to a new --extra-packages option which includes additional packages for a single execution of meteor only. Instead of the extra steps above, it’s now possible to simply run:
meteor --extra-packages bundle-visualizer --production

This feature supports any Meteor package and also supports version constraints (i.e. package-name@x.y.z), so you can add or override a specific package temporarily. This is thanks to the great work in pull request #8769 from community contributor Michał Powaga.

Pub/Sub improvements
The publication and subscription portion of Meteor is one of the most time-tested and feature-complete portions of Meteor; however, it hasn’t seen much love in recent versions.

Meteor 1.5.1 brought both bug fixes and feature improvements:
  • Meteor.userId() and Meteor.user() can now be used in publications whereas previously it was necessary to use this.userId. This usage is much more consistent with other parts of Meteor.
  • The this.onStop callback in a publication is now run with the publication’s this context for a consistent publication environment.
  • The this.onReady callback in a subscription is now fired consistently during a re-subscription. Previously, it was only called if the arguments were different but this makes the behavior more intuitive. This could be a breaking change for a small percentage of applications, so please consult the version history for more information!
  • Method calls (i.e. Meteor.call(...)) which are called from publications will now inherit the this.connection from the publication in order to allow the examination of the subscribed client’s connection properties.
Thanks to Mitar for championing these improvements!

Other notable changes
  • ReactiveDict now supports the setting of an initial value upon instantiation (PR #8654, thanks to Simon Fridlund):
    const dict = new ReactiveDict('dataLookup', { item1: 'val' });
  • The upsert behavior in minimongo and mongo now complies with the behavior present in Mongo v2.6 or higher. (PR #8815, thanks to Seba Kerckhof)
  • accounts-facebook has been updated to use Facebook API v2.9 following the deprecation of v2.3 earlier this month. (PR #8858)
  • standard-minifier-js will now replace any process.env.NODE_ENV expressions with a string literal (e.g. "development" or "production") when minifying, which should alleviate the problem of React Dev Tools alerting that an incorrect build of React was being used. (PR #8786)
Looking forward
We’re sure there will be some other routine and incremental updates in Meteor 1.5.2, and Meteor 1.6 is sure to be one of the best updates we’ve seen in a while. With each new release, we continue to align Meteor with the latest and greatest technology in the JavaScript community. Be sure to follow those pull requests to see what’s coming next!

If you’re interested in getting involved in Meteor development, the best way to start is by reading our Development.md guide.

Lastly, please don’t forget to show your support for our awesome community members who help make all this progress possible. Aside from the mentions above, we’d like to give a heartfelt shout-out to Hugh Willson for all of his tireless and amazing work on the project and in the community. 👏
Versienummer 1.5.1
Releasestatus Final
Besturingssystemen Windows 7, Android, Linux, macOS, Windows Server 2008, iOS, Windows Server 2012, Windows 8, Windows 10
Website Meteor
Download https://www.meteor.com/install
Licentietype Voorwaarden (GNU/BSD/etc.)

Update-historie

Reacties


Er zijn nog geen reacties geplaatst

Op dit item kan niet meer gereageerd worden.


Apple iPhone X Google Pixel 2 XL LG W7 Samsung Galaxy S8 Google Pixel 2 Sony Bravia A1 OLED Microsoft Xbox One X Apple iPhone 8

© 1998 - 2017 de Persgroep Online Services B.V. Tweakers vormt samen met o.a. Autotrack en Hardware.Info de Persgroep Online Services B.V. Hosting door True

*