Skip to content
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

Upgrade to Foundation 6.4.0? #50

Open
huphtur opened this issue Jun 28, 2017 · 21 comments
Open

Upgrade to Foundation 6.4.0? #50

huphtur opened this issue Jun 28, 2017 · 21 comments

Comments

@huphtur
Copy link
Member

huphtur commented Jun 28, 2017

Upgrading to Foundation 6.4.0 seems to break a few things. Anyone have any idea why?

@core77
Copy link
Member

core77 commented Jun 29, 2017

@huphtur Can you provide more information about what's happening?

@huphtur
Copy link
Member Author

huphtur commented Jun 29, 2017

here's what I did:

After running npm start, the kitchen sink page loads with the correct styling but non of the javascript seems to work.

@core77
Copy link
Member

core77 commented Jul 2, 2017

Do you want to push your branch as a PR?

@core77
Copy link
Member

core77 commented Jul 2, 2017

Check the 'no bower' branch here: https://github.com/kculmback/jekyll-foundation

Perhaps @kculmback wants to open a PR when Foundation 6.4 is running fine? Dropping bower and mange all the assets with npm or yarn sounds interesting.

@kculmback
Copy link
Contributor

kculmback commented Jul 2, 2017 via email

@kculmback
Copy link
Contributor

kculmback commented Jul 13, 2017

Alright so I got the SCSS working fine. However, I'm running into an issue with Foundation's javascript. It is included in the all.js file, however none of it works.

I get this error in the console:
Uncaught SyntaxError: Unexpected token import
Which refers to:
import $ from 'jquery';

I can get rid of the error by adding a .babelrc file with the following code:
{ "presets": ["es2015"] }
However this produces a new error:
Uncaught ReferenceError: exports is not defined at foundation.core.js:1

I'll keep messing with it, but I'm a little out of my element with this one. Babel/ES2016 and Gulp are weaker areas of mine. So if you have any suggestions, I would be open to them!

@kculmback
Copy link
Contributor

Alright so I got the javascript to work. Foundation includes transpiled js files in their dist folder, so I switched to using those instead.

I'll do a few more checks and clean up the code and then make a pull request when I'm finished.

It may be worth in the future though working to properly implement Babel & ES2016, as that seems to be the sticking point. It looks like the Foundation 6.4 template uses the gulp plugins webpack and webpack-stream in their gulp file alongside babel. Doing the same thing here may be a good place to start. I'll try it out sometime in the future and see if I can get it to work!

@huphtur
Copy link
Member Author

huphtur commented Jul 13, 2017

@kculmback tested your no-bower branch on my local machine, all seems to work good. Nice work. Agreed on a Babel setup.

@core77
Copy link
Member

core77 commented Jul 14, 2017

Good job @kculmback ! Thank you very much.

When running npm starti get an error:
Error: Cannot find module 'npmlog'
Can you guys confirm this?

yarn start and yarn build are running well.
Can you confirm this, too?

@kculmback
Copy link
Contributor

@core77 I wasn't able to reproduce the error on my local machine.

Steps I took:

  1. Delete jekyll-foundation folder
  2. Clone core77/jekyll-foundation to local machine
  3. Run bundle install
  4. Run yarn
  5. Run yarn start
  6. Run yarn build
  7. Run npm start

Everything seemed to be working fine. I also tried:

  1. Delete jekyll-foundation folder
  2. Clone core77/jekyll-foundation to local machine
  3. Run bundle install
  4. Run npm install
  5. Run npm start
  6. Run yarn start
  7. Run yarn build

Everything worked fine then as well. A cursory Google search makes it seem like the error is related to the global installation of npm and not the local usage in project. It may be worth updating your version of npm?

@huphtur
Copy link
Member Author

huphtur commented Jul 14, 2017

Everything working fine on my machine as well (had no idea one could also use yarn command to start/build!)

@kculmback
Copy link
Contributor

Alright, so I got it set up so that Foundation works without having to use their already transpiled files.

I set it up so that it very closely follows how Foundation does it, which is using the webpack gulp plugin. You can check it out here.

I'm pretty new to Webpack, so I'm not sure how using this method going forward would affect future users of this repo, especially if they want to include other js libraries that aren't optimized for webpack like Foundation.

Let me know your thoughts!

@huphtur
Copy link
Member Author

huphtur commented Jul 15, 2017

Tested it (even picking custom JS components) and all seems to work.

Since flexmode seems to be turned on by default $global-flexbox: true; probably best to include the appropriate components in _foundation.scss?

// @include foundation-grid;
@include foundation-flex-grid;
@include foundation-flex-classes;

How are you handling Normalize and Sassy-Lists??

That's all the comments I have so far @kculmback, will test some more after the weekend.

@kculmback
Copy link
Contributor

@huphtur I don't believe we need to import Normalize/Sassy-Lists manually. They're not referenced in the documentation at all.

And that's a good point about the grids! I've updated the comments on my version and will make a pull request.

@core77
Copy link
Member

core77 commented Jul 18, 2017

Since I updated node to 6.11.x npm startand npm run buildare running well again...

@core77
Copy link
Member

core77 commented Jul 18, 2017

I think we're done with this topic... When you agree, you can close the issue.

Thanks again Kasey for your efforts!

@huphtur @kculmback Or are there some TODOs left?

@kculmback
Copy link
Contributor

@core77 I think we're pretty much good to go. The only topic that is left is whether it would be worth it to switch to using the webpack gulp plugin, which I was able to get working. However, that could be it's own issue separate from this one.

@huphtur
Copy link
Member Author

huphtur commented Jul 18, 2017

@core77 Did some more testing and found an odd behavior.

Responsive Accordion Tabs only seems to work on the Kitchen Sink page. When I try it on the Sample page it ONLY works when I add<div data-off-canvas></div> to the page. Any idea what's going on here?

Bonus: it works fine on your babel branch!

@kculmback
Copy link
Contributor

@huphtur I was able to replicate the issue. I'll take a look into this in the next few days.

Also, for organization, to close this issue and open a new with regards to the responsive accordion and tabs, as well as any future 6.4 issues!

@huphtur
Copy link
Member Author

huphtur commented Oct 20, 2017

@kculmback how's the webpacking going? You confident enough to switch over? I tested your webpack branch locally and couldn't really find any issues.

(Sorry for sudden influx of activity, I'm in between projects and figured I spend some time closing couple of the tickets and move the project forward 😉)

@kculmback
Copy link
Contributor

@huphtur Honestly it's been awhile since I've looked at it! Let me double check it sometime over the next couple days, and I'll make a pull request if it looks alright

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

No branches or pull requests

3 participants