Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Support multiple entry points via new mains options, remove entry option #487

Merged
merged 1 commit into from
Nov 29, 2017
Merged

Support multiple entry points via new mains options, remove entry option #487

merged 1 commit into from
Nov 29, 2017

Conversation

eliperelman
Copy link
Member

Fixes #367. Still a WIP, and still need docs.

@eliperelman eliperelman requested a review from a team November 23, 2017 17:58
https: false,
contentBase: neutrino.options.source,
open: false,
hot: true,
historyApiFallback: true,
publicPath: '/',
headers: {
host: publicHost
host: `${publicHost}:${port}`
Copy link
Member

@helfi92 helfi92 Nov 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why we include the port in the host if it's defined in port?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This: https://github.com/mozilla-neutrino/neutrino-dev/pull/487/files#diff-e157c45007fb7ba6df1afdf15e78279eR46

I wouldn't work everywhere without doing it like this. Or maybe it should only be set for public?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just public.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try it out and see what happens.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, I thought this was editing devServer.host, but this is actually the HOST header we are modifying. The host header needs the port as well, not just the domain/host portion.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edmorley could you give this a sanity check?

@edmorley
Copy link
Member

Yeah definitely - I'll do so within the next 24 hours :-)

@eliperelman
Copy link
Member Author

Going to merge this, but feel free to review whenever.

@eliperelman eliperelman merged commit d3b35a5 into neutrinojs:master Nov 29, 2017
Copy link
Member

@edmorley edmorley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is amazing, thank you!

The only other place that needed to be adjusted for multi-entrypoint that I could find was html-template, but that's been fixed since in:
https://github.com/mozilla-neutrino/neutrino-dev/pull/509/files#diff-f7eeb689dea27b680d5b7fd733b51ec9R167

plugins: ['react']
plugins: ['react'],
rules: {
'react/react-in-jsx-scope': 'off'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@@ -53,10 +54,10 @@ module.exports = (middleware, args) => {
compiler.plugin('done', () => {
building.succeed('Build completed');
});
compiler.plugin('compile', () => {
compiler.plugin('compile', debounce(() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment explaining why this is needed? (I thought Ora did debouncing? https://github.com/sindresorhus/ora#interval)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't debouncing the animation, rather this is debouncing the compile event. If devServer gets several updates in a row, like an editor writes multiple files at different times, the compiler will send several compile events, which causes a lot of noise in the terminal. This tries to reduce that logging noise to just once per second.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add comment. :)

@@ -53,4 +54,12 @@ module.exports = (neutrino, opts = {}) => {
.set('react-dom', 'preact-compat')
.set('create-react-class', 'preact-compat/lib/create-react-class')
.set('react-addons-css-transition-group', 'preact-css-transition-group');

neutrino.config.when(neutrino.config.module.rules.has('lint'), () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this change related to the rest of the PR? I couldn't see anything explaining it in the commit message or review comments?

Also could you add a comment explaining why this is needed? :-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes it so we can use JSX without having to manually say:

import React from 'react';

This was supposed to be part of the create-project fixes, but I did that work in tandem with this one because they were interlinked, and I tried to split them out, but unfortunately missed a few things.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

3 participants