-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Framework: Move to Node 4 #1204
Conversation
It would be cool to merge #730 to avoid some duplication. I will give 4.4.2 a test with vagrant. With regards to merging this, I think a similar approach to the |
One little wrinkle I ran into: on Node v4+, it appears that the default http listener only listens on an IPv6 loopback, if it's available. If not, it falls back to the normal 127.0.0.1 IPv4 address. I had to update my |
Bah, I transposed the node version on the branch name and the commit. Should be 4.2.2, not 4.4.2. Fixing the commit. |
1d3d5a5
to
d3be21a
Compare
Redid this on top of master now that #730 landed |
81e0012
to
7eebb33
Compare
Hmmmm... So switching Circle CI over to node 4.2.2 breaks the build, even if built with a clean cache. It appears to be breaking on contextify? Maybe jumping up to a current jsdom would help there. It's pretty disconcerting to see all the build errors. |
@sirbrillig I think you mentioned the latest jsdom doesn't need |
defde4b
to
a7e44e1
Compare
Yup, that's correct! Relevant comment.
Also this:
|
a7e44e1
to
03c6ef5
Compare
So we'd have to get everyone to upgrade to |
98f2c9d
to
2ce2a1d
Compare
@@ -3,7 +3,7 @@ require( 'lib/react-test-env-setup' )(); | |||
/** | |||
* External Dependencies | |||
*/ | |||
var sinon = require( 'sinon' ), | |||
const sinon = require( 'sinon' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this change need to be made? If we're changing things, I'd rather see this go to import
syntax than to const
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was mostly to quiet up eslint.
Don't forget to update the node engine version to our minimum supported version in
|
Done. Interesting reading at http://www.marcusoft.net/2015/03/packagejson-and-engines-and-enginestrict.html. Looks like it's mostly advisory since we're the app. |
Yup, it sadly only warns you if your package is installed as a dependency, but as a node developer it's still the first place I check for version compatibility. |
A version check for Node in the Makefile might make sense, as suggested elsewhere by @jkudish. Something like this as a target: node-version:
@if [ "$(shell $(NODE) --version | sed 's/[^0-9]//g')" -lt 400 ]; then echo "Please upgrade your version of Node.js: https://nodejs.org/"; exit 1; fi |
I added this a slightly different way, using a node script and the semver property in package. This way it could work on Windows too, and we have a single source of truth for the necessary node version. |
That's way better! Awesome. 👍 |
Except semver isn't baked in... sigh. |
I force-pushed a rebase to account for tests added in #550 which would have broken after the upgrade here (fixup'd into b81e2de). I also fixed the version compare script to pull the |
5767b7b
to
e2ee3d1
Compare
Sounds useful, though it would appear that we'd need to update Make targets to use |
Nah, it just makes |
Hrm, serving |
This was due to the new |
Also fix the duped styles in follow-button.
The URL spec lets it resolve relative URLs without exploding. I also turned off resource loading to prevent any accidental requests from going out when using JSDom. Last, expose the history object for page.js to use.
Since `semver` is not default to node but is included in any npm installation
This allows the dependency to run, but not foul the dep tree. With it as a normal dep, it would cause any target that depended upon it to re-run, every time it was invoked. This made a target like build-css rerun for every http request, which slowed things down considerably. See https://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html for more info on order-only deps
338e3e9
to
6b0fb9c
Compare
Just got this up and running, pretending to be a production node using my local setup, and it seems to work just fine. I think this is ready to go. |
I think it's good to go too, works fine for me 👍 |
Somehow I broke this with the last commit on #1204 and didn't notice. This re-instates the call to `check-node-version` to inform folks on old nodes that they need to upgrade
This moves us up to Node v4.2.3, the current LTS version, in the Docker container. This needs a fair bit of testing and should not be merged until we're pretty happy with it.
Yes, the branch name is wrong.
To test, you'll need to
env-config.sh
to the root of the project which exports CALYPSO_ENV set to a environment you want to testvagrant up
TODO:
circle.yml
to tell Circle CI which node to useengines
inpackage.json
Makefile
target that checks node version and explodes if the dev is on pre 4.2.3.