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

user require syntax for partials #3

Closed
wants to merge 1 commit into from

Conversation

martell
Copy link

@martell martell commented Jul 17, 2018

This is blocked by
parcel-bundler/parcel#1744
which I now have a PR for.
Hopefully we can get this in before v1.9.8
I will update this PR to point to that tag then instead of using the master branch

Copy link
Owner

@edm00se edm00se left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. I had seen parcel-bundler/parcel#1732 and was waiting for it to be included in a version release to make the changes. I am pretty excited for it. Once the npm version bumps and includes the update, I'll be happy to accept and merge this.

package.json Outdated
@@ -32,7 +32,7 @@
"babel-preset-stage-2": "6.24.1",
"gh-pages": "1.2.0",
"node-sass": "4.9.0",
"parcel-bundler": "1.9.4",
"parcel-bundler": "parcel-bundler/parcel",
Copy link
Owner

Choose a reason for hiding this comment

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

I'd like to wait for the changes to be part of a version release. We'll need to update the version here once that's been done.

@@ -12,7 +10,7 @@ angular
.directive('navBar', function() {
return {
restrict: 'E',
template: fs.readFileSync('./src/partials/nav.html', 'utf8'),
template: require('../partials/nav.html', 'utf8'),
Copy link
Owner

Choose a reason for hiding this comment

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

One of the , 'utf8' second parameters got missed.

@martell
Copy link
Author

martell commented Jul 17, 2018

I updated the PR to point to what I expect to be the next release version.

Thanks for working on this project to give people a good example on how to modernize their old angularjs 1.x apps.

@absynce
Copy link

absynce commented Aug 17, 2018

Should this update the migration guide too? It currently shows an example of the prior way to load partials.

@edm00se
Copy link
Owner

edm00se commented Aug 17, 2018

@absynce Thanks for checking. Once merged I'll make sure to update the migration guide. You're right, it currently shows use of fs.readFileSync.

@edm00se
Copy link
Owner

edm00se commented Sep 30, 2018

Thanks again for the PR. It has been incorporated into #6 so it can get released tonight quickly while I had a few minutes. It was an easy way of handling the merge conflict that came up as well as upgrading another dep and adding the package-lock file. The app is now building with parcel 1.10.1! 🎉

I've also updated the docs/Migrate.md migration guide to reflect the direct use of require.

For the wayward reader looking for context, the release of parcel-bundler after 1.9.7 wound up being 1.10.0. Blog post: https://medium.com/@devongovett/parcel-v1-10-0-babel-7-flow-elm-and-more-c20736553573

@edm00se edm00se closed this Sep 30, 2018
@edm00se
Copy link
Owner

edm00se commented Jan 15, 2019

Support for IE is currently blocked until the html loader handling changes for either:

  • the bundle loader not directly depending on Promise or fetch APIs in the browser (un-polyfilled, before any babel polyfill takes effect)
  • the html partials not be separate bundles (appended to the existing bundle)

See #14.

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

Successfully merging this pull request may close these issues.

None yet

3 participants