-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
Template compilation on the server (discussion) #16
Conversation
Tried to get everything to an rc.0 of the very latest version, which required some research in some cases about the published versions. For example, some packages had version histories like: ``` ... 1.0.3-winr.2 January 20th, 2015 1.0.3-winr.3 February 24th, 2015 installed 1.0.3 March 17th, 2015 installed 1.0.4-anubhav.0 August 6th, 2015 1.0.4-plugins.0 July 22nd, 2015 1.0.5-galaxy.0 July 17th, 2015 ``` In this case, I would bump the version from `1.0.4-plugins.0` to `1.0.5-rc.0`, skipping `1.0.4`.
Tried to get everything to an rc.0 of the very latest version, which required some research in some cases about the published versions. For example, some packages had version histories like: ``` ... 1.0.3-winr.2 January 20th, 2015 1.0.3-winr.3 February 24th, 2015 installed 1.0.3 March 17th, 2015 installed 1.0.4-anubhav.0 August 6th, 2015 1.0.4-plugins.0 July 22nd, 2015 1.0.5-galaxy.0 July 17th, 2015 ``` In this case, I would bump the version from `1.0.4-plugins.0` to `1.0.5-rc.0`, skipping `1.0.4`.
Tried to get everything to an rc.0 of the very latest version, which required some research in some cases about the published versions. For example, some packages had version histories like: ``` ... 1.0.3-winr.2 January 20th, 2015 1.0.3-winr.3 February 24th, 2015 installed 1.0.3 March 17th, 2015 installed 1.0.4-anubhav.0 August 6th, 2015 1.0.4-plugins.0 July 22nd, 2015 1.0.5-galaxy.0 July 17th, 2015 ``` In this case, I would bump the version from `1.0.4-plugins.0` to `1.0.5-rc.0`, skipping `1.0.4`.
Tried to get everything to an rc.0 of the very latest version, which required some research in some cases about the published versions. For example, some packages had version histories like: ``` ... 1.0.3-winr.2 January 20th, 2015 1.0.3-winr.3 February 24th, 2015 installed 1.0.3 March 17th, 2015 installed 1.0.4-anubhav.0 August 6th, 2015 1.0.4-plugins.0 July 22nd, 2015 1.0.5-galaxy.0 July 17th, 2015 ``` In this case, I would bump the version from `1.0.4-plugins.0` to `1.0.5-rc.0`, skipping `1.0.4`.
Tried to get everything to an rc.0 of the very latest version, which required some research in some cases about the published versions. For example, some packages had version histories like: ``` ... 1.0.3-winr.2 January 20th, 2015 1.0.3-winr.3 February 24th, 2015 installed 1.0.3 March 17th, 2015 installed 1.0.4-anubhav.0 August 6th, 2015 1.0.4-plugins.0 July 22nd, 2015 1.0.5-galaxy.0 July 17th, 2015 ``` In this case, I would bump the version from `1.0.4-plugins.0` to `1.0.5-rc.0`, skipping `1.0.4`.
Tried to get everything to an rc.0 of the very latest version, which required some research in some cases about the published versions. For example, some packages had version histories like: ``` ... 1.0.3-winr.2 January 20th, 2015 1.0.3-winr.3 February 24th, 2015 installed 1.0.3 March 17th, 2015 installed 1.0.4-anubhav.0 August 6th, 2015 1.0.4-plugins.0 July 22nd, 2015 1.0.5-galaxy.0 July 17th, 2015 ``` In this case, I would bump the version from `1.0.4-plugins.0` to `1.0.5-rc.0`, skipping `1.0.4`.
The comments are not related to the fix, they are just for future reference. The fix is that having an "own" property named `constructor` should not disqualify an object from being considered an "instance of some class." Instead, we should detect that an object like `{constructor: ...}` is a plain object by noting that `!(x instanceof x.constructor)`.
1. Add `addAssets` API to `package.js` 2. Rename `getSourcesFunc` to `getFiles` in internal code 3. Changed `PackageAPI#sources` to `PackageAPI#files` with a new structure that has separate objects for assets and sources 4. Added some tests for different error conditions 5. The same file can now be a source and an asset
Refactored packages into multiple packages.
Yes. I have made similar changes in Blaze Components to get them to work on the server side. There are some issues. Like that if you make So it is not really possible to create isomorphic templates by default. I had to do some more changes: peerlibrary/meteor-blaze-components@6fd2454 Ideally, |
Hey, thanks for the quick reply and all the refs. This all looks awesome, so glad you're on this! I'm going to amend my blaze-react-component to work with blaze-components over the weekend and make that the official recommendation (I'll mention the HEAD on server issue, yeah, as per your issue on Meteor, the way it's down is quite weird). |
I like this idea, but I moved it to "future ideas" on the roadmap because I believe first we need to get Blaze itself into a shape for a stand-alone project. But yes, that would be great to have. I do see here two steps:
|
Yes absolutely, I agree 100%. I didn't also mention, how happy I am to see Blaze (and related) under your curatorship now... only wish it had happened earlier. |
Let's start maybe working on this? So I think we also need tests to make sure everything works. |
@mitar, regrettably - from my side at least - I don't foresee any opportunity to work on this for the remainder of this year. I'm also not using Blaze in any current projects so don't have too much personal incentive in the future either :( - other than a big past love for Blaze! I hope you and others will be able to move this issue forward. I'm delighted that Blaze is functioning in it's own repo now, in community hands. |
We should probably change this as well: https://github.com/meteor/blaze/blob/master/packages/blaze/attrs.js#L251 |
I cleaned |
I am closing this pull request in favor of #223 which describes what should be done. So that maybe somebody else can take this on. |
Is there any reason we don't already do this?
I made the changes in this PR and surprisingly everything just worked. Of course it needs a little more thought.
Template.body.renderToDocument()
is never called on the server but obviously that code shouldn't be bundled for the server either.Obviously this is a great help for SSR, e-mail generation, etc.
Actually if I comment out https://github.com/gadicc/meteor-blaze-react-component/blob/master/test-app/server/main.spec.js#L17-L30 and replace it with
import './body.html'
, we get SSR of Blaze templates via React (sorry :)).I imagine flowrouter-ssr could also add this since they explicitly state that the only reason they don't do it is because Blaze templates aren't available on the server.