Though they don't appear to actually be used anywhere by Meteor, it's
probably worth preserving them in case they are somehow exposed
elsewhere. Static class properties would avoid this, but the TC39
proposal is still progressing.
* boilerplate refactor wip
* rename files
* make switching between old/new easier
* refactor and modernize boilerplate-generator
* add cordova template code
* delete old boilerplate-generator
* small style fixes
* address comments
* address review comments again
* remove boilerplate generated-by comment
* delete spacebars templates
* add boilerplate-generator-tests
* bump boilerplate-generator version
* dummy commit
* Revert "dummy commit"
This reverts commit 54fe867690.
* update tests
* refactor parameter destructuring
* fix style
* modernize boilerplate generator a bit
* refactor boilerplate-generator
* fix web browser template
* refactor boilerplate-generator-tests
* rename files using hyphens
* Remove spaces after object-shorthand method names.
Per the comment in
https://github.com/meteor/meteor/pull/8820#discussion_r123635284
Previously, only the `constructor` method was addressed and this expands
on that.
* Add some space for legibility between conditionals.
This restores the behavior of 8c70716954 by
default, with the option of disabling the prioritized file watching system
by setting METEOR_WATCH_PRIORITIZE_CHANGED explicitly to "false".
The self-tests where the environment variable is explicitly set form a
nice to-do list of tests that should be improved to be more robust to cope
with differences in file watcher timing.
Helps with #8648 and similar issues.
Although I think 8c70716954 is a good idea
in practice, it altered the timing of self-tests enough to cause a number
of failures, so for now that behavior will be gated behind the environment
variable METEOR_WATCH_PRIORITIZE_CHANGED.
This drastically reduces the number of open file descriptors by not
preemptively acquiring a file descriptor for every watched file.
The downside is that the first time you edit a particular file, you may
have to wait up to DEFAULT_POLLING_INTERVAL milliseconds before Meteor
notices the change. The upside is that changes will be detected
instantaneously for that file in the future, even after restart.
If holding open too many file descriptors is indeed a contributing factor
to issues such as #8648, then this change should go a long way towards
mitigating those problems.
cc @abernix @hwillson
Render callbacks can now inject HTML content into multiple different
elements, and may also append content to the <head> or <body> elements, on
both the client and the server.
This new API was inspired by trying to use the styled-components npm
package on the server, which involves not only rendering and injecting
static HTML somewhere in the <body>, but also appending the resulting
<style> tag(s) into the <head>:
import { onPageLoad } from "meteor/server-render";
import { renderToString } from "react-dom/server";
import { ServerStyleSheet } from "styled-components";
onPageLoad(sink => {
const sheet = new ServerStyleSheet();
const html = renderToString(sheet.collectStyles(
<App location={sink.request.url} />
));
sink.renderIntoElementById("app", html);
sink.appendToHead(sheet.getStyleTags());
});
Note that the server-render package now exports an onPageLoad function,
rather than the old renderIntoElementById function. The functionality of
renderIntoElementById is now exposed by the {Client,Server}Sink API.
I say the client-side version of this API is 'isomorphish' to the
server-side version, because ClientSink methods can accept DOM nodes in
addition to raw HTML strings, whereas DOM nodes don't really make sense on
the server.